From cd4dea4900c0d46edfc190a931358811c281956f Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Sun, 26 Jan 2014 00:16:46 +0000 Subject: [PATCH] Bug 931887 - No getter_AddRefs for loadInfo.mChannel because HttpChannelChild is not thread-safe, r=bz --- dom/workers/WorkerPrivate.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index c111eb899743..3aa3e6adc850 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -3759,8 +3759,11 @@ WorkerPrivate::GetLoadInfo(JSContext* aCx, nsPIDOMWindow* aWindow, 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