Bug 1128454 - When plugin bridging fails, propagate the error back to the content process without aborting tabs. r=billm, a=lmandel
authorJim Mathies <jmathies@mozilla.com>
Mon, 20 Jul 2015 10:20:15 -0500
changeset 281704 465a16e73fb6adb4307b7cbdb88a57926ab24da5
parent 281703 6e8defca65badde154ad060b2652c1ab37a7b14d
child 281705 89cf1f6f99cb59292cca57ceb6a2063bde7e36b6
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm, lmandel
bugs1128454
milestone41.0a2
Bug 1128454 - When plugin bridging fails, propagate the error back to the content process without aborting tabs. r=billm, a=lmandel
dom/plugins/ipc/PluginModuleParent.cpp
ipc/glue/MessageChannel.h
ipc/ipdl/test/cxx/TestBridgeMain.cpp
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -125,26 +125,16 @@ mozilla::plugins::SetupBridge(uint32_t a
     }
     chromeParent->SetContentParent(aContentParent);
     if (!aForceBridgeNow && chromeParent->IsStartingAsync() &&
         PluginModuleChromeParent::DidInstantiate()) {
         // We'll handle the bridging asynchronously
         return true;
     }
     *rv = PPluginModule::Bridge(aContentParent, chromeParent);
-    if (NS_FAILED(*rv)) {
-#if defined(MOZ_CRASHREPORTER)
-        // We are going to abort due to the failure, lets note the cause
-        // in the report for diagnosing.
-        nsAutoCString error;
-        error.AppendPrintf("%X", *rv);
-        CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("BridgePluginError"), error);
-#endif
-      return false;
-    }
     return true;
 }
 
 #ifdef MOZ_CRASHREPORTER_INJECTOR
 
 /**
  * Use for executing CreateToolhelp32Snapshot off main thread
  */
--- a/ipc/glue/MessageChannel.h
+++ b/ipc/glue/MessageChannel.h
@@ -124,16 +124,21 @@ class MessageChannel : HasResultCodes
     // Make an Interrupt call to the other side of the channel
     bool Call(Message* aMsg, Message* aReply);
 
     // Wait until a message is received
     bool WaitForIncomingMessage();
 
     bool CanSend() const;
 
+    // Currently only for debugging purposes, doesn't aquire mMonitor.
+    ChannelState GetChannelState__TotallyRacy() const {
+        return mChannelState;
+    }
+
     void SetReplyTimeoutMs(int32_t aTimeoutMs);
 
     bool IsOnCxxStack() const {
         return !mCxxStackFrames.empty();
     }
 
     void CancelCurrentTransaction();
 
--- a/ipc/ipdl/test/cxx/TestBridgeMain.cpp
+++ b/ipc/ipdl/test/cxx/TestBridgeMain.cpp
@@ -128,17 +128,17 @@ TestBridgeSubParent::Main()
 {
     if (!SendPing())
         fail("sending Ping");
 }
 
 bool
 TestBridgeSubParent::RecvBridgeEm()
 {
-    if (!PTestBridgeMainSub::Bridge(gBridgeMainChild, this))
+    if (NS_FAILED(PTestBridgeMainSub::Bridge(gBridgeMainChild, this)))
         fail("bridging Main and Sub");
     return true;
 }
 
 void
 TestBridgeSubParent::ActorDestroy(ActorDestroyReason why)
 {
     if (NormalShutdown != why)