Bug 1329668 Handle partial initialized when ScriptLoader is canceled. r=baku a=gchang
authorBen Kelly <ben@wanderview.com>
Wed, 11 Jan 2017 08:35:27 -0800
changeset 359339 9cec46d51aa3fa090c5375a8b1a7e3dd013a6a86
parent 359338 6dd3d485a0598df6175e0d0551237b427ba3bf04
child 359340 614acf4f43e8783b028fd8f95ce31f86cbfed22e
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku, gchang
bugs1329668
milestone51.0
Bug 1329668 Handle partial initialized when ScriptLoader is canceled. r=baku a=gchang
dom/workers/ScriptLoader.cpp
--- a/dom/workers/ScriptLoader.cpp
+++ b/dom/workers/ScriptLoader.cpp
@@ -1554,23 +1554,27 @@ CacheCreator::ResolvedCallback(JSContext
   }
 }
 
 void
 CacheCreator::DeleteCache()
 {
   AssertIsOnMainThread();
 
-  ErrorResult rv;
+  // This is called when the load is canceled which can occur before
+  // mCacheStorage is initialized.
+  if (!mCacheStorage) {
+    return;
+  }
 
   // It's safe to do this while Cache::Match() and Cache::Put() calls are
   // running.
+  IgnoredErrorResult rv;
   RefPtr<Promise> promise = mCacheStorage->Delete(mCacheName, rv);
   if (NS_WARN_IF(rv.Failed())) {
-    rv.SuppressException();
     return;
   }
 
   // We don't care to know the result of the promise object.
   FailLoaders(NS_ERROR_FAILURE);
 }
 
 void