Bug 1344187 - Add guards around code in ProxyStream.cpp that require the crash reporter. r=aklotz
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 03 Mar 2017 13:33:13 -0500
changeset 345991 4daed4761e8d02845bc657bef016be99b358e55e
parent 345990 bcda4b323e9fa1e3a2f6b0fc3ed3ca4ec09117c1
child 345992 30c1e64495a9930f3b69b9dbdf6b43d24509c886
push id31452
push usercbook@mozilla.com
push dateMon, 06 Mar 2017 09:54:03 +0000
treeherdermozilla-central@966464a68a2c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaklotz
bugs1344187
milestone54.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 1344187 - Add guards around code in ProxyStream.cpp that require the crash reporter. r=aklotz
ipc/mscom/ProxyStream.cpp
--- a/ipc/mscom/ProxyStream.cpp
+++ b/ipc/mscom/ProxyStream.cpp
@@ -3,17 +3,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Move.h"
 #include "mozilla/mscom/EnsureMTA.h"
 #include "mozilla/mscom/ProxyStream.h"
 #include "mozilla/mscom/Utils.h"
+
+#ifdef MOZ_CRASHREPORTER
 #include "nsExceptionHandler.h"
+#endif
 
 #include <windows.h>
 #include <objbase.h>
 #include <shlwapi.h>
 
 namespace mozilla {
 namespace mscom {
 
@@ -66,21 +69,23 @@ ProxyStream::ProxyStream(const BYTE* aIn
     // We'll marshal this stuff directly using the current thread, therefore its
     // proxy will reside in the same apartment as the current thread.
     marshalFn();
   } else {
     // When marshaling in child processes, we want to force the MTA.
     EnsureMTA mta(marshalFn);
   }
 
+#ifdef MOZ_CRASHREPORTER
   if (FAILED(unmarshalResult)) {
     nsPrintfCString hrAsStr("0x%08X", unmarshalResult);
     CrashReporter::AnnotateCrashReport(
         NS_LITERAL_CSTRING("CoGetInterfaceAndReleaseStreamFailure"), hrAsStr);
   }
+#endif
 }
 
 already_AddRefed<IStream>
 ProxyStream::InitStream(const BYTE* aInitBuf, const UINT aInitBufSize)
 {
   return already_AddRefed<IStream>(::SHCreateMemStream(aInitBuf, aInitBufSize));
 }
 
@@ -188,21 +193,23 @@ ProxyStream::ProxyStream(REFIID aIID, IU
     // We'll marshal this stuff directly using the current thread, therefore its
     // stub will reside in the same apartment as the current thread.
     marshalFn();
   } else {
     // When marshaling in child processes, we want to force the MTA.
     EnsureMTA mta(marshalFn);
   }
 
+#ifdef MOZ_CRASHREPORTER
   if (FAILED(marshalResult)) {
     nsPrintfCString hrAsStr("0x%08X", marshalResult);
     CrashReporter::AnnotateCrashReport(
         NS_LITERAL_CSTRING("CoMarshalInterfaceFailure"), hrAsStr);
   }
+#endif
 
   mStream = mozilla::Move(stream);
   if (hglobal) {
     mGlobalLockedBuf = reinterpret_cast<BYTE*>(::GlobalLock(hglobal));
     mHGlobal = hglobal;
     mBufSize = static_cast<int>(::GlobalSize(hglobal));
   }
 }