Attachment #633471: Part 7.1 - Scope the push of the safe js context such that it doesn't include the call to XHR::Send. v1 for bug #754202

View | Details | Raw Unified | Return to bug 754202
Collapse All | Expand All

(-)a/dom/workers/XMLHttpRequest.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 1141-1159   public: Link Here 
1141
    mBody.swap(aBody);
1141
    mBody.swap(aBody);
1142
    mClonedObjects.SwapElements(aClonedObjects);
1142
    mClonedObjects.SwapElements(aClonedObjects);
1143
  }
1143
  }
1144
1144
1145
  nsresult
1145
  nsresult
1146
  MainThreadRun()
1146
  MainThreadRun()
1147
  {
1147
  {
1148
    nsCOMPtr<nsIVariant> variant;
1148
    nsCOMPtr<nsIVariant> variant;
1149
    RuntimeService::AutoSafeJSContext cx;
1150
1149
1151
    if (mBody.data()) {
1150
    if (mBody.data()) {
1151
      RuntimeService::AutoSafeJSContext cx;
1152
      nsIXPConnect* xpc = nsContentUtils::XPConnect();
1152
      nsIXPConnect* xpc = nsContentUtils::XPConnect();
1153
      NS_ASSERTION(xpc, "This should never be null!");
1153
      NS_ASSERTION(xpc, "This should never be null!");
1154
1154
1155
      nsresult rv = NS_OK;
1155
      nsresult rv = NS_OK;
1156
1156
1157
      JSStructuredCloneCallbacks* callbacks =
1157
      JSStructuredCloneCallbacks* callbacks =
1158
        mWorkerPrivate->IsChromeWorker() ?
1158
        mWorkerPrivate->IsChromeWorker() ?
1159
        ChromeWorkerStructuredCloneCallbacks(true) :
1159
        ChromeWorkerStructuredCloneCallbacks(true) :

Return to bug 754202