Bug 1157754 part 2. Convert consumers of ErrorResult::ClearMessage() to the new better APIs we have for suppressing exceptions on ErrorResult. r=bkelly
authorBoris Zbarsky <bzbarsky@mit.edu>
Sun, 26 Apr 2015 22:38:17 -0400
changeset 241115 c944fc7df69278ef6aee1cc1f71c8b987b448bd0
parent 241114 a03d304acdb37dbd7b1bf4d5b5267f2fbace336d
child 241116 4b8a27223558d02d7b9b0731231d0ddea3c3cc5d
push id28652
push usercbook@mozilla.com
push dateMon, 27 Apr 2015 10:00:58 +0000
treeherdermozilla-central@8aff0d2a7bc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1157754
milestone40.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 1157754 part 2. Convert consumers of ErrorResult::ClearMessage() to the new better APIs we have for suppressing exceptions on ErrorResult. r=bkelly
dom/cache/CacheOpParent.cpp
dom/cache/DBSchema.cpp
dom/cache/FetchPut.cpp
dom/fetch/FetchDriver.cpp
--- a/dom/cache/CacheOpParent.cpp
+++ b/dom/cache/CacheOpParent.cpp
@@ -190,17 +190,17 @@ CacheOpParent::OnOpComplete(ErrorResult&
   NS_ASSERT_OWNINGTHREAD(CacheOpParent);
   MOZ_ASSERT(mIpcManager);
   MOZ_ASSERT(mManager);
 
   // Never send an op-specific result if we have an error.  Instead, send
   // void_t() to ensure that we don't leak actors on the child side.
   if (aRv.Failed()) {
     unused << Send__delete__(this, aRv, void_t());
-    aRv.ClearMessage(); // This may contain a TypeError.
+    aRv.SuppressException(); // We serialiazed it, as best we could.
     return;
   }
 
   // The result must contain the appropriate type at this point.  It may
   // or may not contain the additional result data yet.  For types that
   // do not need special processing, it should already be set.  If the
   // result requires actor-specific operations, then we do that below.
   // If the type and data types don't match, then we will trigger an
--- a/dom/cache/DBSchema.cpp
+++ b/dom/cache/DBSchema.cpp
@@ -978,24 +978,24 @@ MatchByVaryHeader(mozIStorageConnection*
       MOZ_ASSERT(!header.EqualsLiteral("*"),
                  "We should have already caught this in "
                  "TypeUtils::ToPCacheResponseWithoutBody()");
 
       ErrorResult errorResult;
       nsAutoCString queryValue;
       queryHeaders->Get(header, queryValue, errorResult);
       if (errorResult.Failed()) {
-        errorResult.ClearMessage();
+        errorResult.SuppressException();
         MOZ_ASSERT(queryValue.IsEmpty());
       }
 
       nsAutoCString cachedValue;
       cachedHeaders->Get(header, cachedValue, errorResult);
       if (errorResult.Failed()) {
-        errorResult.ClearMessage();
+        errorResult.SuppressException();
         MOZ_ASSERT(cachedValue.IsEmpty());
       }
 
       if (queryValue != cachedValue) {
         varyHeadersMatch = false;
         bailOut = true;
         break;
       }
--- a/dom/cache/FetchPut.cpp
+++ b/dom/cache/FetchPut.cpp
@@ -155,17 +155,18 @@ FetchPut::FetchPut(Listener* aListener, 
 }
 
 FetchPut::~FetchPut()
 {
   MOZ_ASSERT(mInitiatingThread == NS_GetCurrentThread());
   MOZ_ASSERT(!mListener);
   mManager->RemoveListener(this);
   mManager->ReleaseCacheId(mCacheId);
-  mResult.ClearMessage(); // This may contain a TypeError.
+  mResult.SuppressException(); // XXXbz should we really be ending up here with
+                               // a failed mResult we never reported to anyone?
 }
 
 nsresult
 FetchPut::DispatchToMainThread()
 {
   MOZ_ASSERT(!mRunnable);
 
   nsCOMPtr<nsIRunnable> runnable = new Runnable(this);
@@ -384,24 +385,24 @@ FetchPut::MatchInPutList(const CacheRequ
         MOZ_ASSERT(!header.EqualsLiteral("*"),
                    "We should have already caught this in "
                    "TypeUtils::ToPCacheResponseWithoutBody()");
 
         ErrorResult headerRv;
         nsAutoCString value;
         requestHeaders->Get(header, value, headerRv);
         if (NS_WARN_IF(headerRv.Failed())) {
-          headerRv.ClearMessage();
+          headerRv.SuppressException();
           MOZ_ASSERT(value.IsEmpty());
         }
 
         nsAutoCString cachedValue;
         cachedRequestHeaders->Get(header, value, headerRv);
         if (NS_WARN_IF(headerRv.Failed())) {
-          headerRv.ClearMessage();
+          headerRv.SuppressException();
           MOZ_ASSERT(cachedValue.IsEmpty());
         }
 
         if (value != cachedValue) {
           varyHeadersMatch = false;
           bailOut = true;
           break;
         }
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -629,17 +629,17 @@ public:
   VisitHeader(const nsACString & aHeader, const nsACString & aValue) override
   {
     ErrorResult result;
     mResponse->Headers()->Append(aHeader, aValue, result);
     if (result.Failed()) {
       NS_WARNING(nsPrintfCString("Fetch ignoring illegal header - '%s': '%s'",
                                  PromiseFlatCString(aHeader).get(),
                                  PromiseFlatCString(aValue).get()).get());
-      result.ClearMessage();
+      result.SuppressException();
     }
     return NS_OK;
   }
 };
 
 NS_IMPL_ISUPPORTS(FillResponseHeaders, nsIHttpHeaderVisitor)
 } // anonymous namespace