Bug 1155153 - [e10s] about:serviceworkers should work in e10s mode. Update B2G implementation. r=baku
authorFernando Jimenez <ferjmoreno@gmail.com>
Wed, 10 Jun 2015 16:27:17 +0200
changeset 248060 2cb48faca184ca1435f536916aa9b6c8ee5d5a5b
parent 248059 fc4444e384ba699a67da8c1b1c286b7fdba3d919
child 248061 e60dcbb629e35fc60e369e6663f6a8ef5d11e49d
push id28888
push userkwierso@gmail.com
push dateThu, 11 Jun 2015 01:29:45 +0000
treeherdermozilla-central@04c057942da4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1155153
milestone41.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 1155153 - [e10s] about:serviceworkers should work in e10s mode. Update B2G implementation. r=baku
b2g/components/AboutServiceWorkers.jsm
b2g/components/test/unit/test_aboutserviceworkers.js
--- a/b2g/components/AboutServiceWorkers.jsm
+++ b/b2g/components/AboutServiceWorkers.jsm
@@ -125,17 +125,26 @@ this.AboutServiceWorkers = {
         });
         break;
 
       case "update":
         if (!message.scope) {
           self.sendError(message.id, "MissingScope");
           return;
         }
-        gServiceWorkerManager.softUpdate(message.scope);
+
+        if (!message.principal ||
+            !message.principal.originAttributes) {
+          // XXX This will always error until bug 1171915 is fixed.
+          self.sendError(message.id, "MissingOriginAttributes");
+          return;
+        }
+
+        gServiceWorkerManager.propagateSoftUpdate({},
+                                                  message.scope);
         self.sendResult(message.id, true);
         break;
 
       case "unregister":
         if (!message.principal ||
             !message.principal.origin ||
             !message.principal.appId) {
           self.sendError("MissingPrincipal");
@@ -161,17 +170,17 @@ this.AboutServiceWorkers = {
           unregisterFailed: function() {
             self.sendError(message.id, "UnregisterError");
           },
 
           QueryInterface: XPCOMUtils.generateQI([
             Ci.nsIServiceWorkerUnregisterCallback
           ])
         };
-        gServiceWorkerManager.unregister(principal,
-                                         serviceWorkerUnregisterCallback,
-                                         message.scope);
+        gServiceWorkerManager.propagateUnregister(principal,
+                                                  serviceWorkerUnregisterCallback,
+                                                  message.scope);
         break;
     }
   }
 };
 
 AboutServiceWorkers.init();
--- a/b2g/components/test/unit/test_aboutserviceworkers.js
+++ b/b2g/components/test/unit/test_aboutserviceworkers.js
@@ -123,17 +123,20 @@ function run_test() {
 // registrations are not allowed.
 // All we can do for now is to test the interface of the swm.
 add_test(function test_swm() {
   do_check_true(gServiceWorkerManager, "SWM exists");
   do_check_true(gServiceWorkerManager.getAllRegistrations,
                 "SWM.getAllRegistrations exists");
   do_check_true(typeof gServiceWorkerManager.getAllRegistrations == "function",
                 "SWM.getAllRegistrations is a function");
-  do_check_true(gServiceWorkerManager.softUpdate, "SWM.softUpdate exists");
-  do_check_true(typeof gServiceWorkerManager.softUpdate == "function",
-                "SWM.softUpdate is a function");
-  do_check_true(gServiceWorkerManager.unregister, "SWM.unregister exists");
-  do_check_true(typeof gServiceWorkerManager.unregister == "function",
-                "SWM.unregister exists");
+  do_check_true(gServiceWorkerManager.propagateSoftUpdate,
+                "SWM.propagateSoftUpdate exists");
+  do_check_true(typeof gServiceWorkerManager.propagateSoftUpdate == "function",
+
+                "SWM.propagateSoftUpdate is a function");
+  do_check_true(gServiceWorkerManager.propagateUnregister,
+                "SWM.propagateUnregister exists");
+  do_check_true(typeof gServiceWorkerManager.propagateUnregister == "function",
+                "SWM.propagateUnregister exists");
 
   run_next_test();
 });