зеркало из https://github.com/mozilla/gecko-dev.git
Bug 941437 part 2. Remove the unused cx argument from UNWRAP_OBJECT and UNWRAP_WORKER_OBJECT. r=smaug
This commit is contained in:
Родитель
ae8b4cf576
Коммит
299e9bc2b3
|
@ -156,7 +156,7 @@ nsDOMMessageEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
|
|||
|
||||
if (!event->mWindowSource) {
|
||||
MessagePortBase* port = nullptr;
|
||||
nsresult rv = UNWRAP_OBJECT(MessagePort, aCx, aParam.mSource, port);
|
||||
nsresult rv = UNWRAP_OBJECT(MessagePort, aParam.mSource, port);
|
||||
if (NS_FAILED(rv)) {
|
||||
aRv.Throw(NS_ERROR_INVALID_ARG);
|
||||
return nullptr;
|
||||
|
|
|
@ -162,7 +162,7 @@ WebVTTListener::OnCue(const JS::Value &aCue, JSContext* aCx)
|
|||
}
|
||||
|
||||
TextTrackCue* cue;
|
||||
nsresult rv = UNWRAP_OBJECT(VTTCue, aCx, &aCue.toObject(), cue);
|
||||
nsresult rv = UNWRAP_OBJECT(VTTCue, &aCue.toObject(), cue);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
cue->SetTrackElement(mElement);
|
||||
|
@ -180,8 +180,7 @@ WebVTTListener::OnRegion(const JS::Value &aRegion, JSContext* aCx)
|
|||
}
|
||||
|
||||
TextTrackRegion* region;
|
||||
nsresult rv = UNWRAP_OBJECT(VTTRegion, aCx, &aRegion.toObject(),
|
||||
region);
|
||||
nsresult rv = UNWRAP_OBJECT(VTTRegion, &aRegion.toObject(), region);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mElement->mTrack->AddRegion(*region);
|
||||
|
|
|
@ -191,7 +191,7 @@ PostMessageWriteStructuredClone(JSContext* cx,
|
|||
}
|
||||
|
||||
MessagePortBase* port = nullptr;
|
||||
nsresult rv = UNWRAP_OBJECT(MessagePort, cx, obj, port);
|
||||
nsresult rv = UNWRAP_OBJECT(MessagePort, obj, port);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsRefPtr<MessagePortBase> newPort = port->Clone();
|
||||
|
||||
|
|
|
@ -4003,7 +4003,7 @@ nsHTMLDocumentSH::GetDocumentAllNodeList(JSContext *cx,
|
|||
// We already have a node list in our reserved slot, use it.
|
||||
JS::Rooted<JSObject*> obj(cx, JSVAL_TO_OBJECT(collection));
|
||||
nsIHTMLCollection* htmlCollection;
|
||||
rv = UNWRAP_OBJECT(HTMLCollection, cx, obj, htmlCollection);
|
||||
rv = UNWRAP_OBJECT(HTMLCollection, obj, htmlCollection);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
NS_ADDREF(*nodeList = static_cast<nsContentList*>(htmlCollection));
|
||||
}
|
||||
|
|
|
@ -7572,7 +7572,7 @@ PostMessageWriteStructuredClone(JSContext* cx,
|
|||
|
||||
if (MessageChannel::PrefEnabled()) {
|
||||
MessagePortBase* port = nullptr;
|
||||
nsresult rv = UNWRAP_OBJECT(MessagePort, cx, obj, port);
|
||||
nsresult rv = UNWRAP_OBJECT(MessagePort, obj, port);
|
||||
if (NS_SUCCEEDED(rv) && scInfo->subsumes) {
|
||||
nsRefPtr<MessagePortBase> newPort = port->Clone();
|
||||
|
||||
|
|
|
@ -2805,7 +2805,7 @@ NS_DOMWriteStructuredClone(JSContext* cx,
|
|||
void *closure)
|
||||
{
|
||||
ImageData* imageData;
|
||||
nsresult rv = UNWRAP_OBJECT(ImageData, cx, obj, imageData);
|
||||
nsresult rv = UNWRAP_OBJECT(ImageData, obj, imageData);
|
||||
if (NS_FAILED(rv)) {
|
||||
// Don't know what this is. Bail.
|
||||
xpc::Throw(cx, NS_ERROR_DOM_DATA_CLONE_ERR);
|
||||
|
|
|
@ -199,8 +199,7 @@ ErrorResult::ReportJSExceptionFromJSImplementation(JSContext* aCx)
|
|||
"Why didn't you tell us you planned to handle JS exceptions?");
|
||||
|
||||
dom::DOMError* domError;
|
||||
nsresult rv = UNWRAP_OBJECT(DOMError, aCx, &mJSException.toObject(),
|
||||
domError);
|
||||
nsresult rv = UNWRAP_OBJECT(DOMError, &mJSException.toObject(), domError);
|
||||
if (NS_FAILED(rv)) {
|
||||
// Unwrapping really shouldn't fail here, if mExceptionHandling is set to
|
||||
// eRethrowContentExceptions then the CallSetup destructor only stores an
|
||||
|
@ -1790,7 +1789,7 @@ ReparentWrapper(JSContext* aCx, JS::Handle<JSObject*> aObjArg)
|
|||
}
|
||||
|
||||
nsObjectLoadingContent* htmlobject;
|
||||
nsresult rv = UNWRAP_OBJECT(HTMLObjectElement, aCx, aObj, htmlobject);
|
||||
nsresult rv = UNWRAP_OBJECT(HTMLObjectElement, aObj, htmlobject);
|
||||
if (NS_FAILED(rv)) {
|
||||
rv = UnwrapObject<prototypes::id::HTMLEmbedElement,
|
||||
HTMLSharedObjectElement>(aObj, htmlobject);
|
||||
|
|
|
@ -193,7 +193,7 @@ IsDOMObject(JSObject* obj)
|
|||
return IsDOMClass(clasp) || IsDOMProxy(obj, clasp);
|
||||
}
|
||||
|
||||
#define UNWRAP_OBJECT(Interface, cx, obj, value) \
|
||||
#define UNWRAP_OBJECT(Interface, obj, value) \
|
||||
mozilla::dom::UnwrapObject<mozilla::dom::prototypes::id::Interface, \
|
||||
mozilla::dom::Interface##Binding::NativeType>(obj, value)
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ CallbackObject::CallSetup::ShouldRethrowException(JS::Handle<JS::Value> aExcepti
|
|||
}
|
||||
|
||||
DOMError* domError;
|
||||
return NS_SUCCEEDED(UNWRAP_OBJECT(DOMError, mCx, obj, domError));
|
||||
return NS_SUCCEEDED(UNWRAP_OBJECT(DOMError, obj, domError));
|
||||
}
|
||||
|
||||
CallbackObject::CallSetup::~CallSetup()
|
||||
|
|
|
@ -77,7 +77,7 @@ IDBKeyRange::FromJSVal(JSContext* aCx,
|
|||
else {
|
||||
MOZ_ASSERT(aVal.isObject());
|
||||
// An object is not permitted unless it's another IDBKeyRange.
|
||||
if (NS_FAILED(UNWRAP_OBJECT(IDBKeyRange, aCx, obj, keyRange))) {
|
||||
if (NS_FAILED(UNWRAP_OBJECT(IDBKeyRange, obj, keyRange))) {
|
||||
return NS_ERROR_DOM_INDEXEDDB_DATA_ERR;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1592,7 +1592,7 @@ IDBObjectStore::StructuredCloneWriteCallback(JSContext* aCx,
|
|||
FileManager* fileManager = transaction->Database()->Manager();
|
||||
|
||||
file::FileHandle* fileHandle = nullptr;
|
||||
if (NS_SUCCEEDED(UNWRAP_OBJECT(FileHandle, aCx, aObj, fileHandle))) {
|
||||
if (NS_SUCCEEDED(UNWRAP_OBJECT(FileHandle, aObj, fileHandle))) {
|
||||
nsRefPtr<FileInfo> fileInfo = fileHandle->GetFileInfo();
|
||||
|
||||
// Throw when trying to store non IDB file handles or IDB file handles
|
||||
|
|
|
@ -415,7 +415,7 @@ IndexedDBDatabaseParent::HandleRequestEvent(nsIDOMEvent* aEvent,
|
|||
MOZ_ASSERT(!JSVAL_IS_PRIMITIVE(result));
|
||||
|
||||
IDBDatabase *database;
|
||||
rv = UNWRAP_OBJECT(IDBDatabase, cx, &result.toObject(), database);
|
||||
rv = UNWRAP_OBJECT(IDBDatabase, &result.toObject(), database);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Didn't get the object we expected!");
|
||||
return rv;
|
||||
|
|
|
@ -233,7 +233,7 @@ Promise::JSCallback(JSContext *aCx, unsigned aArgc, JS::Value *aVp)
|
|||
MOZ_ASSERT(v.isObject());
|
||||
|
||||
Promise* promise;
|
||||
if (NS_FAILED(UNWRAP_OBJECT(Promise, aCx, &v.toObject(), promise))) {
|
||||
if (NS_FAILED(UNWRAP_OBJECT(Promise, &v.toObject(), promise))) {
|
||||
return Throw(aCx, NS_ERROR_UNEXPECTED);
|
||||
}
|
||||
|
||||
|
@ -501,7 +501,7 @@ Promise::ResolveInternal(JSContext* aCx,
|
|||
if (aValue.isObject()) {
|
||||
JS::Rooted<JSObject*> valueObj(aCx, &aValue.toObject());
|
||||
Promise* nextPromise;
|
||||
nsresult rv = UNWRAP_OBJECT(Promise, aCx, valueObj, nextPromise);
|
||||
nsresult rv = UNWRAP_OBJECT(Promise, valueObj, nextPromise);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsRefPtr<PromiseCallback> resolveCb = new ResolvePromiseCallback(this);
|
||||
|
|
|
@ -346,7 +346,7 @@ struct WorkerStructuredCloneCallbacks
|
|||
// See if this is an ImageData object.
|
||||
{
|
||||
ImageData* imageData = nullptr;
|
||||
if (NS_SUCCEEDED(UNWRAP_OBJECT(ImageData, aCx, aObj, imageData))) {
|
||||
if (NS_SUCCEEDED(UNWRAP_OBJECT(ImageData, aObj, imageData))) {
|
||||
// Prepare the ImageData internals.
|
||||
uint32_t width = imageData->Width();
|
||||
uint32_t height = imageData->Height();
|
||||
|
@ -5407,7 +5407,7 @@ GetWorkerCrossThreadDispatcher(JSContext* aCx, JS::Value aWorker)
|
|||
}
|
||||
|
||||
WorkerPrivate* w = nullptr;
|
||||
UNWRAP_OBJECT(Worker, aCx, &aWorker.toObject(), w);
|
||||
UNWRAP_OBJECT(Worker, &aWorker.toObject(), w);
|
||||
MOZ_ASSERT(w);
|
||||
return w->GetCrossThreadDispatcher();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "RuntimeService.h" // For WorkersDumpEnabled().
|
||||
|
||||
#define UNWRAP_WORKER_OBJECT(Interface, cx, obj, value) \
|
||||
#define UNWRAP_WORKER_OBJECT(Interface, obj, value) \
|
||||
UnwrapObject<prototypes::id::Interface##_workers, \
|
||||
mozilla::dom::Interface##Binding_workers::NativeType>(obj, value)
|
||||
|
||||
|
@ -259,7 +259,7 @@ DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(WorkerPrivate* aWorkerPri
|
|||
DedicatedWorkerGlobalScope::Visible(JSContext* aCx, JSObject* aObj)
|
||||
{
|
||||
DedicatedWorkerGlobalScope* self = nullptr;
|
||||
nsresult rv = UNWRAP_WORKER_OBJECT(DedicatedWorkerGlobalScope, aCx, aObj, self);
|
||||
nsresult rv = UNWRAP_WORKER_OBJECT(DedicatedWorkerGlobalScope, aObj, self);
|
||||
return NS_SUCCEEDED(rv) && self;
|
||||
}
|
||||
|
||||
|
@ -299,7 +299,7 @@ SharedWorkerGlobalScope::SharedWorkerGlobalScope(WorkerPrivate* aWorkerPrivate,
|
|||
SharedWorkerGlobalScope::Visible(JSContext* aCx, JSObject* aObj)
|
||||
{
|
||||
SharedWorkerGlobalScope* self = nullptr;
|
||||
nsresult rv = UNWRAP_WORKER_OBJECT(SharedWorkerGlobalScope, aCx, aObj, self);
|
||||
nsresult rv = UNWRAP_WORKER_OBJECT(SharedWorkerGlobalScope, aObj, self);
|
||||
return NS_SUCCEEDED(rv) && self;
|
||||
}
|
||||
|
||||
|
|
|
@ -1970,7 +1970,7 @@ nsXPCComponents_Exception::HasInstance(nsIXPConnectWrappedNative *wrapper,
|
|||
RootedValue v(cx, val);
|
||||
if (bp) {
|
||||
Exception* e;
|
||||
*bp = NS_SUCCEEDED(UNWRAP_OBJECT(Exception, cx, v.toObjectOrNull(), e)) ||
|
||||
*bp = NS_SUCCEEDED(UNWRAP_OBJECT(Exception, v.toObjectOrNull(), e)) ||
|
||||
JSValIsInterfaceOfType(cx, v, NS_GET_IID(nsIException));
|
||||
}
|
||||
return NS_OK;
|
||||
|
|
|
@ -592,7 +592,7 @@ WindowGlobalOrNull(JSObject *aObj)
|
|||
// at which point it will do the right thing.
|
||||
if (!IS_WN_CLASS(js::GetObjectClass(glob))) {
|
||||
nsGlobalWindow* win = nullptr;
|
||||
UNWRAP_OBJECT(Window, nullptr, glob, win);
|
||||
UNWRAP_OBJECT(Window, glob, win);
|
||||
return win;
|
||||
}
|
||||
|
||||
|
|
|
@ -261,7 +261,7 @@ nsXPCWrappedJSClass::CallQueryInterfaceOnJSObject(JSContext* cx,
|
|||
// C++ QI failure. See if that is the case.
|
||||
using namespace mozilla::dom;
|
||||
Exception *e = nullptr;
|
||||
UNWRAP_OBJECT(Exception, cx, &jsexception.toObject(), e);
|
||||
UNWRAP_OBJECT(Exception, &jsexception.toObject(), e);
|
||||
|
||||
if (e &&
|
||||
NS_SUCCEEDED(e->GetResult(&rv)) &&
|
||||
|
|
Загрузка…
Ссылка в новой задаче