Bug 1469181 - Port Notification API to WorkerRef - part 2 - remove dead code, r=mrbkap
☠☠ backed out by 81bb56f69788 ☠ ☠
authorAndrea Marchesini <amarchesini@mozilla.com>
Mon, 18 Jun 2018 19:38:08 -0400
changeset 479655 ef39038ae70e88e13cefd66ab004f959ecc4a9e7
parent 479654 66de682a9c1b41687710f057fbee6d189a50385d
child 479656 3c780655f6d1beceaf733b7d637fb65bf3cf5c10
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs1469181
milestone62.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 1469181 - Port Notification API to WorkerRef - part 2 - remove dead code, r=mrbkap
dom/notification/Notification.cpp
dom/notification/Notification.h
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -1281,46 +1281,16 @@ private:
   const nsString mData;
   const nsString mBehavior;
 };
 
 NS_IMPL_ISUPPORTS(ServiceWorkerNotificationObserver, nsIObserver)
 
 // For ServiceWorkers.
 bool
-Notification::DispatchNotificationClickEvent()
-{
-  MOZ_ASSERT(mWorkerPrivate);
-  MOZ_ASSERT(mWorkerPrivate->IsServiceWorker());
-  mWorkerPrivate->AssertIsOnWorkerThread();
-
-  NotificationEventInit options;
-  options.mNotification = this;
-
-  ErrorResult result;
-  RefPtr<EventTarget> target = mWorkerPrivate->GlobalScope();
-  RefPtr<NotificationEvent> event =
-    NotificationEvent::Constructor(target,
-                                   NS_LITERAL_STRING("notificationclick"),
-                                   options,
-                                   result);
-  if (NS_WARN_IF(result.Failed())) {
-    return false;
-  }
-
-  event->SetTrusted(true);
-  WantsPopupControlCheck popupControlCheck(event);
-  target->DispatchEvent(*event);
-  // We always return false since in case of dispatching on the serviceworker,
-  // there is no well defined window to focus. The script may use the
-  // Client.focus() API if it wishes.
-  return false;
-}
-
-bool
 Notification::DispatchClickEvent()
 {
   AssertIsOnTargetThread();
   RefPtr<Event> event = NS_NewDOMEvent(this, nullptr, nullptr);
   event->InitEvent(NS_LITERAL_STRING("click"), false, true);
   event->SetTrusted(true);
   WantsPopupControlCheck popupControlCheck(event);
   return DispatchEvent(*event, CallerType::System, IgnoreErrors());
--- a/dom/notification/Notification.h
+++ b/dom/notification/Notification.h
@@ -312,17 +312,16 @@ public:
                                               ErrorResult& aRv);
 
   static NotificationPermission GetPermissionInternal(nsIPrincipal* aPrincipal,
                                                       ErrorResult& rv);
 
   static NotificationPermission TestPermission(nsIPrincipal* aPrincipal);
 
   bool DispatchClickEvent();
-  bool DispatchNotificationClickEvent();
 
   static nsresult RemovePermission(nsIPrincipal* aPrincipal);
   static nsresult OpenSettings(nsIPrincipal* aPrincipal);
 
   nsresult DispatchToMainThread(already_AddRefed<nsIRunnable>&& aRunnable);
 protected:
   Notification(nsIGlobalObject* aGlobal, const nsAString& aID,
                const nsAString& aTitle, const nsAString& aBody,