summaryrefslogtreecommitdiffstats
path: root/chrome/common/pepper_plugin_registry.cc
diff options
context:
space:
mode:
authorbbudge@google.com <bbudge@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-03 19:57:36 +0000
committerbbudge@google.com <bbudge@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-03 19:57:36 +0000
commitfa28c1001fa9fa64465ede66a3a6d8bdde666d62 (patch)
treeb815de4324ef01262f0b14c7bccc5d54bb5dbefe /chrome/common/pepper_plugin_registry.cc
parent2bfdd7f8d460670ae99febe695bb45b225949102 (diff)
downloadchromium_src-fa28c1001fa9fa64465ede66a3a6d8bdde666d62.zip
chromium_src-fa28c1001fa9fa64465ede66a3a6d8bdde666d62.tar.gz
chromium_src-fa28c1001fa9fa64465ede66a3a6d8bdde666d62.tar.bz2
Fix enable/disable of the Chrome Pepper Nacl plug-in. On Linux, the Zygote loads plugins before all command line information is available. In particular, the about:flags flag for NaCl isn't loaded yet. The fix is to always load the plugin and have the PluginService check the command line flags and set the WebPluginInfo.enabled field based on that.
TEST=manual BUG=71989 Review URL: http://codereview.chromium.org/6610005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76779 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/pepper_plugin_registry.cc')
-rw-r--r--chrome/common/pepper_plugin_registry.cc33
1 files changed, 14 insertions, 19 deletions
diff --git a/chrome/common/pepper_plugin_registry.cc b/chrome/common/pepper_plugin_registry.cc
index 880c11e..7c8a681 100644
--- a/chrome/common/pepper_plugin_registry.cc
+++ b/chrome/common/pepper_plugin_registry.cc
@@ -59,25 +59,20 @@ void ComputeBuiltInPlugins(std::vector<PepperPluginInfo>* plugins) {
}
}
- // Native client.
- //
- // Verify that we enable nacl on the command line. The name of the switch
- // varies between the browser and renderer process.
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNaCl) &&
- PathService::Get(chrome::FILE_NACL_PLUGIN, &path) &&
- file_util::PathExists(path)) {
- PepperPluginInfo nacl;
- nacl.path = path;
- nacl.name = kNaClPluginName;
- nacl.mime_types.push_back(kNaClPluginMimeType);
-
- // TODO(bbudge) Remove this mime type after NaCl tree has been updated.
- const char* kNaClPluginOldMimeType = "application/x-ppapi-nacl-srpc";
- nacl.mime_types.push_back(kNaClPluginOldMimeType);
-
- nacl.file_extensions = kNaClPluginExtension;
- nacl.type_descriptions = kNaClPluginDescription;
- plugins->push_back(nacl);
+ // Handle the Native Client plugin just like the PDF plugin.
+ static bool skip_nacl_file_check = false;
+ if (PathService::Get(chrome::FILE_NACL_PLUGIN, &path)) {
+ if (skip_nacl_file_check || file_util::PathExists(path)) {
+ PepperPluginInfo nacl;
+ nacl.path = path;
+ nacl.name = kNaClPluginName;
+ nacl.mime_types.push_back(kNaClPluginMimeType);
+ nacl.file_extensions = kNaClPluginExtension;
+ nacl.type_descriptions = kNaClPluginDescription;
+ plugins->push_back(nacl);
+
+ skip_nacl_file_check = true;
+ }
}
// Remoting.