Backed out changeset f966dedaa07c (bug 1469603) for B bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/plugins/PluginModuleParent.h:324: on a CLOSED TREE
authorshindli <shindli@mozilla.com>
Thu, 21 Jun 2018 10:34:44 +0300
changeset 477456 5dbc311fb93c0f6d4c82eb14fa9062984251ccfe
parent 477455 f966dedaa07cc97f0d2f28bd6414577e1767300d
child 477457 46ea394f0c30fdfef5cc24baa78a667e9e0c1dc0
push id9385
push userdluca@mozilla.com
push dateFri, 22 Jun 2018 15:47:18 +0000
treeherdermozilla-beta@82a9a1027e2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1469603
milestone62.0a1
backs outf966dedaa07cc97f0d2f28bd6414577e1767300d
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
Backed out changeset f966dedaa07c (bug 1469603) for B bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/plugins/PluginModuleParent.h:324: on a CLOSED TREE
dom/plugins/ipc/PluginModuleParent.cpp
dom/plugins/ipc/PluginModuleParent.h
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -575,17 +575,17 @@ PluginModuleChromeParent::InitCrashRepor
     }
 
     NativeThreadId threadId;
     if (!CallInitCrashReporter(shmem, &threadId)) {
         return false;
     }
 
     {
-      mozilla::RecursiveMutexAutoLock lock(mCrashReporterMutex);
+      mozilla::MutexAutoLock lock(mCrashReporterMutex);
       mCrashReporter = MakeUnique<ipc::CrashReporterHost>(
         GeckoProcessType_Plugin,
         shmem,
         threadId);
     }
 
     return true;
 }
@@ -715,17 +715,17 @@ PluginModuleChromeParent::~PluginModuleC
 
     mozilla::HangMonitor::UnregisterAnnotator(*this);
 }
 
 void
 PluginModuleChromeParent::WriteExtraDataForMinidump()
 {
     // mCrashReporterMutex is already held by the caller
-    mCrashReporterMutex.AssertCurrentThreadIn();
+    mCrashReporterMutex.AssertCurrentThreadOwns();
 
     typedef nsDependentCString cstring;
 
     // Get the plugin filename, try to get just the file leafname
     const std::string& pluginFile = mSubprocess->GetPluginFilePath();
     size_t filePos = pluginFile.rfind(FILE_PATH_SEPARATOR);
     if (filePos == std::string::npos)
         filePos = 0;
@@ -1081,17 +1081,17 @@ PluginModuleContentParent::OnExitedSyncS
 }
 
 void
 PluginModuleChromeParent::TakeFullMinidump(base::ProcessId aContentPid,
                                            const nsAString& aBrowserDumpId,
                                            std::function<void(nsString)>&& aCallback,
                                            bool aAsync)
 {
-    mozilla::RecursiveMutexAutoLock lock(mCrashReporterMutex);
+    mozilla::MutexAutoLock lock(mCrashReporterMutex);
 
     if (!mCrashReporter || !mTakeFullMinidumpCallback.IsEmpty()) {
         aCallback(EmptyString());
         return;
     }
     mTakeFullMinidumpCallback.Init(std::move(aCallback), aAsync);
 
     nsString browserDumpId{aBrowserDumpId};
@@ -1168,17 +1168,17 @@ PluginModuleChromeParent::ReleasePluginR
 }
 
 void
 PluginModuleChromeParent::TakeBrowserAndPluginMinidumps(bool aReportsReady,
                                                         base::ProcessId aContentPid,
                                                         const nsAString& aBrowserDumpId,
                                                         bool aAsync)
 {
-    mCrashReporterMutex.AssertCurrentThreadIn();
+    mCrashReporterMutex.AssertCurrentThreadOwns();
 
     // Generate crash report including plugin and browser process minidumps.
     // The plugin process is the parent report with additional dumps including
     // the browser process, content process when running under e10s, and
     // various flash subprocesses if we're the flash module.
     if (!aReportsReady) {
         mBrowserDumpFile = nullptr;
         CrashReporter::DeleteMinidumpFilesForID(aBrowserDumpId);
@@ -1203,17 +1203,17 @@ PluginModuleChromeParent::TakeBrowserAnd
     }
 }
 
 void
 PluginModuleChromeParent::OnTakeFullMinidumpComplete(bool aReportsReady,
                                                      base::ProcessId aContentPid,
                                                      const nsAString& aBrowserDumpId)
 {
-    mCrashReporterMutex.AssertCurrentThreadIn();
+    mCrashReporterMutex.AssertCurrentThreadOwns();
 
     if (aReportsReady) {
         nsString dumpId = mCrashReporter->MinidumpID();
         PLUGIN_LOG_DEBUG(
                          ("generated paired browser/plugin minidumps: %s)",
                           NS_ConvertUTF16toUTF8(dumpId).get()));
         nsAutoCString additionalDumps("browser");
         nsCOMPtr<nsIFile> pluginDumpFile;
@@ -1288,17 +1288,17 @@ PluginModuleChromeParent::TerminateChild
         TerminateChildProcessOnDumpComplete(aMsgLoop, aMonitorDescription);
     }
 }
 
 void
 PluginModuleChromeParent::TerminateChildProcessOnDumpComplete(MessageLoop* aMsgLoop,
                                                               const nsCString& aMonitorDescription)
 {
-    mCrashReporterMutex.AssertCurrentThreadIn();
+    mCrashReporterMutex.AssertCurrentThreadOwns();
 
     if (!mCrashReporter) {
         // If mCrashReporter is null then the hang has ended, the plugin module
         // is shutting down. There's nothing to do here.
         mTerminateChildProcessCallback.Invoke(true);
         return;
     }
     mCrashReporter->AddNote(NS_LITERAL_CSTRING("PluginHang"),
@@ -1505,17 +1505,17 @@ RemoveMinidump(nsIFile* minidump)
         extraFile->Remove(true);
     }
 }
 #endif // MOZ_CRASHREPORTER_INJECTOR
 
 void
 PluginModuleChromeParent::ProcessFirstMinidump()
 {
-    mozilla::RecursiveMutexAutoLock lock(mCrashReporterMutex);
+    mozilla::MutexAutoLock lock(mCrashReporterMutex);
 
     if (!mCrashReporter)
         return;
 
     WriteExtraDataForMinidump();
 
     if (mCrashReporter->HasMinidump()) {
         // A minidump may be set in TerminateChildProcess, which means the
--- a/dom/plugins/ipc/PluginModuleParent.h
+++ b/dom/plugins/ipc/PluginModuleParent.h
@@ -312,21 +312,19 @@ protected:
 
     RefPtr<layers::TextureClientRecycleAllocator> mTextureAllocatorForDirectBitmap;
     RefPtr<layers::TextureClientRecycleAllocator> mTextureAllocatorForDXGISurface;
 
     /**
      * This mutex protects the crash reporter when the Plugin Hang UI event
      * handler is executing off main thread. It is intended to protect both
      * the mCrashReporter variable in addition to the CrashReporterHost object
-     * that mCrashReporter refers to. Sometimes asynchronous crash reporter
-     * callbacks are dispatched synchronously while the caller is still holding
-     * the mutex. This requires recursive locking support in the mutex.
+     * that mCrashReporter refers to.
      */
-    mozilla::RecursiveMutex mCrashReporterMutex;
+    mozilla::Mutex mCrashReporterMutex;
     UniquePtr<ipc::CrashReporterHost> mCrashReporter;
 };
 
 class PluginModuleContentParent : public PluginModuleParent
 {
   public:
     explicit PluginModuleContentParent();