Bug 842186 - Replace a few instances of jsval with JS::Value in the WorkerPrivate class. r=jwalden

--HG--
extra : rebase_source : 5eda1a6052f05d6c4562e1a271cee68d224c8f45
This commit is contained in:
Jose Cortes 2013-02-20 10:23:40 -08:00
parent 33b2860b70
commit c8f0394d0c
2 changed files with 10 additions and 9 deletions

View File

@ -193,7 +193,7 @@ struct WorkerStructuredCloneCallbacks
// Read the information out of the stream.
uint32_t width, height;
jsval dataArray;
JS::Value dataArray;
if (!JS_ReadUint32Pair(aReader, &width, &height) ||
!JS_ReadTypedArray(aReader, &dataArray))
{
@ -203,7 +203,7 @@ struct WorkerStructuredCloneCallbacks
// Construct the ImageData.
JSObject* obj = imagedata::Create(aCx, width, height,
JSVAL_TO_OBJECT(dataArray));
&dataArray.toObject());
return obj;
}
@ -306,7 +306,7 @@ struct MainThreadWorkerStructuredCloneCallbacks
// nsIDOMFiles should be threadsafe, thus we will use the same instance
// on the main thread.
jsval wrappedFile;
JS::Value wrappedFile;
nsresult rv =
nsContentUtils::WrapNative(aCx, JS_GetGlobalForScopeChain(aCx), file,
&NS_GET_IID(nsIDOMFile), &wrappedFile);
@ -315,7 +315,7 @@ struct MainThreadWorkerStructuredCloneCallbacks
return nullptr;
}
return JSVAL_TO_OBJECT(wrappedFile);
return &wrappedFile.toObject();
}
}
// See if object is a nsIDOMBlob pointer.
@ -339,7 +339,7 @@ struct MainThreadWorkerStructuredCloneCallbacks
// nsIDOMBlobs should be threadsafe, thus we will use the same instance
// on the main thread.
jsval wrappedBlob;
JS::Value wrappedBlob;
nsresult rv =
nsContentUtils::WrapNative(aCx, JS_GetGlobalForScopeChain(aCx), blob,
&NS_GET_IID(nsIDOMBlob), &wrappedBlob);
@ -348,7 +348,7 @@ struct MainThreadWorkerStructuredCloneCallbacks
return nullptr;
}
return JSVAL_TO_OBJECT(wrappedBlob);
return &wrappedBlob.toObject();
}
}
@ -2156,8 +2156,9 @@ WorkerPrivateParent<Derived>::ForgetMainThreadObjects(
template <class Derived>
bool
WorkerPrivateParent<Derived>::PostMessage(JSContext* aCx, jsval aMessage,
jsval aTransferable)
WorkerPrivateParent<Derived>::PostMessage(JSContext* aCx,
JS::Value aMessage,
JS::Value aTransferable)
{
AssertIsOnParentThread();

View File

@ -349,7 +349,7 @@ public:
ForgetMainThreadObjects(nsTArray<nsCOMPtr<nsISupports> >& aDoomed);
bool
PostMessage(JSContext* aCx, jsval aMessage, jsval aTransferable);
PostMessage(JSContext* aCx, JS::Value aMessage, JS::Value aTransferable);
uint64_t
GetInnerWindowId();