summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authormrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 23:50:46 +0000
committermrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 23:50:46 +0000
commit3915295a2bcfd1c8f72cd5bf4c5c23fb8bc87789 (patch)
tree2f8247fdd2ac2f61593d922860e8bf1e8afc5bc8 /chrome/common
parent7fdbbf8d47bf4c2f5d2e86e1ad68443af8cfa8ff (diff)
downloadchromium_src-3915295a2bcfd1c8f72cd5bf4c5c23fb8bc87789.zip
chromium_src-3915295a2bcfd1c8f72cd5bf4c5c23fb8bc87789.tar.gz
chromium_src-3915295a2bcfd1c8f72cd5bf4c5c23fb8bc87789.tar.bz2
Revert 50667 - Add in support for internal pepper plugins into the PepperPluginRegistry and pepper::PluginModule.
Used Chromoting's plugin as the first attempt at using this interface. BUG=none TEST=compiles Review URL: http://codereview.chromium.org/2843018 TBR=ajwong@chromium.org Review URL: http://codereview.chromium.org/2834021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/DEPS1
-rw-r--r--chrome/common/pepper_plugin_registry.cc66
-rw-r--r--chrome/common/pepper_plugin_registry.h11
3 files changed, 2 insertions, 76 deletions
diff --git a/chrome/common/DEPS b/chrome/common/DEPS
index 75629ca..c3db484 100644
--- a/chrome/common/DEPS
+++ b/chrome/common/DEPS
@@ -3,7 +3,6 @@ include_rules = [
"+grit", # For generated headers
"+libxml",
"+media/audio",
- "+remoting/client/plugin",
"+sandbox/src",
"+skia/include",
"+webkit/default_plugin",
diff --git a/chrome/common/pepper_plugin_registry.cc b/chrome/common/pepper_plugin_registry.cc
index e7771c4..0a23eca 100644
--- a/chrome/common/pepper_plugin_registry.cc
+++ b/chrome/common/pepper_plugin_registry.cc
@@ -7,7 +7,6 @@
#include "base/command_line.h"
#include "base/string_util.h"
#include "chrome/common/chrome_switches.h"
-#include "remoting/client/plugin/pepper_entrypoints.h"
// static
PepperPluginRegistry* PepperPluginRegistry::GetInstance() {
@@ -17,21 +16,6 @@ PepperPluginRegistry* PepperPluginRegistry::GetInstance() {
// static
void PepperPluginRegistry::GetList(std::vector<PepperPluginInfo>* plugins) {
- InternalPluginInfoList internal_plugin_info;
- GetInternalPluginInfo(&internal_plugin_info);
- for (InternalPluginInfoList::const_iterator it =
- internal_plugin_info.begin();
- it != internal_plugin_info.end();
- ++it) {
- plugins->push_back(*it);
- }
-
- GetPluginInfoFromSwitch(plugins);
-}
-
-// static
-void PepperPluginRegistry::GetPluginInfoFromSwitch(
- std::vector<PepperPluginInfo>* plugins) {
const std::wstring& value = CommandLine::ForCurrentProcess()->GetSwitchValue(
switches::kRegisterPepperPlugins);
if (value.empty())
@@ -60,35 +44,6 @@ void PepperPluginRegistry::GetPluginInfoFromSwitch(
}
}
-// static
-void PepperPluginRegistry::GetInternalPluginInfo(
- InternalPluginInfoList* plugin_info) {
- // Currently, to centralize the internal plugin registration logic, we
- // hardcode the list of plugins, mimetypes, and registration information
- // in this function. This is gross, but because the GetList() function is
- // called from both the renderer and browser the other option is to force a
- // special register function for each plugin to be called by both
- // RendererMain() and BrowserMain(). This seemed like the better tradeoff.
- //
- // TODO(ajwong): Think up a better way to maintain the plugin registration
- // information. Pehraps by construction of a singly linked list of
- // plugin initializers that is built with static initializers?
-
-#if defined(ENABLE_REMOTING)
- InternalPluginInfo info;
- // Add the chromoting plugin.
- info.path =
- FilePath(FILE_PATH_LITERAL("internal-chromoting"));
- info.mime_types.push_back("pepper-application/x-chromoting");
- info.entry_points.get_interface = remoting::PPP_GetInterface;
- info.entry_points.initialize_module = remoting::PPP_InitializeModule;
- info.entry_points.shutdown_module = remoting::PPP_ShutdownModule;
-
- plugin_info->push_back(info);
-#endif
-
-}
-
pepper::PluginModule* PepperPluginRegistry::GetModule(
const FilePath& path) const {
ModuleMap::const_iterator it = modules_.find(path);
@@ -98,27 +53,8 @@ pepper::PluginModule* PepperPluginRegistry::GetModule(
}
PepperPluginRegistry::PepperPluginRegistry() {
- InternalPluginInfoList internal_plugin_info;
- GetInternalPluginInfo(&internal_plugin_info);
- // Register modules for these suckers.
- for (InternalPluginInfoList::const_iterator it =
- internal_plugin_info.begin();
- it != internal_plugin_info.end();
- ++it) {
- const FilePath& path = it->path;
- ModuleHandle module =
- pepper::PluginModule::CreateInternalModule(it->entry_points);
- if (!module) {
- DLOG(ERROR) << "Failed to load pepper module: " << path.value();
- continue;
- }
- modules_[path] = module;
- }
-
- // Add the modules specified on the command line last so that they can
- // override the internal plugins.
std::vector<PepperPluginInfo> plugins;
- GetPluginInfoFromSwitch(&plugins);
+ GetList(&plugins);
for (size_t i = 0; i < plugins.size(); ++i) {
const FilePath& path = plugins[i].path;
ModuleHandle module = pepper::PluginModule::CreateModule(path);
diff --git a/chrome/common/pepper_plugin_registry.h b/chrome/common/pepper_plugin_registry.h
index 9949ed4..940a1ba 100644
--- a/chrome/common/pepper_plugin_registry.h
+++ b/chrome/common/pepper_plugin_registry.h
@@ -7,12 +7,11 @@
#include <string>
#include <map>
-#include <vector>
#include "webkit/glue/plugins/pepper_plugin_module.h"
struct PepperPluginInfo {
- FilePath path; // Internal plugins are of the form "internal-[name]".
+ FilePath path;
std::vector<std::string> mime_types;
};
@@ -29,14 +28,6 @@ class PepperPluginRegistry {
pepper::PluginModule* GetModule(const FilePath& path) const;
private:
- static void GetPluginInfoFromSwitch(std::vector<PepperPluginInfo>* plugins);
-
- struct InternalPluginInfo : public PepperPluginInfo {
- pepper::PluginModule::EntryPoints entry_points;
- };
- typedef std::vector<InternalPluginInfo> InternalPluginInfoList;
- static void GetInternalPluginInfo(InternalPluginInfoList* plugin_info);
-
PepperPluginRegistry();
typedef scoped_refptr<pepper::PluginModule> ModuleHandle;