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

Unified Diff: chrome/common/pepper_plugin_registry.cc

Issue 3031011: Linux: bit hacky way to ensure Pepper plugins get loaded by zygote. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Rebased ToT. Created 10 years, 5 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
« no previous file with comments | « chrome/common/pepper_plugin_registry.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/pepper_plugin_registry.cc
diff --git a/chrome/common/pepper_plugin_registry.cc b/chrome/common/pepper_plugin_registry.cc
index 2ed484ee98283e269f3e87b0eda31cc9ce461073..dcc8074c3316dec955ddcc5d5e2c510665411bdd 100644
--- a/chrome/common/pepper_plugin_registry.cc
+++ b/chrome/common/pepper_plugin_registry.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
+#include "base/native_library.h"
#include "base/path_service.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
@@ -13,6 +14,9 @@
#include "chrome/common/chrome_switches.h"
#include "remoting/client/plugin/pepper_entrypoints.h"
+PepperPluginInfo::PepperPluginInfo() : is_internal(false) {
+}
+
// static
PepperPluginRegistry* PepperPluginRegistry::GetInstance() {
static PepperPluginRegistry registry;
@@ -35,6 +39,19 @@ void PepperPluginRegistry::GetList(std::vector<PepperPluginInfo>* plugins) {
}
// static
+void PepperPluginRegistry::PreloadModules() {
+ std::vector<PepperPluginInfo> plugins;
+ GetList(&plugins);
+ for (size_t i = 0; i < plugins.size(); ++i) {
+ if (!plugins[i].is_internal) {
+ base::NativeLibrary library = base::LoadNativeLibrary(plugins[i].path);
+ LOG_IF(WARNING, !library) << "Unable to load plugin "
+ << plugins[i].path.value();
+ }
+ }
+}
+
+// static
void PepperPluginRegistry::GetPluginInfoFromSwitch(
std::vector<PepperPluginInfo>* plugins) {
const std::wstring& value = CommandLine::ForCurrentProcess()->GetSwitchValue(
@@ -89,6 +106,10 @@ void PepperPluginRegistry::GetExtraPlugins(
}
}
+PepperPluginRegistry::InternalPluginInfo::InternalPluginInfo() {
+ is_internal = true;
+}
+
// static
void PepperPluginRegistry::GetInternalPluginInfo(
InternalPluginInfoList* plugin_info) {
@@ -108,6 +129,7 @@ void PepperPluginRegistry::GetInternalPluginInfo(
switches::kEnableChromoting)) {
InternalPluginInfo info;
// Add the chromoting plugin.
+ DCHECK(info.is_internal);
info.path =
FilePath(FILE_PATH_LITERAL("internal-chromoting"));
info.mime_types.push_back("pepper-application/x-chromoting");
« no previous file with comments | « chrome/common/pepper_plugin_registry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698