Bug 1126450 - When Flash has a blocklist entry, we should keep protected-mode on, no matter the value of the pref setting. r=aklotz
authorBenjamin Smedberg <benjamin@smedbergs.us>
Tue, 27 Jan 2015 15:49:48 -0500
changeset 239514 ae5cd730766250aac5ac66511364ecc178e87328
parent 239513 db7c4ffd5a53d68c20d9b7235d845665ea145e1d
child 239515 007fbd5bc4bdbdd63a375ecac60605249fa1b832
push id500
push userjoshua.m.grant@gmail.com
push dateThu, 29 Jan 2015 01:48:36 +0000
reviewersaklotz
bugs1126450
milestone38.0a1
Bug 1126450 - When Flash has a blocklist entry, we should keep protected-mode on, no matter the value of the pref setting. r=aklotz
dom/plugins/ipc/PluginModuleParent.cpp
dom/plugins/ipc/PluginModuleParent.h
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -407,16 +407,17 @@ PluginModuleChromeParent::LoadModule(con
     bool launched = parent->mSubprocess->Launch(Move(onLaunchedRunnable),
                                                 enableSandbox);
     if (!launched) {
         // We never reached open
         parent->mShutdown = true;
         return nullptr;
     }
     parent->mIsFlashPlugin = aPluginTag->mIsFlashPlugin;
+    parent->mIsBlocklisted = aPluginTag->GetBlocklistState() != 0;
     if (!parent->mIsStartingAsync) {
         int32_t launchTimeoutSecs = Preferences::GetInt(kLaunchTimeoutPref, 0);
         if (!parent->mSubprocess->WaitUntilConnected(launchTimeoutSecs * 1000)) {
             parent->mShutdown = true;
             return nullptr;
         }
     }
     TimeStamp launchEnd = TimeStamp::Now();
@@ -465,17 +466,17 @@ PluginModuleChromeParent::OnProcessLaunc
     { // Scope for lock
         mozilla::MutexAutoLock lock(mCrashReporterMutex);
         mCrashReporter = CrashReporter();
     }
 #endif
 #endif
 
 #ifdef XP_WIN
-    if (mIsFlashPlugin &&
+    if (!mIsBlocklisted && mIsFlashPlugin &&
         Preferences::GetBool("dom.ipc.plugins.flash.disable-protected-mode", false)) {
         SendDisableFlashProtectedMode();
     }
 #endif
 
     if (mInitOnAsyncConnect) {
         mInitOnAsyncConnect = false;
 #if defined(XP_WIN)
--- a/dom/plugins/ipc/PluginModuleParent.h
+++ b/dom/plugins/ipc/PluginModuleParent.h
@@ -511,14 +511,15 @@ private:
     friend class LaunchedTask;
 
     bool                mInitOnAsyncConnect;
     nsresult            mAsyncInitRv;
     NPError             mAsyncInitError;
     dom::ContentParent* mContentParent;
     nsCOMPtr<nsIObserver> mOfflineObserver;
     bool mIsFlashPlugin;
+    bool mIsBlocklisted;
 };
 
 } // namespace plugins
 } // namespace mozilla
 
 #endif // mozilla_plugins_PluginModuleParent_h