Backed out changeset cb1fdb7df155 (bug 915002) again for build bustage
authorWes Kocher <wkocher@mozilla.com>
Thu, 10 Oct 2013 15:27:12 -0700
changeset 164245 6e3304781e1236044a6a316256bb5742da5adeff
parent 164244 cb1fdb7df155858ff5a379132064c8b0cfb48a84
child 164246 ab4f693e4b40520c37d4e9d4ae1524cc86b8dcba
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs915002
milestone27.0a1
backs outcb1fdb7df155858ff5a379132064c8b0cfb48a84
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 cb1fdb7df155 (bug 915002) again for build bustage
CLOBBER
b2g/chrome/content/shell.js
b2g/components/AlertsService.js
dom/interfaces/notification/nsIDOMDesktopNotification.idl
dom/src/notification/DesktopNotification.cpp
dom/src/notification/Notification.cpp
dom/tests/mochitest/notification/notification_common.js
dom/webidl/AppNotificationServiceOptions.webidl
dom/webidl/DummyBinding.webidl
dom/webidl/moz.build
--- a/CLOBBER
+++ b/CLOBBER
@@ -13,9 +13,9 @@
 #          |               |
 #          O <-- Clobber   O  <-- Clobber
 #
 # Note: The description below will be part of the error message shown to users.
 #
 # Modifying this file will now automatically clobber the buildbot machines \o/
 #
 
-Bug 915002 - Clobber needed for webidl updates for AppNotificationServiceOptions
+Bug 899574 needed a clobber, at least on Windows.
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -882,30 +882,28 @@ var AlertsHelper = {
   receiveMessage: function alert_receiveMessage(aMessage) {
     if (!aMessage.target.assertAppHasPermission("desktop-notification")) {
       Cu.reportError("Desktop-notification message " + aMessage.name +
                      " from a content process with no desktop-notification privileges.");
       return;
     }
 
     let data = aMessage.data;
-    let details = data.details;
     let listener = {
       mm: aMessage.target,
       title: data.title,
       text: data.text,
-      manifestURL: details.manifestURL,
+      manifestURL: data.manifestURL,
       imageURL: data.imageURL
-    };
+    }
     this.registerAppListener(data.uid, listener);
 
     this.showNotification(data.imageURL, data.title, data.text,
-                          details.textClickable, null,
-                          data.uid, details.dir,
-                          details.lang, details.manifestURL);
+                          data.textClickable, null,
+                          data.uid, null, null, data.manifestURL);
   },
 }
 
 var WebappsHelper = {
   _installers: {},
   _count: 0,
 
   init: function webapps_init() {
--- a/b2g/components/AlertsService.js
+++ b/b2g/components/AlertsService.js
@@ -60,35 +60,37 @@ AlertsService.prototype = {
     let browser = Services.wm.getMostRecentWindow("navigator:browser");
     browser.AlertsHelper.closeAlert(aName);
   },
 
   // nsIAppNotificationService
   showAppNotification: function showAppNotification(aImageURL,
                                                     aTitle,
                                                     aText,
+                                                    aTextClickable,
+                                                    aManifestURL,
                                                     aAlertListener,
-                                                    aDetails) {
-    let uid = (aDetails.id == "") ?
-          "app-notif-" + uuidGenerator.generateUUID() : aDetails.id;
+                                                    aId) {
+    let uid = (aId == "") ? "app-notif-" + uuidGenerator.generateUUID() : aId;
 
     this._listeners[uid] = {
       observer: aAlertListener,
       title: aTitle,
       text: aText,
-      manifestURL: aDetails.manifestURL,
+      manifestURL: aManifestURL,
       imageURL: aImageURL
     };
 
     cpmm.sendAsyncMessage("app-notification-send", {
       imageURL: aImageURL,
       title: aTitle,
       text: aText,
-      uid: uid,
-      details: aDetails
+      textClickable: aTextClickable,
+      manifestURL: aManifestURL,
+      uid: uid
     });
   },
 
   // AlertsService.js custom implementation
   _listeners: [],
 
   receiveMessage: function receiveMessage(aMessage) {
     let data = aMessage.data;
--- a/dom/interfaces/notification/nsIDOMDesktopNotification.idl
+++ b/dom/interfaces/notification/nsIDOMDesktopNotification.idl
@@ -2,19 +2,19 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "domstubs.idl"
 
 interface nsIObserver;
 
 // Notification service that also provides the manifest URL
-[scriptable, uuid(50cb17d2-dc8a-4aa6-bcd3-94d76af14e20)]
+[scriptable, uuid(61c4adf4-187d-4d18-937c-4df17bc01073)]
 interface nsIAppNotificationService : nsISupports
 {
     void showAppNotification(in AString  imageUrl,
                              in AString  title,
                              in AString  text,
-                             in nsIObserver alertListener,
-                             // details should be a WebIDL
-                             // AppNotificationServiceOptions Dictionary object
-                             in jsval    details);
+                             [optional] in boolean textClickable,
+                             [optional] in AString manifestURL,
+                             [optional] in nsIObserver alertListener,
+                             [optional] in AString id);
 };
--- a/dom/src/notification/DesktopNotification.cpp
+++ b/dom/src/notification/DesktopNotification.cpp
@@ -1,14 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "mozilla/dom/DesktopNotification.h"
 #include "mozilla/dom/DesktopNotificationBinding.h"
-#include "mozilla/dom/AppNotificationServiceOptionsBinding.h"
 #include "nsContentPermissionHelper.h"
 #include "nsXULAppAPI.h"
 #include "mozilla/dom/PBrowserChild.h"
 #include "nsIDOMDesktopNotification.h"
 #include "TabChild.h"
 #include "mozilla/Preferences.h"
 #include "nsGlobalWindow.h"
 #include "nsIAppsService.h"
@@ -87,28 +86,21 @@ DesktopNotification::PostDesktopNotifica
   if (appNotifier) {
     nsCOMPtr<nsPIDOMWindow> window = GetOwner();
     uint32_t appId = (window.get())->GetDoc()->NodePrincipal()->GetAppId();
 
     if (appId != nsIScriptSecurityManager::UNKNOWN_APP_ID) {
       nsCOMPtr<nsIAppsService> appsService = do_GetService("@mozilla.org/AppsService;1");
       nsString manifestUrl = EmptyString();
       appsService->GetManifestURLByLocalId(appId, manifestUrl);
-      mozilla::AutoSafeJSContext cx;
-      JS::RootedValue val(cx);
-      AppNotificationServiceOptionsInitializer ops;
-      ops.mTextClickable = true;
-      ops.mManifestURL = manifestUrl;
-
-      if (!ops.ToObject(cx, JS::NullPtr(), &val)) {
-        return NS_ERROR_FAILURE;
-      }
-
       return appNotifier->ShowAppNotification(mIconURL, mTitle, mDescription,
-                                              mObserver, val);
+                                              true,
+                                              manifestUrl,
+                                              mObserver,
+                                              EmptyString());
     }
   }
 #endif
 
   nsCOMPtr<nsIAlertsService> alerts = do_GetService("@mozilla.org/alerts-service;1");
   if (!alerts) {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
--- a/dom/src/notification/Notification.cpp
+++ b/dom/src/notification/Notification.cpp
@@ -1,15 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "PCOMContentPermissionRequestChild.h"
 #include "mozilla/dom/Notification.h"
-#include "mozilla/dom/AppNotificationServiceOptionsBinding.h"
 #include "mozilla/dom/OwningNonNull.h"
 #include "mozilla/Preferences.h"
 #include "TabChild.h"
 #include "nsContentUtils.h"
 #include "nsDOMEvent.h"
 #include "nsIAlertsService.h"
 #include "nsIContentPermissionPrompt.h"
 #include "nsIDocument.h"
@@ -371,32 +370,21 @@ Notification::ShowInternal()
   if (appNotifier) {
     nsCOMPtr<nsPIDOMWindow> window = GetOwner();
     uint32_t appId = (window.get())->GetDoc()->NodePrincipal()->GetAppId();
 
     if (appId != nsIScriptSecurityManager::UNKNOWN_APP_ID) {
       nsCOMPtr<nsIAppsService> appsService = do_GetService("@mozilla.org/AppsService;1");
       nsString manifestUrl = EmptyString();
       appsService->GetManifestURLByLocalId(appId, manifestUrl);
-      mozilla::AutoSafeJSContext cx;
-      JS::RootedValue val(cx);
-      AppNotificationServiceOptionsInitializer ops;
-      ops.mTextClickable = true;
-      ops.mManifestURL = manifestUrl;
-      ops.mId = alertName;
-      ops.mDir = DirectionToString(mDir);
-      ops.mLang = mLang;
-
-      if (!ops.ToObject(cx, JS::NullPtr(), &val)) {
-        NS_WARNING("Converting dict to object failed!");
-        return NS_ERROR_FAILURE;
-      }
-
       return appNotifier->ShowAppNotification(mIconUrl, mTitle, mBody,
-                                              observer, val);
+                                              true,
+                                              manifestUrl,
+                                              observer,
+                                              alertName);
     }
   }
 #endif
 
   // In the case of IPC, the parent process uses the cookie to map to
   // nsIObserver. Thus the cookie must be unique to differentiate observers.
   nsString uniqueCookie = NS_LITERAL_STRING("notification:");
   uniqueCookie.AppendInt(sCount++);
--- a/dom/tests/mochitest/notification/notification_common.js
+++ b/dom/tests/mochitest/notification/notification_common.js
@@ -4,30 +4,30 @@ const ALERTS_SERVICE_CONTRACT_ID = "@moz
 const MOCK_SYSTEM_ALERTS_CID = SpecialPowers.wrap(SpecialPowers.Components).ID("{e86d888c-e41b-4b78-9104-2f2742a532de}");
 const SYSTEM_ALERTS_SERVICE_CONTRACT_ID = "@mozilla.org/system-alerts-service;1";
 
 var registrar = SpecialPowers.wrap(SpecialPowers.Components).manager.
   QueryInterface(SpecialPowers.Ci.nsIComponentRegistrar);
 
 var mockAlertsService = {
   showAlertNotification: function(imageUrl, title, text, textClickable,
-                                  cookie, alertListener, name, bidi, lang) {
+                                  cookie, alertListener, name) {
     // probably should do this async....
     SpecialPowers.wrap(alertListener).observe(null, "alertshow", cookie);
 
     if (SpecialPowers.getBoolPref("notification.prompt.testing.click_on_notification") == true) {
        SpecialPowers.wrap(alertListener).observe(null, "alertclickcallback", cookie);
     }
 
     SpecialPowers.wrap(alertListener).observe(null, "alertfinished", cookie);
   },
 
-  showAppNotification: function(imageUrl, title, text, alertListener, details) {
-    this.showAlertNotification(imageUrl, title, text, details.textClickable, "",
-                               alertListener, details.name, details.dir, details.lang);
+  showAppNotification: function(imageUrl, title, text, textClickable,
+                                manifestURL, alertListener) {
+    this.showAlertNotification(imageUrl, title, text, textClickable, "", alertListener, "");
   },
 
   QueryInterface: function(aIID) {
     if (SpecialPowers.wrap(aIID).equals(SpecialPowers.Ci.nsISupports) ||
         SpecialPowers.wrap(aIID).equals(SpecialPowers.Ci.nsIAlertsService) ||
         SpecialPowers.wrap(aIID).equals(SpecialPowers.Ci.nsIAppNotificationService)) {
       return this;
     }
deleted file mode 100644
--- a/dom/webidl/AppNotificationServiceOptions.webidl
+++ /dev/null
@@ -1,15 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-interface MozObserver;
-
-dictionary AppNotificationServiceOptions {
-  boolean textClickable = false;
-  DOMString manifestURL = "";
-  DOMString id = "";
-  DOMString dir = "";
-  DOMString lang = "";
-};
--- a/dom/webidl/DummyBinding.webidl
+++ b/dom/webidl/DummyBinding.webidl
@@ -22,14 +22,13 @@ interface DummyInterface : EventTarget {
   void frameRequestCallback(FrameRequestCallback arg);
   void MmsParameters(optional MmsParameters arg);
   void MmsAttachment(optional MmsAttachment arg);
   void AsyncScrollEventDetail(optional AsyncScrollEventDetail arg);
   void OpenWindowEventDetail(optional OpenWindowEventDetail arg);
   void DOMWindowResizeEventDetail(optional DOMWindowResizeEventDetail arg);
   void WifiOptions(optional WifiCommandOptions arg1,
                    optional WifiResultOptions arg2);
-  void AppNotificationServiceOptions(optional AppNotificationServiceOptions arg);
 };
 
 interface DummyInterfaceWorkers {
   BlobPropertyBag blobBag();
 };
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -14,17 +14,16 @@ PREPROCESSED_WEBIDL_FILES = [
     'Crypto.webidl',
     'Navigator.webidl',
 ]
 
 WEBIDL_FILES = [
     'AbstractWorker.webidl',
     'AnalyserNode.webidl',
     'AnimationEvent.webidl',
-    'AppNotificationServiceOptions.webidl',
     'ArchiveReader.webidl',
     'ArchiveRequest.webidl',
     'Attr.webidl',
     'AudioBuffer.webidl',
     'AudioBufferSourceNode.webidl',
     'AudioContext.webidl',
     'AudioDestinationNode.webidl',
     'AudioListener.webidl',