Bug 1264815 - Rename 'serviceWorkerRegistrationID' to 'serviceWorkerRegistrationScope'. r=kcambridge
☠☠ backed out by f7aead3c999a ☠ ☠
authorSUN Haitao <sunhaitao@devtaste.com>
Thu, 26 May 2016 22:19:09 +0800
changeset 340544 9bcbe80a4a7aacc9447d2bd60ecb6383242f584c
parent 340543 8f6cc2d22ba7c308e789c84404a4086084cd49f3
child 340545 20d0b05e708bdf6f76450f147d706def62b0e158
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskcambridge
bugs1264815
milestone49.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 1264815 - Rename 'serviceWorkerRegistrationID' to 'serviceWorkerRegistrationScope'. r=kcambridge
dom/interfaces/notification/nsINotificationStorage.idl
dom/notification/Notification.cpp
dom/notification/Notification.h
dom/notification/NotificationStorage.js
--- a/dom/interfaces/notification/nsINotificationStorage.idl
+++ b/dom/interfaces/notification/nsINotificationStorage.idl
@@ -23,17 +23,17 @@ interface nsINotificationStorageCallback
               in DOMString title,
               in DOMString dir,
               in DOMString lang,
               in DOMString body,
               in DOMString tag,
               in DOMString icon,
               in DOMString data,
               in DOMString behavior,
-              in DOMString serviceWorkerRegistrationID);
+              in DOMString serviceWorkerRegistrationScope);
 
   /**
    * Callback function used to notify C++ the we have returned
    * all notification objects for this Notification.get call.
    */
   void done();
 };
 
@@ -71,17 +71,17 @@ interface nsINotificationStorage : nsISu
            in DOMString dir,
            in DOMString lang,
            in DOMString body,
            in DOMString tag,
            in DOMString icon,
            in DOMString alertName,
            in DOMString data,
            in DOMString behavior,
-           in DOMString serviceWorkerRegistrationID);
+           in DOMString serviceWorkerRegistrationScope);
 
   /**
    * Retrieve a list of notifications.
    *
    * @param origin: the origin/app for which to fetch notifications from
    * @param tag: used to fetch only a specific tag
    * @param callback: nsINotificationStorageCallback, used for
    *                  returning notifications objects
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -73,17 +73,17 @@ struct NotificationStrings
   const nsString mTitle;
   const nsString mDir;
   const nsString mLang;
   const nsString mBody;
   const nsString mTag;
   const nsString mIcon;
   const nsString mData;
   const nsString mBehavior;
-  const nsString mServiceWorkerRegistrationID;
+  const nsString mServiceWorkerRegistrationScope;
 };
 
 class ScopeCheckingGetCallback : public nsINotificationStorageCallback
 {
   const nsString mScope;
 public:
   explicit ScopeCheckingGetCallback(const nsAString& aScope)
     : mScope(aScope)
@@ -93,37 +93,37 @@ public:
                     const nsAString& aTitle,
                     const nsAString& aDir,
                     const nsAString& aLang,
                     const nsAString& aBody,
                     const nsAString& aTag,
                     const nsAString& aIcon,
                     const nsAString& aData,
                     const nsAString& aBehavior,
-                    const nsAString& aServiceWorkerRegistrationID) final
+                    const nsAString& aServiceWorkerRegistrationScope) final
   {
     AssertIsOnMainThread();
     MOZ_ASSERT(!aID.IsEmpty());
 
     // Skip scopes that don't match when called from getNotifications().
-    if (!mScope.IsEmpty() && !mScope.Equals(aServiceWorkerRegistrationID)) {
+    if (!mScope.IsEmpty() && !mScope.Equals(aServiceWorkerRegistrationScope)) {
       return NS_OK;
     }
 
     NotificationStrings strings = {
       nsString(aID),
       nsString(aTitle),
       nsString(aDir),
       nsString(aLang),
       nsString(aBody),
       nsString(aTag),
       nsString(aIcon),
       nsString(aData),
       nsString(aBehavior),
-      nsString(aServiceWorkerRegistrationID),
+      nsString(aServiceWorkerRegistrationScope),
     };
 
     mStrings.AppendElement(Move(strings));
     return NS_OK;
   }
 
   NS_IMETHOD Done() override = 0;
 
@@ -164,17 +164,17 @@ public:
                                           mStrings[i].mDir,
                                           mStrings[i].mLang,
                                           mStrings[i].mBody,
                                           mStrings[i].mTag,
                                           mStrings[i].mIcon,
                                           mStrings[i].mData,
                                           /* mStrings[i].mBehavior, not
                                            * supported */
-                                          mStrings[i].mServiceWorkerRegistrationID,
+                                          mStrings[i].mServiceWorkerRegistrationScope,
                                           result);
 
       n->SetStoredState(true);
       Unused << NS_WARN_IF(result.Failed());
       if (!result.Failed()) {
         notifications.AppendElement(n.forget());
       }
     }
@@ -1078,17 +1078,17 @@ Notification::ConstructFromFields(
     const nsAString& aID,
     const nsAString& aTitle,
     const nsAString& aDir,
     const nsAString& aLang,
     const nsAString& aBody,
     const nsAString& aTag,
     const nsAString& aIcon,
     const nsAString& aData,
-    const nsAString& aServiceWorkerRegistrationID,
+    const nsAString& aServiceWorkerRegistrationScope,
     ErrorResult& aRv)
 {
   MOZ_ASSERT(aGlobal);
 
   RootedDictionary<NotificationOptions> options(nsContentUtils::RootingCxForThread());
   options.mDir = Notification::StringToDirection(nsString(aDir));
   options.mLang = aLang;
   options.mBody = aBody;
@@ -1097,17 +1097,17 @@ Notification::ConstructFromFields(
   RefPtr<Notification> notification = CreateInternal(aGlobal, aID, aTitle,
                                                      options);
 
   notification->InitFromBase64(aData, aRv);
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
 
-  notification->SetScope(aServiceWorkerRegistrationID);
+  notification->SetScope(aServiceWorkerRegistrationScope);
 
   return notification.forget();
 }
 
 nsresult
 Notification::PersistNotification()
 {
   AssertIsOnMainThread();
@@ -2108,17 +2108,17 @@ public:
                                           mStrings[i].mDir,
                                           mStrings[i].mLang,
                                           mStrings[i].mBody,
                                           mStrings[i].mTag,
                                           mStrings[i].mIcon,
                                           mStrings[i].mData,
                                           /* mStrings[i].mBehavior, not
                                            * supported */
-                                          mStrings[i].mServiceWorkerRegistrationID,
+                                          mStrings[i].mServiceWorkerRegistrationScope,
                                           result);
 
       n->SetStoredState(true);
       Unused << NS_WARN_IF(result.Failed());
       if (!result.Failed()) {
         notifications.AppendElement(n.forget());
       }
     }
--- a/dom/notification/Notification.h
+++ b/dom/notification/Notification.h
@@ -180,17 +180,17 @@ public:
     const nsAString& aID,
     const nsAString& aTitle,
     const nsAString& aDir,
     const nsAString& aLang,
     const nsAString& aBody,
     const nsAString& aTag,
     const nsAString& aIcon,
     const nsAString& aData,
-    const nsAString& aServiceWorkerRegistrationID,
+    const nsAString& aServiceWorkerRegistrationScope,
     ErrorResult& aRv);
 
   void GetID(nsAString& aRetval) {
     aRetval = mID;
   }
 
   void GetTitle(nsAString& aRetval)
   {
--- a/dom/notification/NotificationStorage.js
+++ b/dom/notification/NotificationStorage.js
@@ -79,32 +79,32 @@ NotificationStorage.prototype = {
   canPut: function(aOrigin) {
     if (DEBUG) debug("Querying appService for: " + aOrigin);
     let rv = !!appsService.getAppByManifestURL(aOrigin);
     if (DEBUG) debug("appService returned: " + rv);
     return rv;
   },
 
   put: function(origin, id, title, dir, lang, body, tag, icon, alertName,
-                data, behavior, serviceWorkerRegistrationID) {
+                data, behavior, serviceWorkerRegistrationScope) {
     if (DEBUG) { debug("PUT: " + origin + " " + id + ": " + title); }
     var notification = {
       id: id,
       title: title,
       dir: dir,
       lang: lang,
       body: body,
       tag: tag,
       icon: icon,
       alertName: alertName,
       timestamp: new Date().getTime(),
       origin: origin,
       data: data,
       mozbehavior: behavior,
-      serviceWorkerRegistrationID: serviceWorkerRegistrationID,
+      serviceWorkerRegistrationScope: serviceWorkerRegistrationScope,
     };
 
     this._notifications[id] = notification;
     if (tag) {
       if (!this._byTag[origin]) {
         this._byTag[origin] = {};
       }
 
@@ -136,19 +136,19 @@ NotificationStorage.prototype = {
   },
 
   getByID: function(origin, id, callback) {
     if (DEBUG) { debug("GETBYID: " + origin + " " + id); }
     var GetByIDProxyCallback = function(id, originalCallback) {
       this.searchID = id;
       this.originalCallback = originalCallback;
       var self = this;
-      this.handle = function(id, title, dir, lang, body, tag, icon, data, behavior, serviceWorkerRegistrationID) {
+      this.handle = function(id, title, dir, lang, body, tag, icon, data, behavior, serviceWorkerRegistrationScope) {
         if (id == this.searchID) {
-          self.originalCallback.handle(id, title, dir, lang, body, tag, icon, data, behavior, serviceWorkerRegistrationID);
+          self.originalCallback.handle(id, title, dir, lang, body, tag, icon, data, behavior, serviceWorkerRegistrationScope);
         }
       };
       this.done = function() {
         self.originalCallback.done();
       };
     };
 
     return this.get(origin, "", new GetByIDProxyCallback(id, callback));
@@ -241,17 +241,17 @@ NotificationStorage.prototype = {
                                notification.title,
                                notification.dir,
                                notification.lang,
                                notification.body,
                                notification.tag,
                                notification.icon,
                                notification.data,
                                notification.mozbehavior,
-                               notification.serviceWorkerRegistrationID),
+                               notification.serviceWorkerRegistrationScope),
           Ci.nsIThread.DISPATCH_NORMAL);
       } catch (e) {
         if (DEBUG) { debug("Error calling callback handle: " + e); }
       }
     });
     try {
       Services.tm.currentThread.dispatch(callback.done,
                                          Ci.nsIThread.DISPATCH_NORMAL);