Bug 1106264: Log the message name for nsSameProcessAsyncMessage OOMs. r=jimm
authorDavid Major <dmajor@mozilla.com>
Wed, 22 Jul 2015 13:43:02 -0400
changeset 285863 caefe89148b3e7e9c2f5b05d9d1ab6231a6fbe35
parent 285862 e56bc3c9a17288d403c551ffc738dcc23fad67c9
child 285864 74f5f13e1b63ed64273056e22ec88b9cb96d5017
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1106264
milestone42.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 1106264: Log the message name for nsSameProcessAsyncMessage OOMs. r=jimm
dom/base/nsFrameMessageManager.cpp
--- a/dom/base/nsFrameMessageManager.cpp
+++ b/dom/base/nsFrameMessageManager.cpp
@@ -42,16 +42,20 @@
 #include "mozilla/dom/ipc/BlobParent.h"
 #include "mozilla/dom/DOMStringList.h"
 #include "mozilla/jsipc/CrossProcessObjectWrappers.h"
 #include "nsPrintfCString.h"
 #include "nsXULAppAPI.h"
 #include "nsQueryObject.h"
 #include <algorithm>
 
+#ifdef MOZ_CRASHREPORTER
+#include "nsExceptionHandler.h"
+#endif
+
 #ifdef ANDROID
 #include <android/log.h>
 #endif
 #ifdef XP_WIN
 #include <windows.h>
 # if defined(SendMessage)
 #  undef SendMessage
 # endif
@@ -2194,16 +2198,20 @@ nsSameProcessAsyncMessageBase::nsSamePro
                                                              JS::Handle<JSObject*> aCpows,
                                                              nsIPrincipal* aPrincipal)
   : mRuntime(js::GetRuntime(aCx)),
     mMessage(aMessage),
     mCpows(aCx, aCpows),
     mPrincipal(aPrincipal)
 {
   if (aData.mDataLength && !mData.copy(aData.mData, aData.mDataLength)) {
+#ifdef MOZ_CRASHREPORTER
+    CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AsyncMessageOOM"),
+                                       NS_ConvertUTF16toUTF8(aMessage));
+#endif
     NS_ABORT_OOM(aData.mDataLength);
   }
   mClosure = aData.mClosure;
 }
 
 void
 nsSameProcessAsyncMessageBase::ReceiveMessage(nsISupports* aTarget,
                                               nsIFrameLoader* aTargetFrameLoader,