diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 19:47:12 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 19:47:12 +0000 |
commit | 1cc76f5295c82e141a76b139ad8e0e0019ac8c40 (patch) | |
tree | ff2e8a7eadd503bbf54ff088cd98129d415f0703 /webkit | |
parent | 23b7ec676e36ff858b11997bb70d262b315c5010 (diff) | |
download | chromium_src-1cc76f5295c82e141a76b139ad8e0e0019ac8c40.zip chromium_src-1cc76f5295c82e141a76b139ad8e0e0019ac8c40.tar.gz chromium_src-1cc76f5295c82e141a76b139ad8e0e0019ac8c40.tar.bz2 |
Disable checking group policy for plugins on startup since we shouldn't load the plugins on the UI/IO thread. Add a way for PluginList to indirectly ensure it doesn't load the plugins on the wrong thread.
BUG=57425
Review URL: http://codereview.chromium.org/3599004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/plugins/plugin_list.cc | 10 | ||||
-rw-r--r-- | webkit/glue/plugins/plugin_list.h | 5 |
2 files changed, 15 insertions, 0 deletions
diff --git a/webkit/glue/plugins/plugin_list.cc b/webkit/glue/plugins/plugin_list.cc index b2a7634..2f71d43 100644 --- a/webkit/glue/plugins/plugin_list.cc +++ b/webkit/glue/plugins/plugin_list.cc @@ -23,12 +23,19 @@ namespace NPAPI { base::LazyInstance<PluginList> g_singleton(base::LINKER_INITIALIZED); +static LoadPluginsFromDiskHookFunc g_load_plugins_hook; + // static PluginList* PluginList::Singleton() { return g_singleton.Pointer(); } // static +void PluginList::SetPluginLoadHook(LoadPluginsFromDiskHookFunc hook) { + g_load_plugins_hook = hook; +} + +// static bool PluginList::DebugPluginLoading() { return CommandLine::ForCurrentProcess()->HasSwitch( switches::kDebugPluginLoading); @@ -177,6 +184,9 @@ void PluginList::LoadPlugins(bool refresh) { internal_plugins = internal_plugins_; } + if (g_load_plugins_hook) + g_load_plugins_hook(); + std::vector<WebPluginInfo> new_plugins; std::set<FilePath> visited_plugins; diff --git a/webkit/glue/plugins/plugin_list.h b/webkit/glue/plugins/plugin_list.h index ce9da28..36d8941 100644 --- a/webkit/glue/plugins/plugin_list.h +++ b/webkit/glue/plugins/plugin_list.h @@ -60,6 +60,8 @@ struct PluginVersionInfo { PluginEntryPoints entry_points; }; +typedef void (*LoadPluginsFromDiskHookFunc)(); + // The PluginList is responsible for loading our NPAPI based plugins. It does // so in whatever manner is appropriate for the platform. On Windows, it loads // plugins from a known directory by looking for DLLs which start with "NP", @@ -73,6 +75,9 @@ class PluginList { // Gets the one instance of the PluginList. static PluginList* Singleton(); + // Set a hook that is called whenever we load plugins from the disk. + static void SetPluginLoadHook(LoadPluginsFromDiskHookFunc hook); + // Returns true if we're in debug-plugin-loading mode. This is controlled // by a command line switch. static bool DebugPluginLoading(); |