Bug 931887 - No getter_AddRefs for loadInfo.mChannel because HttpChannelChild is not thread-safe, r=bz
authorAndrea Marchesini <amarchesini@mozilla.com>
Sun, 26 Jan 2014 00:16:46 +0000
changeset 182262 75f2402c0bbfa5b5c6616b371d1a72200cc5db05
parent 182233 a009a78c82ae61bf60c0320d4597294619383f7a
child 182263 1fd134a0174749342399942abe60e9fa53b70d48
push id462
push userraliiev@mozilla.com
push dateTue, 22 Apr 2014 00:22:30 +0000
treeherdermozilla-release@ac5db8c74ac0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs931887
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 931887 - No getter_AddRefs for loadInfo.mChannel because HttpChannelChild is not thread-safe, r=bz
dom/workers/WorkerPrivate.cpp
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -3754,18 +3754,21 @@ WorkerPrivate::GetLoadInfo(JSContext* aC
       parentStatus = aParent->mStatus;
     }
 
     if (parentStatus > Running) {
       NS_WARNING("Cannot create child workers from the close handler!");
       return NS_ERROR_FAILURE;
     }
 
+    // StartAssignment() is used instead getter_AddRefs because, getter_AddRefs
+    // does QI in debug build and, if this worker runs in a child process,
+    // HttpChannelChild will crash because it's not thread-safe.
     rv = ChannelFromScriptURLWorkerThread(aCx, aParent, aScriptURL,
-                                          getter_AddRefs(loadInfo.mChannel));
+                                          loadInfo.mChannel.StartAssignment());
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Now that we've spun the loop there's no guarantee that our parent is
     // still alive.  We may have received control messages initiating shutdown.
     {
       MutexAutoLock lock(aParent->mMutex);
       parentStatus = aParent->mStatus;
     }