diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-17 19:43:11 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-17 19:43:11 +0000 |
commit | fe85fdf708e4485350e8d401c2e64f4caec3c5c4 (patch) | |
tree | 76106a3083fdee8d2414be67433fe357b80775ca /webkit | |
parent | 477675fedc5411d3d45a3364a767645e20e83e2e (diff) | |
download | chromium_src-fe85fdf708e4485350e8d401c2e64f4caec3c5c4.zip chromium_src-fe85fdf708e4485350e8d401c2e64f4caec3c5c4.tar.gz chromium_src-fe85fdf708e4485350e8d401c2e64f4caec3c5c4.tar.bz2 |
A few small simplifications to PluginList before moving it to content. Also remove two unused includes of plugin_list from chrome.
This is in preparation for moving webkit/plugins to content/.
BUG=237249
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/19577009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212111 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/plugins/npapi/plugin_list.cc | 20 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_list.h | 14 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_list_mac.mm | 3 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_list_posix.cc | 3 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_list_win.cc | 10 | ||||
-rw-r--r-- | webkit/plugins/plugin_switches.cc | 6 | ||||
-rw-r--r-- | webkit/plugins/plugin_switches.h | 4 |
7 files changed, 2 insertions, 58 deletions
diff --git a/webkit/plugins/npapi/plugin_list.cc b/webkit/plugins/npapi/plugin_list.cc index 9355135..71c5ef2 100644 --- a/webkit/plugins/npapi/plugin_list.cc +++ b/webkit/plugins/npapi/plugin_list.cc @@ -25,12 +25,10 @@ namespace { using webkit::npapi::PluginList; -typedef PluginList::CustomLazyInstanceTraits CustomLazyInstanceTraits; const char kApplicationOctetStream[] = "application/octet-stream"; -base::LazyInstance<PluginList, CustomLazyInstanceTraits> g_singleton = - LAZY_INSTANCE_INITIALIZER; +base::LazyInstance<PluginList> g_singleton = LAZY_INSTANCE_INITIALIZER; bool AllowMimeTypeMismatch(const std::string& orig_mime_type, const std::string& actual_mime_type) { @@ -58,16 +56,6 @@ bool AllowMimeTypeMismatch(const std::string& orig_mime_type, namespace webkit { namespace npapi { -struct PluginList::CustomLazyInstanceTraits - : base::DefaultLazyInstanceTraits<PluginList> { - static PluginList* New(void* instance) { - PluginList* plugin_list = - base::DefaultLazyInstanceTraits<PluginList>::New(instance); - plugin_list->PlatformInit(); - return plugin_list; - } -}; - // static PluginList* PluginList::Singleton() { return g_singleton.Pointer(); @@ -237,11 +225,7 @@ bool PluginList::ParseMimeTypes( } PluginList::PluginList() - : -#if defined(OS_WIN) - dont_load_new_wmp_(false), -#endif - loading_state_(LOADING_STATE_NEEDS_REFRESH), + : loading_state_(LOADING_STATE_NEEDS_REFRESH), plugins_discovery_disabled_(false) { } diff --git a/webkit/plugins/npapi/plugin_list.h b/webkit/plugins/npapi/plugin_list.h index 71414b5..73bca62 100644 --- a/webkit/plugins/npapi/plugin_list.h +++ b/webkit/plugins/npapi/plugin_list.h @@ -48,9 +48,6 @@ struct PluginEntryPoints { // This object is thread safe. class PluginList { public: - // Custom traits that performs platform-dependent initialization - // when the instance is created. - struct CustomLazyInstanceTraits; // Gets the one instance of the PluginList. static PluginList* Singleton(); @@ -239,22 +236,11 @@ class PluginList { bool SupportsExtension(const webkit::WebPluginInfo& plugin, const std::string& extension, std::string* actual_mime_type); - - // - // Platform functions - // - - // Do any initialization. - void PlatformInit(); - // // Command-line switches // #if defined(OS_WIN) - // true if we shouldn't load the new WMP plugin. - bool dont_load_new_wmp_; - // Gets plugin paths registered under HKCU\Software\MozillaPlugins and // HKLM\Software\MozillaPlugins. void GetPluginPathsFromRegistry(std::vector<base::FilePath>* plugins); diff --git a/webkit/plugins/npapi/plugin_list_mac.mm b/webkit/plugins/npapi/plugin_list_mac.mm index f55dd41..239be95 100644 --- a/webkit/plugins/npapi/plugin_list_mac.mm +++ b/webkit/plugins/npapi/plugin_list_mac.mm @@ -184,9 +184,6 @@ bool ReadPlistPluginInfo(const base::FilePath& filename, CFBundleRef bundle, } // namespace -void PluginList::PlatformInit() { -} - bool PluginList::ReadWebPluginInfo(const base::FilePath &filename, WebPluginInfo* info) { // There are three ways to get information about plugin capabilities: diff --git a/webkit/plugins/npapi/plugin_list_posix.cc b/webkit/plugins/npapi/plugin_list_posix.cc index b5a50ec..f73e9850 100644 --- a/webkit/plugins/npapi/plugin_list_posix.cc +++ b/webkit/plugins/npapi/plugin_list_posix.cc @@ -263,9 +263,6 @@ void UnwrapNSPluginWrapper(void **dl, base::FilePath* unwrapped_path) { } // namespace -void PluginList::PlatformInit() { -} - bool PluginList::ReadWebPluginInfo(const base::FilePath& filename, WebPluginInfo* info) { // The file to reference is: diff --git a/webkit/plugins/npapi/plugin_list_win.cc b/webkit/plugins/npapi/plugin_list_win.cc index fb8b752..242ba9b 100644 --- a/webkit/plugins/npapi/plugin_list_win.cc +++ b/webkit/plugins/npapi/plugin_list_win.cc @@ -7,7 +7,6 @@ #include <set> #include "base/basictypes.h" -#include "base/command_line.h" #include "base/file_util.h" #include "base/file_version_info.h" #include "base/file_version_info_win.h" @@ -22,7 +21,6 @@ #include "base/win/scoped_handle.h" #include "base/win/windows_version.h" #include "webkit/plugins/npapi/plugin_constants_win.h" -#include "webkit/plugins/plugin_switches.h" namespace { @@ -262,11 +260,6 @@ bool IsNewerVersion(const base::string16& a, const base::string16& b) { namespace webkit { namespace npapi { -void PluginList::PlatformInit() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - dont_load_new_wmp_ = command_line.HasSwitch(switches::kUseOldWMPPlugin); -} - bool PluginList::ReadWebPluginInfo(const base::FilePath& filename, webkit::WebPluginInfo* info) { // On windows, the way we get the mime types for the library is @@ -445,9 +438,6 @@ bool PluginList::ShouldLoadPluginUsingPluginList( // Special WMP handling: // If both the new and old WMP plugins exist, only load the new one. if (filename == kNewWMPPlugin) { - if (dont_load_new_wmp_) - return false; - for (size_t j = 0; j < plugins->size(); ++j) { if ((*plugins)[j].path.BaseName().value() == kOldWMPPlugin) { plugins->erase(plugins->begin() + j); diff --git a/webkit/plugins/plugin_switches.cc b/webkit/plugins/plugin_switches.cc index bb1b3b4..563b844 100644 --- a/webkit/plugins/plugin_switches.cc +++ b/webkit/plugins/plugin_switches.cc @@ -15,10 +15,4 @@ const char kDisablePepper3d[] = "disable-pepper-3d"; // "Command-line" arguments for the PPAPI Flash; used for debugging options. const char kPpapiFlashArgs[] = "ppapi-flash-args"; -#if defined(OS_WIN) -// Used by the plugins_test when testing the older WMP plugin to force the new -// plugin to not get loaded. -extern const char kUseOldWMPPlugin[] = "use-old-wmp"; -#endif - } // namespace switches diff --git a/webkit/plugins/plugin_switches.h b/webkit/plugins/plugin_switches.h index cba11ae..6ba76cd 100644 --- a/webkit/plugins/plugin_switches.h +++ b/webkit/plugins/plugin_switches.h @@ -13,10 +13,6 @@ extern const char kDebugPluginLoading[]; extern const char kDisablePepper3d[]; extern const char kPpapiFlashArgs[]; -#if defined(OS_WIN) -extern const char kUseOldWMPPlugin[]; -#endif - } // namespace switches #endif // WEBKIT_PLUGINS_PLUGIN_SWITCHES_H_ |