Bug 1057135 - Use MOZ_ASSERT. r=ehsan
authorNikhil Marathe <nsm.nikhil@gmail.com>
Fri, 22 Aug 2014 15:19:37 -0700
changeset 201591 36271619da174b783e33f4208f07010606bd1c93
parent 201590 e0a077aace0cb0d89a798083f2c0bfb5580aa8d6
child 201592 d8c1c88cde24da8d53cd66efe91c5733801562dc
push id27375
push userryanvm@gmail.com
push dateTue, 26 Aug 2014 19:56:59 +0000
treeherdermozilla-central@f9bfe115fee5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1057135
milestone34.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 1057135 - Use MOZ_ASSERT. r=ehsan
dom/workers/ServiceWorkerManager.cpp
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -550,20 +550,17 @@ ServiceWorkerManager::Register(const nsA
 {
   AssertIsOnMainThread();
 
   // XXXnsm Don't allow chrome callers for now, we don't support chrome
   // ServiceWorkers.
   MOZ_ASSERT(!nsContentUtils::IsCallerChrome());
 
   nsCOMPtr<nsIGlobalObject> sgo = GetEntryGlobal();
-  if (!sgo) {
-    MOZ_CRASH("Register() should only be called from a valid entry settings object!");
-    return NS_ERROR_FAILURE;
-  }
+  MOZ_ASSERT(sgo, "Register() should only be called from a valid entry settings object!");
 
   ErrorResult result;
   nsRefPtr<Promise> promise = Promise::Create(sgo, result);
   if (result.Failed()) {
     return result.ErrorCode();
   }
 
   nsCOMPtr<nsIDocument> doc = GetEntryDocument();