Bug 1384328: Follow-up: Fix some error handling problems exposed by 71df96e65afa; r=bustage
authorAaron Klotz <aklotz@mozilla.com>
Tue, 01 Aug 2017 15:11:34 -0600
changeset 420949 b4ecd488495e695b3e3329e889f64b9c9e00d4b4
parent 420948 1c5f2189d04936026c9092741bbff8aa26de0d14
child 420950 fec8d72590053c3ad72cd3492d389213dfabc2ff
child 421883 0d58c73551f3251150bb204b9804d37eceaa9fe3
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
bugs1384328
milestone56.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 1384328: Follow-up: Fix some error handling problems exposed by 71df96e65afa; r=bustage MozReview-Commit-ID: GOar3lF4kCr
ipc/mscom/Interceptor.cpp
ipc/mscom/Objref.cpp
--- a/ipc/mscom/Interceptor.cpp
+++ b/ipc/mscom/Interceptor.cpp
@@ -248,17 +248,23 @@ Interceptor::GetMarshalSizeMax(REFIID ri
                                                               mshlflags),
                                               pSize);
   if (FAILED(hr)) {
     return hr;
   }
 
   DWORD payloadSize = 0;
   hr = mEventSink->GetHandlerPayloadSize(WrapNotNull(&payloadSize));
-  *pSize += payloadSize;
+  if (hr == E_NOTIMPL) {
+    return S_OK;
+  }
+
+  if (SUCCEEDED(hr)) {
+    *pSize += payloadSize;
+  }
   return hr;
 }
 
 HRESULT
 Interceptor::MarshalInterface(IStream* pStm, REFIID riid, void* pv,
                               DWORD dwDestContext, void* pvDestContext,
                               DWORD mshlflags)
 {
@@ -312,17 +318,22 @@ Interceptor::MarshalInterface(IStream* p
         return E_FAIL;
       }
 
       return S_OK;
     }
   }
 #endif // defined(MOZ_MSCOM_REMARSHAL_NO_HANDLER)
 
-  return mEventSink->WriteHandlerPayload(WrapNotNull(pStm));
+  hr = mEventSink->WriteHandlerPayload(WrapNotNull(pStm));
+  if (hr == E_NOTIMPL) {
+    return S_OK;
+  }
+
+  return hr;
 }
 
 HRESULT
 Interceptor::UnmarshalInterface(IStream* pStm, REFIID riid,
                                 void** ppv)
 {
   return mStdMarshal->UnmarshalInterface(pStm, riid, ppv);
 }
--- a/ipc/mscom/Objref.cpp
+++ b/ipc/mscom/Objref.cpp
@@ -161,17 +161,18 @@ StripHandlerFromOBJREF(NotNull<IStream*>
       signature != OBJREF_SIGNATURE) {
     return false;
   }
 
   uint32_t type;
   hr = aStream->Read(&type, sizeof(type), &bytesRead);
   if (FAILED(hr) || bytesRead != sizeof(type) ||
       type != OBJREF_TYPE_HANDLER) {
-    return false;
+    // If we're not a handler then just return success
+    return true;
   }
 
   IID iid;
   hr = aStream->Read(&iid, sizeof(iid), &bytesRead);
   if (FAILED(hr) || bytesRead != sizeof(iid) || !IsValidGUID(iid)) {
     return false;
   }