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

Unified Diff: chrome/common/pepper_plugin_registry.cc

Issue 3915002: Out of process Pepper (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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
« no previous file with comments | « chrome/common/pepper_plugin_registry.h ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/pepper_plugin_registry.cc
===================================================================
--- chrome/common/pepper_plugin_registry.cc (revision 65099)
+++ chrome/common/pepper_plugin_registry.cc (working copy)
@@ -21,7 +21,9 @@
const char* PepperPluginRegistry::kPDFPluginDescription =
"Portable Document Format";
-PepperPluginInfo::PepperPluginInfo() : is_internal(false) {
+PepperPluginInfo::PepperPluginInfo()
+ : is_internal(false),
+ is_out_of_process(false) {
}
PepperPluginInfo::~PepperPluginInfo() {}
@@ -52,7 +54,7 @@
std::vector<PepperPluginInfo> plugins;
GetList(&plugins);
for (size_t i = 0; i < plugins.size(); ++i) {
- if (!plugins[i].is_internal) {
+ if (!plugins[i].is_internal && !plugins[i].is_out_of_process) {
base::NativeLibrary library = base::LoadNativeLibrary(plugins[i].path);
LOG_IF(WARNING, !library) << "Unable to load plugin "
<< plugins[i].path.value();
@@ -69,6 +71,9 @@
if (value.empty())
return;
+ bool out_of_process =
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kPpapiOutOfProcess);
+
// FORMAT:
// command-line = <plugin-entry> + *( LWS + "," + LWS + <plugin-entry> )
// plugin-entry = <file-path> + ["#" + <name> + ["#" + <description>]] +
@@ -88,6 +93,7 @@
base::SplitString(parts[0], '#', &name_parts);
PepperPluginInfo plugin;
+ plugin.is_out_of_process = out_of_process;
#if defined(OS_WIN)
// This means we can't provide plugins from non-ASCII paths, but
// since this switch is only for development I don't think that's
@@ -168,6 +174,19 @@
#endif
}
+bool PepperPluginRegistry::RunOutOfProcessForPlugin(
+ const FilePath& path) const {
+ // TODO(brettw) don't recompute this every time. But since this Pepper
+ // switch is only for development, it's OK for now.
+ std::vector<PepperPluginInfo> plugins;
+ GetList(&plugins);
+ for (size_t i = 0; i < plugins.size(); ++i) {
+ if (path == plugins[i].path)
+ return plugins[i].is_out_of_process;
+ }
+ return false;
+}
+
pepper::PluginModule* PepperPluginRegistry::GetModule(
const FilePath& path) const {
ModuleMap::const_iterator it = modules_.find(path);
@@ -181,6 +200,7 @@
PepperPluginRegistry::PepperPluginRegistry() {
InternalPluginInfoList internal_plugin_info;
GetInternalPluginInfo(&internal_plugin_info);
+
// Register modules for these suckers.
for (InternalPluginInfoList::const_iterator it =
internal_plugin_info.begin();
@@ -203,6 +223,9 @@
GetPluginInfoFromSwitch(&plugins);
GetExtraPlugins(&plugins);
for (size_t i = 0; i < plugins.size(); ++i) {
+ if (plugins[i].is_out_of_process)
+ continue; // Only preload in-process plugins.
+
const FilePath& path = plugins[i].path;
ModuleHandle module = pepper::PluginModule::CreateModule(path);
if (!module) {
« no previous file with comments | « chrome/common/pepper_plugin_registry.h ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698