Bug 944309: Change null check for window from assert to full check/fail in Notification.cpp; r=mrbkap r=mhenretty
authorKyle Machulis <kyle@nonpolynomial.com>
Thu, 05 Dec 2013 15:26:04 -0800
changeset 174762 da8591a80c4fef8a3b0dc2ad6f9fc5206fc99f6e
parent 174761 d93a8d72cac1a64282d5f46f1ee7ec89f828418b
child 174763 c0128d154ed3f96d47b6dd09080e116f4cec7b0a
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap, mhenretty
bugs944309
milestone28.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 944309: Change null check for window from assert to full check/fail in Notification.cpp; r=mrbkap r=mhenretty
dom/src/notification/Notification.cpp
--- a/dom/src/notification/Notification.cpp
+++ b/dom/src/notification/Notification.cpp
@@ -729,19 +729,19 @@ Notification::WrapObject(JSContext* aCx,
 {
   return mozilla::dom::NotificationBinding::Wrap(aCx, aScope, this);
 }
 
 void
 Notification::Close()
 {
   // Queue a task to close the notification.
-  nsCOMPtr<nsIRunnable> showNotificationTask =
+  nsCOMPtr<nsIRunnable> closeNotificationTask =
     new NotificationTask(this, NotificationTask::eClose);
-  NS_DispatchToMainThread(showNotificationTask);
+  NS_DispatchToMainThread(closeNotificationTask);
 }
 
 void
 Notification::CloseInternal()
 {
   if (!mIsClosed) {
     nsresult rv;
     // Don't bail out if notification storage fails, since we still
@@ -766,17 +766,19 @@ Notification::CloseInternal()
       }
     }
   }
 }
 
 nsresult
 Notification::GetOrigin(nsPIDOMWindow* aWindow, nsString& aOrigin)
 {
-  MOZ_ASSERT(aWindow);
+  if (!aWindow) {
+    return NS_ERROR_FAILURE;
+  }
   nsresult rv;
   nsIDocument* doc = aWindow->GetExtantDoc();
   NS_ENSURE_TRUE(doc, NS_ERROR_UNEXPECTED);
   nsIPrincipal* principal = doc->NodePrincipal();
   NS_ENSURE_TRUE(principal, NS_ERROR_UNEXPECTED);
 
   uint16_t appStatus = principal->GetAppStatus();
   uint32_t appId = principal->GetAppId();