Bug 978892 - [e10s] Avoid racing when creating PJavaScript object (r=mrbkap)

This commit is contained in:
Bill McCloskey 2014-05-08 15:43:53 -07:00
parent cfdece92b0
commit a57b24343c
3 changed files with 6 additions and 4 deletions

View File

@ -751,6 +751,8 @@ static void FirstIdle(void)
mozilla::jsipc::PJavaScriptChild *
ContentChild::AllocPJavaScriptChild()
{
MOZ_ASSERT(!ManagedPJavaScriptChild().Length());
nsCOMPtr<nsIJSRuntimeService> svc = do_GetService("@mozilla.org/js/xpc/RuntimeService;1");
NS_ENSURE_TRUE(svc, nullptr);

View File

@ -1357,8 +1357,7 @@ ContentParent::GetCPOWManager()
if (ManagedPJavaScriptParent().Length()) {
return static_cast<JavaScriptParent*>(ManagedPJavaScriptParent()[0]);
}
JavaScriptParent* actor = static_cast<JavaScriptParent*>(SendPJavaScriptConstructor());
return actor;
return nullptr;
}
TestShellParent*
@ -2233,6 +2232,7 @@ ContentParent::RecvGetXPCOMProcessAttributes(bool* aIsOffline)
mozilla::jsipc::PJavaScriptParent *
ContentParent::AllocPJavaScriptParent()
{
MOZ_ASSERT(!ManagedPJavaScriptParent().Length());
mozilla::jsipc::JavaScriptParent *parent = new mozilla::jsipc::JavaScriptParent();
if (!parent->init()) {
delete parent;

View File

@ -317,8 +317,6 @@ both:
async PBlob(BlobConstructorParams params);
async PJavaScript();
PFileDescriptorSet(FileDescriptor fd);
child:
@ -425,6 +423,8 @@ parent:
sync GetXPCOMProcessAttributes()
returns (bool isOffline);
async PJavaScript();
PDeviceStorageRequest(DeviceStorageParams params);
PFileSystemRequest(FileSystemParams params);