Backed out changeset 355e895f7ae9 (bug 1014466)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 06 Jun 2014 10:21:00 +0200
changeset 206288 701627f5212db2c2fd8b4dda6fae088f2f02931c
parent 206287 cd9ee55b7d24a7bbcedf55f775ab3266c9c1fa6a
child 206289 0c006b5d36c852c91e5b7c562405f17c5f61252e
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1014466
milestone32.0a1
backs out355e895f7ae9cf81a85514a25404a04ae3303be9
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
Backed out changeset 355e895f7ae9 (bug 1014466)
dom/workers/XMLHttpRequest.cpp
dom/workers/XMLHttpRequest.h
--- a/dom/workers/XMLHttpRequest.cpp
+++ b/dom/workers/XMLHttpRequest.cpp
@@ -275,19 +275,17 @@ public:
 
 private:
   ~XHRUnpinRunnable()
   { }
 
   bool
   WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
   {
-    if (mXMLHttpRequestPrivate->SendInProgress()) {
-      mXMLHttpRequestPrivate->Unpin();
-    }
+    mXMLHttpRequestPrivate->Unpin();
 
     return true;
   }
 };
 
 class AsyncTeardownRunnable MOZ_FINAL : public nsRunnable
 {
   nsRefPtr<Proxy> mProxy;
@@ -351,19 +349,17 @@ class LoadStartDetectionRunnable MOZ_FIN
         // Threads raced, this event is now obsolete.
         return true;
       }
 
       if (mSyncLoopTarget) {
         aWorkerPrivate->StopSyncLoop(mSyncLoopTarget, true);
       }
 
-      if (mXMLHttpRequestPrivate->SendInProgress()) {
-        mXMLHttpRequestPrivate->Unpin();
-      }
+      mXMLHttpRequestPrivate->Unpin();
 
       return true;
     }
 
     NS_IMETHOD
     Cancel() MOZ_OVERRIDE
     {
       // This must run!
@@ -1746,20 +1742,16 @@ XMLHttpRequest::MaybeDispatchPrematureAb
     DispatchPrematureAbortEvent(this, NS_LITERAL_STRING("loadend"), false,
                                 aRv);
     if (aRv.Failed()) {
       return;
     }
 
     mProxy->mSeenLoadStart = false;
   }
-
-  if (mRooted) {
-    Unpin();
-  }
 }
 
 void
 XMLHttpRequest::DispatchPrematureAbortEvent(EventTarget* aTarget,
                                             const nsAString& aEventType,
                                             bool aUploadTarget,
                                             ErrorResult& aRv)
 {
--- a/dom/workers/XMLHttpRequest.h
+++ b/dom/workers/XMLHttpRequest.h
@@ -259,22 +259,16 @@ public:
     return mMozAnon;
   }
 
   bool MozSystem() const
   {
     return mMozSystem;
   }
 
-  bool
-  SendInProgress() const
-  {
-    return mRooted;
-  }
-
 private:
   XMLHttpRequest(WorkerPrivate* aWorkerPrivate);
   ~XMLHttpRequest();
 
   enum ReleaseType { Default, XHRIsGoingAway, WorkerIsGoingAway };
 
   void
   ReleaseProxy(ReleaseType aType = Default);
@@ -285,16 +279,22 @@ private:
   void
   MaybeDispatchPrematureAbortEvents(ErrorResult& aRv);
 
   void
   DispatchPrematureAbortEvent(EventTarget* aTarget,
                               const nsAString& aEventType, bool aUploadTarget,
                               ErrorResult& aRv);
 
+  bool
+  SendInProgress() const
+  {
+    return mRooted;
+  }
+
   void
   SendInternal(const nsAString& aStringBody,
                JSAutoStructuredCloneBuffer&& aBody,
                nsTArray<nsCOMPtr<nsISupports> >& aClonedObjects,
                ErrorResult& aRv);
 };
 
 END_WORKERS_NAMESPACE