Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Unified Diff: content/browser/plugin_service_impl.cc

Issue 645203002: Block NPAPI plugins by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reorder initializers for clang Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/plugin_service_impl.cc
diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc
index d19f6861c162b2a289d2ca1ccf85a13f3d21bf66..6384f2b667ae796490cf7a4e8b68df38ba485871 100644
--- a/content/browser/plugin_service_impl.cc
+++ b/content/browser/plugin_service_impl.cc
@@ -144,7 +144,7 @@ PluginServiceImpl* PluginServiceImpl::GetInstance() {
}
PluginServiceImpl::PluginServiceImpl()
- : filter_(NULL) {
+ : npapi_plugins_enabled_(false), filter_(NULL) {
// Collect the total number of browser processes (which create
// PluginServiceImpl objects, to be precise). The number is used to normalize
// the number of processes which start at least one NPAPI/PPAPI Flash process.
@@ -181,6 +181,9 @@ void PluginServiceImpl::Init() {
if (command_line->HasSwitch(switches::kDisablePluginsDiscovery))
PluginList::Singleton()->DisablePluginsDiscovery();
+#if defined(OS_WIN) || defined(OS_MACOSX)
+ npapi_plugins_enabled_ = command_line->HasSwitch(switches::kEnableNpapi);
+#endif
}
void PluginServiceImpl::StartWatchingPlugins() {
@@ -779,17 +782,17 @@ void PluginServiceImpl::GetInternalPlugins(
}
bool PluginServiceImpl::NPAPIPluginsSupported() {
-#if defined(OS_WIN) || defined(OS_MACOSX)
- return true;
-#else
- return false;
-#endif
+ return npapi_plugins_enabled_;
}
void PluginServiceImpl::DisablePluginsDiscoveryForTesting() {
PluginList::Singleton()->DisablePluginsDiscovery();
}
+void PluginServiceImpl::EnableNpapiPluginsForTesting() {
+ npapi_plugins_enabled_ = true;
+}
+
#if defined(OS_MACOSX)
void PluginServiceImpl::AppActivated() {
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,

Powered by Google App Engine
This is Rietveld 408576698