Backed out changeset ca97cca1a50c (bug 1179397) for possible causing memory leaks on a CLOSED TREE
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 14 Oct 2015 14:58:40 +0200
changeset 298131 a168d4128c4d3a6f39493b5d4c7bceb4e445ee57
parent 298130 ca8c606cf73539c9ce062503b189e760790d725d
child 298132 72307b8a216a86384d9ef95f55b2988f2fd148da
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1179397
milestone43.0a2
backs outca97cca1a50ceaaebcf0773b5a1cdc1236125296
Backed out changeset ca97cca1a50c (bug 1179397) for possible causing memory leaks on a CLOSED TREE
dom/workers/ServiceWorkerEvents.cpp
testing/web-platform/mozilla/meta/service-workers/service-worker/fetch-event-async-respond-with.https.html.ini
testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-event-async-respond-with.https.html
--- a/dom/workers/ServiceWorkerEvents.cpp
+++ b/dom/workers/ServiceWorkerEvents.cpp
@@ -398,17 +398,17 @@ RespondWithHandler::CancelRequest(nsresu
   NS_DispatchToMainThread(runnable);
 }
 
 } // namespace
 
 void
 FetchEvent::RespondWith(Promise& aArg, ErrorResult& aRv)
 {
-  if (EventPhase() == nsIDOMEvent::NONE || mWaitToRespond) {
+  if (mWaitToRespond) {
     aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
     return;
   }
 
   nsRefPtr<InternalRequest> ir = mRequest->GetInternalRequest();
   StopImmediatePropagation();
   mWaitToRespond = true;
   nsRefPtr<RespondWithHandler> handler =
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/mozilla/meta/service-workers/service-worker/fetch-event-async-respond-with.https.html.ini
@@ -0,0 +1,5 @@
+[fetch-event-async-respond-with.https.html]
+  type: testharness
+  [Calling respondWith asynchronously throws an exception]
+    expected: FAIL
+
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-event-async-respond-with.https.html
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-event-async-respond-with.https.html
@@ -17,18 +17,18 @@ promise_test(function(t) {
         })
       .then(function(frame) {
           var channel = new MessageChannel();
           var saw_message = new Promise(function(resolve) {
               channel.port1.onmessage = function(e) { resolve(e.data); }
             });
           var worker = frame.contentWindow.navigator.serviceWorker.controller;
 
+          frame.remove();
           worker.postMessage({port: channel.port2}, [channel.port2]);
-          frame.remove();
           return saw_message;
         })
       .then(function(message) {
           assert_equals(message, 'PASS');
           return service_worker_unregister_and_done(t, scope);
         })
   }, 'Calling respondWith asynchronously throws an exception');
 </script>