[email protected] | 3b48dbc | 2012-01-06 16:34:17 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 4 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 5 | #include "content/browser/plugin_service_impl.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 6 | |
[email protected] | d33e7cc | 2011-09-23 01:43:56 | [diff] [blame] | 7 | #include "base/bind.h" |
[email protected] | d48f1e0c | 2009-02-12 20:57:54 | [diff] [blame] | 8 | #include "base/command_line.h" |
[email protected] | 7b3ee8b | 2011-04-01 18:48:19 | [diff] [blame] | 9 | #include "base/compiler_specific.h" |
[email protected] | 5799981 | 2013-02-24 05:40:52 | [diff] [blame] | 10 | #include "base/files/file_path.h" |
[email protected] | d33e7cc | 2011-09-23 01:43:56 | [diff] [blame] | 11 | #include "base/message_loop.h" |
[email protected] | 7ccb707 | 2013-06-10 20:56:28 | [diff] [blame] | 12 | #include "base/message_loop/message_loop_proxy.h" |
[email protected] | fd8d8d6c | 2013-02-28 02:48:33 | [diff] [blame] | 13 | #include "base/metrics/histogram.h" |
[email protected] | 9c49ff0 | 2010-01-27 01:20:55 | [diff] [blame] | 14 | #include "base/path_service.h" |
[email protected] | 348fbaac | 2013-06-11 06:31:51 | [diff] [blame^] | 15 | #include "base/strings/string_util.h" |
[email protected] | 74ebfb1 | 2013-06-07 20:48:00 | [diff] [blame] | 16 | #include "base/strings/utf_string_conversions.h" |
[email protected] | 7f070d4 | 2011-03-09 20:25:32 | [diff] [blame] | 17 | #include "base/synchronization/waitable_event.h" |
[email protected] | 34b9963 | 2011-01-01 01:01:06 | [diff] [blame] | 18 | #include "base/threading/thread.h" |
[email protected] | a01efd2 | 2011-03-01 00:38:32 | [diff] [blame] | 19 | #include "content/browser/ppapi_plugin_process_host.h" |
[email protected] | f3b1a08 | 2011-11-18 00:34:30 | [diff] [blame] | 20 | #include "content/browser/renderer_host/render_process_host_impl.h" |
[email protected] | b3c41c0b | 2012-03-06 15:48:32 | [diff] [blame] | 21 | #include "content/browser/renderer_host/render_view_host_impl.h" |
[email protected] | cebc3dc | 2011-04-18 17:15:00 | [diff] [blame] | 22 | #include "content/common/pepper_plugin_registry.h" |
[email protected] | 38b59290 | 2011-04-16 02:08:42 | [diff] [blame] | 23 | #include "content/common/view_messages.h" |
[email protected] | c38831a1 | 2011-10-28 12:44:49 | [diff] [blame] | 24 | #include "content/public/browser/browser_thread.h" |
[email protected] | 87f3c08 | 2011-10-19 18:07:44 | [diff] [blame] | 25 | #include "content/public/browser/content_browser_client.h" |
[email protected] | 31f376c | 2012-03-13 16:43:09 | [diff] [blame] | 26 | #include "content/public/browser/plugin_service_filter.h" |
[email protected] | ce96786 | 2012-02-09 22:47:05 | [diff] [blame] | 27 | #include "content/public/browser/resource_context.h" |
[email protected] | c08950d2 | 2011-10-13 22:20:29 | [diff] [blame] | 28 | #include "content/public/common/content_switches.h" |
[email protected] | bd5d6cf | 2011-12-01 00:39:12 | [diff] [blame] | 29 | #include "content/public/common/process_type.h" |
[email protected] | 191eb3f7 | 2010-12-21 06:27:50 | [diff] [blame] | 30 | #include "webkit/plugins/npapi/plugin_list.h" |
[email protected] | 1b51720 | 2012-12-19 17:16:10 | [diff] [blame] | 31 | #include "webkit/plugins/npapi/plugin_utils.h" |
[email protected] | fd8d8d6c | 2013-02-28 02:48:33 | [diff] [blame] | 32 | #include "webkit/plugins/plugin_constants.h" |
[email protected] | 91d9f3d | 2011-08-14 05:24:44 | [diff] [blame] | 33 | #include "webkit/plugins/webplugininfo.h" |
[email protected] | 191eb3f7 | 2010-12-21 06:27:50 | [diff] [blame] | 34 | |
[email protected] | 3b91edbe | 2012-09-27 22:49:23 | [diff] [blame] | 35 | #if defined(OS_WIN) |
| 36 | #include "webkit/plugins/npapi/plugin_constants_win.h" |
| 37 | #endif |
| 38 | |
| 39 | #if defined(OS_POSIX) |
| 40 | #include "content/browser/plugin_loader_posix.h" |
| 41 | #endif |
| 42 | |
[email protected] | 52348b2 | 2012-11-07 10:19:34 | [diff] [blame] | 43 | #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) |
[email protected] | 6665571f | 2013-01-15 07:59:52 | [diff] [blame] | 44 | using ::base::FilePathWatcher; |
[email protected] | 493c800 | 2011-04-14 16:56:01 | [diff] [blame] | 45 | #endif |
| 46 | |
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 47 | namespace content { |
[email protected] | d33e7cc | 2011-09-23 01:43:56 | [diff] [blame] | 48 | namespace { |
| 49 | |
[email protected] | fd8d8d6c | 2013-02-28 02:48:33 | [diff] [blame] | 50 | // This enum is used to collect Flash usage data. |
| 51 | enum FlashUsage { |
| 52 | // Number of browser processes that have started at least one NPAPI Flash |
| 53 | // process during their lifetime. |
| 54 | START_NPAPI_FLASH_AT_LEAST_ONCE, |
| 55 | // Number of browser processes that have started at least one PPAPI Flash |
| 56 | // process during their lifetime. |
| 57 | START_PPAPI_FLASH_AT_LEAST_ONCE, |
| 58 | // Total number of browser processes. |
| 59 | TOTAL_BROWSER_PROCESSES, |
| 60 | FLASH_USAGE_ENUM_COUNT |
| 61 | }; |
| 62 | |
[email protected] | 1b51720 | 2012-12-19 17:16:10 | [diff] [blame] | 63 | bool LoadPluginListInProcess() { |
| 64 | #if defined(OS_WIN) |
| 65 | return true; |
| 66 | #else |
| 67 | // If on POSIX, we don't want to load the list of NPAPI plugins in-process as |
| 68 | // that causes instability. |
| 69 | return !webkit::npapi::NPAPIPluginsSupported(); |
| 70 | #endif |
| 71 | } |
| 72 | |
[email protected] | 4912595 | 2011-09-27 18:05:15 | [diff] [blame] | 73 | // Callback set on the PluginList to assert that plugin loading happens on the |
| 74 | // correct thread. |
[email protected] | 1b51720 | 2012-12-19 17:16:10 | [diff] [blame] | 75 | void WillLoadPluginsCallback( |
[email protected] | a33fa9d | 2012-05-16 14:47:49 | [diff] [blame] | 76 | base::SequencedWorkerPool::SequenceToken token) { |
[email protected] | 1b51720 | 2012-12-19 17:16:10 | [diff] [blame] | 77 | if (LoadPluginListInProcess()) { |
| 78 | CHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread( |
| 79 | token)); |
| 80 | } else { |
| 81 | CHECK(false) << "Plugin loading should happen out-of-process."; |
| 82 | } |
[email protected] | a7991225 | 2012-05-16 11:52:19 | [diff] [blame] | 83 | } |
[email protected] | d33e7cc | 2011-09-23 01:43:56 | [diff] [blame] | 84 | |
[email protected] | a96ec6a | 2009-11-04 17:27:08 | [diff] [blame] | 85 | #if defined(OS_MACOSX) |
[email protected] | 07b71c8 | 2013-01-08 19:07:31 | [diff] [blame] | 86 | void NotifyPluginsOfActivation() { |
[email protected] | f8b3ef8 | 2010-10-11 02:45:52 | [diff] [blame] | 87 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
[email protected] | a96ec6a | 2009-11-04 17:27:08 | [diff] [blame] | 88 | |
[email protected] | 4967f79 | 2012-01-20 22:14:40 | [diff] [blame] | 89 | for (PluginProcessHostIterator iter; !iter.Done(); ++iter) |
| 90 | iter->OnAppActivation(); |
[email protected] | a96ec6a | 2009-11-04 17:27:08 | [diff] [blame] | 91 | } |
[email protected] | 3b48dbc | 2012-01-06 16:34:17 | [diff] [blame] | 92 | #endif |
[email protected] | 45a22e6 | 2011-10-12 09:48:02 | [diff] [blame] | 93 | |
[email protected] | 07b71c8 | 2013-01-08 19:07:31 | [diff] [blame] | 94 | #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 95 | void NotifyPluginDirChanged(const base::FilePath& path, bool error) { |
[email protected] | 07b71c8 | 2013-01-08 19:07:31 | [diff] [blame] | 96 | if (error) { |
[email protected] | 634d23d | 2011-01-19 10:38:19 | [diff] [blame] | 97 | // TODO(pastarmovj): Add some sensible error handling. Maybe silently |
| 98 | // stopping the watcher would be enough. Or possibly restart it. |
| 99 | NOTREACHED(); |
[email protected] | 07b71c8 | 2013-01-08 19:07:31 | [diff] [blame] | 100 | return; |
[email protected] | 634d23d | 2011-01-19 10:38:19 | [diff] [blame] | 101 | } |
[email protected] | 07b71c8 | 2013-01-08 19:07:31 | [diff] [blame] | 102 | VLOG(1) << "Watched path changed: " << path.value(); |
| 103 | // Make the plugin list update itself |
| 104 | webkit::npapi::PluginList::Singleton()->RefreshPlugins(); |
| 105 | BrowserThread::PostTask( |
| 106 | BrowserThread::UI, FROM_HERE, |
| 107 | base::Bind(&PluginService::PurgePluginListCache, |
| 108 | static_cast<BrowserContext*>(NULL), false)); |
| 109 | } |
[email protected] | 634d23d | 2011-01-19 10:38:19 | [diff] [blame] | 110 | #endif |
| 111 | |
[email protected] | 07b71c8 | 2013-01-08 19:07:31 | [diff] [blame] | 112 | } // namespace |
| 113 | |
[email protected] | 3a5180ae | 2011-12-21 02:39:38 | [diff] [blame] | 114 | // static |
| 115 | PluginService* PluginService::GetInstance() { |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 116 | return PluginServiceImpl::GetInstance(); |
[email protected] | 3a5180ae | 2011-12-21 02:39:38 | [diff] [blame] | 117 | } |
| 118 | |
| 119 | void PluginService::PurgePluginListCache(BrowserContext* browser_context, |
| 120 | bool reload_pages) { |
| 121 | for (RenderProcessHost::iterator it = RenderProcessHost::AllHostsIterator(); |
| 122 | !it.IsAtEnd(); it.Advance()) { |
| 123 | RenderProcessHost* host = it.GetCurrentValue(); |
| 124 | if (!browser_context || host->GetBrowserContext() == browser_context) |
| 125 | host->Send(new ViewMsg_PurgePluginListCache(reload_pages)); |
| 126 | } |
| 127 | } |
| 128 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 129 | // static |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 130 | PluginServiceImpl* PluginServiceImpl::GetInstance() { |
| 131 | return Singleton<PluginServiceImpl>::get(); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 132 | } |
| 133 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 134 | PluginServiceImpl::PluginServiceImpl() |
[email protected] | 9990736 | 2012-01-11 05:41:40 | [diff] [blame] | 135 | : plugin_list_(NULL), filter_(NULL) { |
[email protected] | fd8d8d6c | 2013-02-28 02:48:33 | [diff] [blame] | 136 | // Collect the total number of browser processes (which create |
| 137 | // PluginServiceImpl objects, to be precise). The number is used to normalize |
| 138 | // the number of processes which start at least one NPAPI/PPAPI Flash process. |
| 139 | static bool counted = false; |
| 140 | if (!counted) { |
| 141 | counted = true; |
| 142 | UMA_HISTOGRAM_ENUMERATION("Plugin.FlashUsage", TOTAL_BROWSER_PROCESSES, |
| 143 | FLASH_USAGE_ENUM_COUNT); |
| 144 | } |
[email protected] | ee06617 | 2011-11-10 23:20:05 | [diff] [blame] | 145 | } |
| 146 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 147 | PluginServiceImpl::~PluginServiceImpl() { |
[email protected] | ee06617 | 2011-11-10 23:20:05 | [diff] [blame] | 148 | #if defined(OS_WIN) |
| 149 | // Release the events since they're owned by RegKey, not WaitableEvent. |
| 150 | hkcu_watcher_.StopWatching(); |
| 151 | hklm_watcher_.StopWatching(); |
[email protected] | 59383c78 | 2013-04-17 16:43:27 | [diff] [blame] | 152 | if (hkcu_event_) |
[email protected] | ee06617 | 2011-11-10 23:20:05 | [diff] [blame] | 153 | hkcu_event_->Release(); |
[email protected] | 59383c78 | 2013-04-17 16:43:27 | [diff] [blame] | 154 | if (hklm_event_) |
[email protected] | ee06617 | 2011-11-10 23:20:05 | [diff] [blame] | 155 | hklm_event_->Release(); |
| 156 | #endif |
| 157 | // Make sure no plugin channel requests have been leaked. |
| 158 | DCHECK(pending_plugin_clients_.empty()); |
| 159 | } |
| 160 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 161 | void PluginServiceImpl::Init() { |
[email protected] | ee06617 | 2011-11-10 23:20:05 | [diff] [blame] | 162 | if (!plugin_list_) |
| 163 | plugin_list_ = webkit::npapi::PluginList::Singleton(); |
| 164 | |
[email protected] | a33fa9d | 2012-05-16 14:47:49 | [diff] [blame] | 165 | plugin_list_token_ = BrowserThread::GetBlockingPool()->GetSequenceToken(); |
[email protected] | 3a5180ae | 2011-12-21 02:39:38 | [diff] [blame] | 166 | plugin_list_->set_will_load_plugins_callback( |
[email protected] | 1b51720 | 2012-12-19 17:16:10 | [diff] [blame] | 167 | base::Bind(&WillLoadPluginsCallback, plugin_list_token_)); |
[email protected] | 4912595 | 2011-09-27 18:05:15 | [diff] [blame] | 168 | |
[email protected] | 4e0616e | 2010-05-28 14:55:53 | [diff] [blame] | 169 | RegisterPepperPlugins(); |
| 170 | |
[email protected] | 0f7d449e | 2013-01-23 15:12:35 | [diff] [blame] | 171 | // The --site-per-process flag enables an out-of-process iframes |
| 172 | // prototype, which uses WebView for rendering. We need to register the MIME |
| 173 | // type we use with the plugin, so the renderer can instantiate it. |
| 174 | const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 175 | if (command_line->HasSwitch(switches::kSitePerProcess)) { |
| 176 | webkit::WebPluginInfo webview_plugin( |
| 177 | ASCIIToUTF16("WebView Tag"), |
[email protected] | 007b3f8 | 2013-04-09 08:46:45 | [diff] [blame] | 178 | base::FilePath(), |
[email protected] | 0f7d449e | 2013-01-23 15:12:35 | [diff] [blame] | 179 | ASCIIToUTF16("1.2.3.4"), |
| 180 | ASCIIToUTF16("Browser Plugin.")); |
| 181 | webview_plugin.type = webkit::WebPluginInfo::PLUGIN_TYPE_NPAPI; |
| 182 | webkit::WebPluginMimeType webview_plugin_mime_type; |
| 183 | webview_plugin_mime_type.mime_type = "application/browser-plugin"; |
| 184 | webview_plugin_mime_type.file_extensions.push_back("*"); |
| 185 | webview_plugin.mime_types.push_back(webview_plugin_mime_type); |
| 186 | RegisterInternalPlugin(webview_plugin, true); |
| 187 | } |
| 188 | |
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 189 | GetContentClient()->AddNPAPIPlugins(plugin_list_); |
[email protected] | f520b5b | 2011-11-08 02:42:14 | [diff] [blame] | 190 | |
[email protected] | 9a1c426 | 2010-06-29 21:50:27 | [diff] [blame] | 191 | // Load any specified on the command line as well. |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 192 | base::FilePath path = |
| 193 | command_line->GetSwitchValuePath(switches::kLoadPlugin); |
[email protected] | 7bf795d9 | 2010-05-22 00:14:28 | [diff] [blame] | 194 | if (!path.empty()) |
[email protected] | f520b5b | 2011-11-08 02:42:14 | [diff] [blame] | 195 | AddExtraPluginPath(path); |
[email protected] | 9a1c426 | 2010-06-29 21:50:27 | [diff] [blame] | 196 | path = command_line->GetSwitchValuePath(switches::kExtraPluginDir); |
| 197 | if (!path.empty()) |
[email protected] | 3a5180ae | 2011-12-21 02:39:38 | [diff] [blame] | 198 | plugin_list_->AddExtraPluginDir(path); |
[email protected] | dfba876 | 2011-09-02 12:49:54 | [diff] [blame] | 199 | } |
| 200 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 201 | void PluginServiceImpl::StartWatchingPlugins() { |
[email protected] | 634d23d | 2011-01-19 10:38:19 | [diff] [blame] | 202 | // Start watching for changes in the plugin list. This means watching |
| 203 | // for changes in the Windows registry keys and on both Windows and POSIX |
| 204 | // watch for changes in the paths that are expected to contain plugins. |
[email protected] | b547fd4 | 2009-04-23 23:16:27 | [diff] [blame] | 205 | #if defined(OS_WIN) |
[email protected] | 86ec4f6e | 2011-04-20 16:21:19 | [diff] [blame] | 206 | if (hkcu_key_.Create(HKEY_CURRENT_USER, |
| 207 | webkit::npapi::kRegistryMozillaPlugins, |
| 208 | KEY_NOTIFY) == ERROR_SUCCESS) { |
| 209 | if (hkcu_key_.StartWatching() == ERROR_SUCCESS) { |
| 210 | hkcu_event_.reset(new base::WaitableEvent(hkcu_key_.watch_event())); |
[email protected] | 329be05 | 2013-02-04 18:14:28 | [diff] [blame] | 211 | base::WaitableEventWatcher::EventCallback callback = |
| 212 | base::Bind(&PluginServiceImpl::OnWaitableEventSignaled, |
| 213 | base::Unretained(this)); |
| 214 | hkcu_watcher_.StartWatching(hkcu_event_.get(), callback); |
[email protected] | 86ec4f6e | 2011-04-20 16:21:19 | [diff] [blame] | 215 | } |
[email protected] | b547fd4 | 2009-04-23 23:16:27 | [diff] [blame] | 216 | } |
[email protected] | 86ec4f6e | 2011-04-20 16:21:19 | [diff] [blame] | 217 | if (hklm_key_.Create(HKEY_LOCAL_MACHINE, |
| 218 | webkit::npapi::kRegistryMozillaPlugins, |
| 219 | KEY_NOTIFY) == ERROR_SUCCESS) { |
| 220 | if (hklm_key_.StartWatching() == ERROR_SUCCESS) { |
| 221 | hklm_event_.reset(new base::WaitableEvent(hklm_key_.watch_event())); |
[email protected] | 329be05 | 2013-02-04 18:14:28 | [diff] [blame] | 222 | base::WaitableEventWatcher::EventCallback callback = |
| 223 | base::Bind(&PluginServiceImpl::OnWaitableEventSignaled, |
| 224 | base::Unretained(this)); |
| 225 | hklm_watcher_.StartWatching(hklm_event_.get(), callback); |
[email protected] | 86ec4f6e | 2011-04-20 16:21:19 | [diff] [blame] | 226 | } |
[email protected] | b547fd4 | 2009-04-23 23:16:27 | [diff] [blame] | 227 | } |
[email protected] | a33fa9d | 2012-05-16 14:47:49 | [diff] [blame] | 228 | #endif |
[email protected] | 52348b2 | 2012-11-07 10:19:34 | [diff] [blame] | 229 | #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) |
[email protected] | 634d23d | 2011-01-19 10:38:19 | [diff] [blame] | 230 | // On ChromeOS the user can't install plugins anyway and on Windows all |
| 231 | // important plugins register themselves in the registry so no need to do that. |
[email protected] | 07b71c8 | 2013-01-08 19:07:31 | [diff] [blame] | 232 | |
[email protected] | 634d23d | 2011-01-19 10:38:19 | [diff] [blame] | 233 | // Get the list of all paths for registering the FilePathWatchers |
| 234 | // that will track and if needed reload the list of plugins on runtime. |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 235 | std::vector<base::FilePath> plugin_dirs; |
[email protected] | 3a5180ae | 2011-12-21 02:39:38 | [diff] [blame] | 236 | plugin_list_->GetPluginDirectories(&plugin_dirs); |
[email protected] | 894bb50 | 2009-05-21 22:39:57 | [diff] [blame] | 237 | |
[email protected] | 634d23d | 2011-01-19 10:38:19 | [diff] [blame] | 238 | for (size_t i = 0; i < plugin_dirs.size(); ++i) { |
[email protected] | 634d23d | 2011-01-19 10:38:19 | [diff] [blame] | 239 | // FilePathWatcher can not handle non-absolute paths under windows. |
| 240 | // We don't watch for file changes in windows now but if this should ever |
| 241 | // be extended to Windows these lines might save some time of debugging. |
| 242 | #if defined(OS_WIN) |
| 243 | if (!plugin_dirs[i].IsAbsolute()) |
| 244 | continue; |
| 245 | #endif |
[email protected] | 493c800 | 2011-04-14 16:56:01 | [diff] [blame] | 246 | FilePathWatcher* watcher = new FilePathWatcher(); |
[email protected] | 634d23d | 2011-01-19 10:38:19 | [diff] [blame] | 247 | VLOG(1) << "Watching for changes in: " << plugin_dirs[i].value(); |
| 248 | BrowserThread::PostTask( |
| 249 | BrowserThread::FILE, FROM_HERE, |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 250 | base::Bind(&PluginServiceImpl::RegisterFilePathWatcher, watcher, |
[email protected] | 07b71c8 | 2013-01-08 19:07:31 | [diff] [blame] | 251 | plugin_dirs[i])); |
[email protected] | 634d23d | 2011-01-19 10:38:19 | [diff] [blame] | 252 | file_watchers_.push_back(watcher); |
| 253 | } |
| 254 | #endif |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 255 | } |
| 256 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 257 | PluginProcessHost* PluginServiceImpl::FindNpapiPluginProcess( |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 258 | const base::FilePath& plugin_path) { |
[email protected] | 4967f79 | 2012-01-20 22:14:40 | [diff] [blame] | 259 | for (PluginProcessHostIterator iter; !iter.Done(); ++iter) { |
| 260 | if (iter->info().path == plugin_path) |
| 261 | return *iter; |
[email protected] | a436d92 | 2009-02-13 23:16:42 | [diff] [blame] | 262 | } |
| 263 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 264 | return NULL; |
| 265 | } |
| 266 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 267 | PpapiPluginProcessHost* PluginServiceImpl::FindPpapiPluginProcess( |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 268 | const base::FilePath& plugin_path, |
| 269 | const base::FilePath& profile_data_directory) { |
[email protected] | 4967f79 | 2012-01-20 22:14:40 | [diff] [blame] | 270 | for (PpapiPluginProcessHostIterator iter; !iter.Done(); ++iter) { |
[email protected] | dd9a095 | 2012-05-31 20:11:31 | [diff] [blame] | 271 | if (iter->plugin_path() == plugin_path && |
| 272 | iter->profile_data_directory() == profile_data_directory) { |
[email protected] | 4967f79 | 2012-01-20 22:14:40 | [diff] [blame] | 273 | return *iter; |
[email protected] | dd9a095 | 2012-05-31 20:11:31 | [diff] [blame] | 274 | } |
[email protected] | a08ebea | 2011-02-13 17:50:20 | [diff] [blame] | 275 | } |
[email protected] | a08ebea | 2011-02-13 17:50:20 | [diff] [blame] | 276 | return NULL; |
| 277 | } |
| 278 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 279 | PpapiPluginProcessHost* PluginServiceImpl::FindPpapiBrokerProcess( |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 280 | const base::FilePath& broker_path) { |
[email protected] | 4967f79 | 2012-01-20 22:14:40 | [diff] [blame] | 281 | for (PpapiBrokerProcessHostIterator iter; !iter.Done(); ++iter) { |
| 282 | if (iter->plugin_path() == broker_path) |
| 283 | return *iter; |
[email protected] | eb415bf0e | 2011-04-14 02:45:42 | [diff] [blame] | 284 | } |
| 285 | |
| 286 | return NULL; |
| 287 | } |
| 288 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 289 | PluginProcessHost* PluginServiceImpl::FindOrStartNpapiPluginProcess( |
[email protected] | 6be31d20 | 2013-02-01 18:20:54 | [diff] [blame] | 290 | int render_process_id, |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 291 | const base::FilePath& plugin_path) { |
[email protected] | a08ebea | 2011-02-13 17:50:20 | [diff] [blame] | 292 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 293 | |
[email protected] | 6be31d20 | 2013-02-01 18:20:54 | [diff] [blame] | 294 | if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path)) |
| 295 | return NULL; |
| 296 | |
[email protected] | a08ebea | 2011-02-13 17:50:20 | [diff] [blame] | 297 | PluginProcessHost* plugin_host = FindNpapiPluginProcess(plugin_path); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 298 | if (plugin_host) |
| 299 | return plugin_host; |
| 300 | |
[email protected] | 91d9f3d | 2011-08-14 05:24:44 | [diff] [blame] | 301 | webkit::WebPluginInfo info; |
[email protected] | 88ca491 | 2011-10-12 14:00:43 | [diff] [blame] | 302 | if (!GetPluginInfoByPath(plugin_path, &info)) { |
[email protected] | a27a938 | 2009-02-11 23:55:10 | [diff] [blame] | 303 | return NULL; |
| 304 | } |
| 305 | |
[email protected] | fd8d8d6c | 2013-02-28 02:48:33 | [diff] [blame] | 306 | // Record when NPAPI Flash process is started for the first time. |
| 307 | static bool counted = false; |
| 308 | if (!counted && UTF16ToUTF8(info.name) == kFlashPluginName) { |
| 309 | counted = true; |
| 310 | UMA_HISTOGRAM_ENUMERATION("Plugin.FlashUsage", |
| 311 | START_NPAPI_FLASH_AT_LEAST_ONCE, |
| 312 | FLASH_USAGE_ENUM_COUNT); |
| 313 | } |
| 314 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 315 | // This plugin isn't loaded by any plugin process, so create a new process. |
[email protected] | 8b8a554d | 2010-11-18 13:26:40 | [diff] [blame] | 316 | scoped_ptr<PluginProcessHost> new_host(new PluginProcessHost()); |
[email protected] | 9990736 | 2012-01-11 05:41:40 | [diff] [blame] | 317 | if (!new_host->Init(info)) { |
[email protected] | a08ebea | 2011-02-13 17:50:20 | [diff] [blame] | 318 | NOTREACHED(); // Init is not expected to fail. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 319 | return NULL; |
| 320 | } |
[email protected] | 8b8a554d | 2010-11-18 13:26:40 | [diff] [blame] | 321 | return new_host.release(); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 322 | } |
| 323 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 324 | PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiPluginProcess( |
[email protected] | 6be31d20 | 2013-02-01 18:20:54 | [diff] [blame] | 325 | int render_process_id, |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 326 | const base::FilePath& plugin_path, |
| 327 | const base::FilePath& profile_data_directory, |
[email protected] | a50432d | 2011-09-30 16:32:14 | [diff] [blame] | 328 | PpapiPluginProcessHost::PluginClient* client) { |
[email protected] | a08ebea | 2011-02-13 17:50:20 | [diff] [blame] | 329 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 330 | |
[email protected] | 6be31d20 | 2013-02-01 18:20:54 | [diff] [blame] | 331 | if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path)) |
| 332 | return NULL; |
| 333 | |
[email protected] | dd9a095 | 2012-05-31 20:11:31 | [diff] [blame] | 334 | PpapiPluginProcessHost* plugin_host = |
| 335 | FindPpapiPluginProcess(plugin_path, profile_data_directory); |
[email protected] | a08ebea | 2011-02-13 17:50:20 | [diff] [blame] | 336 | if (plugin_host) |
| 337 | return plugin_host; |
| 338 | |
[email protected] | eb415bf0e | 2011-04-14 02:45:42 | [diff] [blame] | 339 | // Validate that the plugin is actually registered. |
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 340 | PepperPluginInfo* info = GetRegisteredPpapiPluginInfo(plugin_path); |
[email protected] | a08ebea | 2011-02-13 17:50:20 | [diff] [blame] | 341 | if (!info) |
| 342 | return NULL; |
| 343 | |
[email protected] | fd8d8d6c | 2013-02-28 02:48:33 | [diff] [blame] | 344 | // Record when PPAPI Flash process is started for the first time. |
| 345 | static bool counted = false; |
| 346 | if (!counted && info->name == kFlashPluginName) { |
| 347 | counted = true; |
| 348 | UMA_HISTOGRAM_ENUMERATION("Plugin.FlashUsage", |
| 349 | START_PPAPI_FLASH_AT_LEAST_ONCE, |
| 350 | FLASH_USAGE_ENUM_COUNT); |
| 351 | } |
| 352 | |
[email protected] | a08ebea | 2011-02-13 17:50:20 | [diff] [blame] | 353 | // This plugin isn't loaded by any plugin process, so create a new process. |
[email protected] | a50432d | 2011-09-30 16:32:14 | [diff] [blame] | 354 | return PpapiPluginProcessHost::CreatePluginHost( |
[email protected] | dd9a095 | 2012-05-31 20:11:31 | [diff] [blame] | 355 | *info, profile_data_directory, |
[email protected] | df02aca | 2012-02-09 21:03:20 | [diff] [blame] | 356 | client->GetResourceContext()->GetHostResolver()); |
[email protected] | a08ebea | 2011-02-13 17:50:20 | [diff] [blame] | 357 | } |
| 358 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 359 | PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiBrokerProcess( |
[email protected] | 6be31d20 | 2013-02-01 18:20:54 | [diff] [blame] | 360 | int render_process_id, |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 361 | const base::FilePath& plugin_path) { |
[email protected] | eb415bf0e | 2011-04-14 02:45:42 | [diff] [blame] | 362 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 363 | |
[email protected] | 6be31d20 | 2013-02-01 18:20:54 | [diff] [blame] | 364 | if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path)) |
| 365 | return NULL; |
| 366 | |
[email protected] | a50432d | 2011-09-30 16:32:14 | [diff] [blame] | 367 | PpapiPluginProcessHost* plugin_host = FindPpapiBrokerProcess(plugin_path); |
[email protected] | eb415bf0e | 2011-04-14 02:45:42 | [diff] [blame] | 368 | if (plugin_host) |
| 369 | return plugin_host; |
| 370 | |
| 371 | // Validate that the plugin is actually registered. |
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 372 | PepperPluginInfo* info = GetRegisteredPpapiPluginInfo(plugin_path); |
[email protected] | eb415bf0e | 2011-04-14 02:45:42 | [diff] [blame] | 373 | if (!info) |
| 374 | return NULL; |
| 375 | |
| 376 | // TODO(ddorwin): Uncomment once out of process is supported. |
| 377 | // DCHECK(info->is_out_of_process); |
| 378 | |
| 379 | // This broker isn't loaded by any broker process, so create a new process. |
[email protected] | a50432d | 2011-09-30 16:32:14 | [diff] [blame] | 380 | return PpapiPluginProcessHost::CreateBrokerHost(*info); |
[email protected] | eb415bf0e | 2011-04-14 02:45:42 | [diff] [blame] | 381 | } |
| 382 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 383 | void PluginServiceImpl::OpenChannelToNpapiPlugin( |
[email protected] | c8f73ab | 2011-01-22 00:05:17 | [diff] [blame] | 384 | int render_process_id, |
| 385 | int render_view_id, |
[email protected] | 610c089 | 2009-09-08 19:46:18 | [diff] [blame] | 386 | const GURL& url, |
[email protected] | dfba876 | 2011-09-02 12:49:54 | [diff] [blame] | 387 | const GURL& page_url, |
[email protected] | 610c089 | 2009-09-08 19:46:18 | [diff] [blame] | 388 | const std::string& mime_type, |
[email protected] | 46b69e4 | 2010-11-02 12:26:39 | [diff] [blame] | 389 | PluginProcessHost::Client* client) { |
[email protected] | 76b70f9 | 2011-11-21 19:31:14 | [diff] [blame] | 390 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
[email protected] | 4befe759 | 2011-09-14 22:49:09 | [diff] [blame] | 391 | DCHECK(!ContainsKey(pending_plugin_clients_, client)); |
| 392 | pending_plugin_clients_.insert(client); |
[email protected] | 88ca491 | 2011-10-12 14:00:43 | [diff] [blame] | 393 | |
| 394 | // Make sure plugins are loaded if necessary. |
[email protected] | 209f2ae | 2012-03-13 01:28:08 | [diff] [blame] | 395 | PluginServiceFilterParams params = { |
[email protected] | 88ca491 | 2011-10-12 14:00:43 | [diff] [blame] | 396 | render_process_id, |
| 397 | render_view_id, |
| 398 | page_url, |
[email protected] | df02aca | 2012-02-09 21:03:20 | [diff] [blame] | 399 | client->GetResourceContext() |
[email protected] | 88ca491 | 2011-10-12 14:00:43 | [diff] [blame] | 400 | }; |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 401 | GetPlugins(base::Bind( |
| 402 | &PluginServiceImpl::ForwardGetAllowedPluginForOpenChannelToPlugin, |
| 403 | base::Unretained(this), params, url, mime_type, client)); |
[email protected] | 6fdd418 | 2010-10-14 23:59:26 | [diff] [blame] | 404 | } |
| 405 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 406 | void PluginServiceImpl::OpenChannelToPpapiPlugin( |
[email protected] | 6be31d20 | 2013-02-01 18:20:54 | [diff] [blame] | 407 | int render_process_id, |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 408 | const base::FilePath& plugin_path, |
| 409 | const base::FilePath& profile_data_directory, |
[email protected] | a50432d | 2011-09-30 16:32:14 | [diff] [blame] | 410 | PpapiPluginProcessHost::PluginClient* client) { |
[email protected] | d259a8e | 2011-05-18 22:31:09 | [diff] [blame] | 411 | PpapiPluginProcessHost* plugin_host = FindOrStartPpapiPluginProcess( |
[email protected] | 6be31d20 | 2013-02-01 18:20:54 | [diff] [blame] | 412 | render_process_id, plugin_path, profile_data_directory, client); |
[email protected] | 1bf0fb2 | 2012-04-12 21:44:16 | [diff] [blame] | 413 | if (plugin_host) { |
[email protected] | a08ebea | 2011-02-13 17:50:20 | [diff] [blame] | 414 | plugin_host->OpenChannelToPlugin(client); |
[email protected] | 1bf0fb2 | 2012-04-12 21:44:16 | [diff] [blame] | 415 | } else { |
| 416 | // Send error. |
[email protected] | 108fd34 | 2013-01-04 20:46:54 | [diff] [blame] | 417 | client->OnPpapiChannelOpened(IPC::ChannelHandle(), base::kNullProcessId, 0); |
[email protected] | 1bf0fb2 | 2012-04-12 21:44:16 | [diff] [blame] | 418 | } |
[email protected] | a08ebea | 2011-02-13 17:50:20 | [diff] [blame] | 419 | } |
| 420 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 421 | void PluginServiceImpl::OpenChannelToPpapiBroker( |
[email protected] | 6be31d20 | 2013-02-01 18:20:54 | [diff] [blame] | 422 | int render_process_id, |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 423 | const base::FilePath& path, |
[email protected] | a50432d | 2011-09-30 16:32:14 | [diff] [blame] | 424 | PpapiPluginProcessHost::BrokerClient* client) { |
[email protected] | 6be31d20 | 2013-02-01 18:20:54 | [diff] [blame] | 425 | PpapiPluginProcessHost* plugin_host = FindOrStartPpapiBrokerProcess( |
| 426 | render_process_id, path); |
[email protected] | 1bf0fb2 | 2012-04-12 21:44:16 | [diff] [blame] | 427 | if (plugin_host) { |
[email protected] | a50432d | 2011-09-30 16:32:14 | [diff] [blame] | 428 | plugin_host->OpenChannelToPlugin(client); |
[email protected] | 1bf0fb2 | 2012-04-12 21:44:16 | [diff] [blame] | 429 | } else { |
| 430 | // Send error. |
[email protected] | 108fd34 | 2013-01-04 20:46:54 | [diff] [blame] | 431 | client->OnPpapiChannelOpened(IPC::ChannelHandle(), base::kNullProcessId, 0); |
[email protected] | 1bf0fb2 | 2012-04-12 21:44:16 | [diff] [blame] | 432 | } |
[email protected] | eb415bf0e | 2011-04-14 02:45:42 | [diff] [blame] | 433 | } |
| 434 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 435 | void PluginServiceImpl::CancelOpenChannelToNpapiPlugin( |
[email protected] | 4befe759 | 2011-09-14 22:49:09 | [diff] [blame] | 436 | PluginProcessHost::Client* client) { |
| 437 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 438 | DCHECK(ContainsKey(pending_plugin_clients_, client)); |
| 439 | pending_plugin_clients_.erase(client); |
| 440 | } |
| 441 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 442 | void PluginServiceImpl::ForwardGetAllowedPluginForOpenChannelToPlugin( |
[email protected] | 209f2ae | 2012-03-13 01:28:08 | [diff] [blame] | 443 | const PluginServiceFilterParams& params, |
[email protected] | 88ca491 | 2011-10-12 14:00:43 | [diff] [blame] | 444 | const GURL& url, |
| 445 | const std::string& mime_type, |
| 446 | PluginProcessHost::Client* client, |
| 447 | const std::vector<webkit::WebPluginInfo>&) { |
| 448 | GetAllowedPluginForOpenChannelToPlugin(params.render_process_id, |
| 449 | params.render_view_id, url, params.page_url, mime_type, client, |
| 450 | params.resource_context); |
| 451 | } |
| 452 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 453 | void PluginServiceImpl::GetAllowedPluginForOpenChannelToPlugin( |
[email protected] | c8f73ab | 2011-01-22 00:05:17 | [diff] [blame] | 454 | int render_process_id, |
| 455 | int render_view_id, |
[email protected] | 6fdd418 | 2010-10-14 23:59:26 | [diff] [blame] | 456 | const GURL& url, |
[email protected] | dfba876 | 2011-09-02 12:49:54 | [diff] [blame] | 457 | const GURL& page_url, |
[email protected] | 6fdd418 | 2010-10-14 23:59:26 | [diff] [blame] | 458 | const std::string& mime_type, |
[email protected] | 87c4be4 | 2011-09-16 01:10:59 | [diff] [blame] | 459 | PluginProcessHost::Client* client, |
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 460 | ResourceContext* resource_context) { |
[email protected] | 91d9f3d | 2011-08-14 05:24:44 | [diff] [blame] | 461 | webkit::WebPluginInfo info; |
[email protected] | dfba876 | 2011-09-02 12:49:54 | [diff] [blame] | 462 | bool allow_wildcard = true; |
[email protected] | 11e1c18 | 2011-05-17 20:26:27 | [diff] [blame] | 463 | bool found = GetPluginInfo( |
[email protected] | df02aca | 2012-02-09 21:03:20 | [diff] [blame] | 464 | render_process_id, render_view_id, resource_context, |
[email protected] | dfba876 | 2011-09-02 12:49:54 | [diff] [blame] | 465 | url, page_url, mime_type, allow_wildcard, |
| 466 | NULL, &info, NULL); |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 467 | base::FilePath plugin_path; |
[email protected] | 6859807 | 2011-07-29 08:21:28 | [diff] [blame] | 468 | if (found) |
[email protected] | dfba876 | 2011-09-02 12:49:54 | [diff] [blame] | 469 | plugin_path = info.path; |
[email protected] | 6fdd418 | 2010-10-14 23:59:26 | [diff] [blame] | 470 | |
| 471 | // Now we jump back to the IO thread to finish opening the channel. |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 472 | BrowserThread::PostTask( |
| 473 | BrowserThread::IO, FROM_HERE, |
| 474 | base::Bind(&PluginServiceImpl::FinishOpenChannelToPlugin, |
[email protected] | 6be31d20 | 2013-02-01 18:20:54 | [diff] [blame] | 475 | base::Unretained(this), |
| 476 | render_process_id, |
| 477 | plugin_path, |
| 478 | client)); |
[email protected] | 6fdd418 | 2010-10-14 23:59:26 | [diff] [blame] | 479 | } |
| 480 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 481 | void PluginServiceImpl::FinishOpenChannelToPlugin( |
[email protected] | 6be31d20 | 2013-02-01 18:20:54 | [diff] [blame] | 482 | int render_process_id, |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 483 | const base::FilePath& plugin_path, |
[email protected] | 46b69e4 | 2010-11-02 12:26:39 | [diff] [blame] | 484 | PluginProcessHost::Client* client) { |
[email protected] | f8b3ef8 | 2010-10-11 02:45:52 | [diff] [blame] | 485 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
[email protected] | 20a793e | 2010-10-12 06:50:08 | [diff] [blame] | 486 | |
[email protected] | 4befe759 | 2011-09-14 22:49:09 | [diff] [blame] | 487 | // Make sure it hasn't been canceled yet. |
| 488 | if (!ContainsKey(pending_plugin_clients_, client)) |
| 489 | return; |
| 490 | pending_plugin_clients_.erase(client); |
| 491 | |
[email protected] | 6be31d20 | 2013-02-01 18:20:54 | [diff] [blame] | 492 | PluginProcessHost* plugin_host = FindOrStartNpapiPluginProcess( |
| 493 | render_process_id, plugin_path); |
[email protected] | 4befe759 | 2011-09-14 22:49:09 | [diff] [blame] | 494 | if (plugin_host) { |
| 495 | client->OnFoundPluginProcessHost(plugin_host); |
[email protected] | 46b69e4 | 2010-11-02 12:26:39 | [diff] [blame] | 496 | plugin_host->OpenChannelToPlugin(client); |
[email protected] | 4befe759 | 2011-09-14 22:49:09 | [diff] [blame] | 497 | } else { |
[email protected] | 46b69e4 | 2010-11-02 12:26:39 | [diff] [blame] | 498 | client->OnError(); |
[email protected] | 4befe759 | 2011-09-14 22:49:09 | [diff] [blame] | 499 | } |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 500 | } |
| 501 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 502 | bool PluginServiceImpl::GetPluginInfoArray( |
[email protected] | 51b63f6 | 2011-10-05 18:55:42 | [diff] [blame] | 503 | const GURL& url, |
| 504 | const std::string& mime_type, |
| 505 | bool allow_wildcard, |
| 506 | std::vector<webkit::WebPluginInfo>* plugins, |
| 507 | std::vector<std::string>* actual_mime_types) { |
| 508 | bool use_stale = false; |
[email protected] | 3a5180ae | 2011-12-21 02:39:38 | [diff] [blame] | 509 | plugin_list_->GetPluginInfoArray(url, mime_type, allow_wildcard, |
| 510 | &use_stale, plugins, actual_mime_types); |
[email protected] | 51b63f6 | 2011-10-05 18:55:42 | [diff] [blame] | 511 | return use_stale; |
| 512 | } |
| 513 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 514 | bool PluginServiceImpl::GetPluginInfo(int render_process_id, |
| 515 | int render_view_id, |
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 516 | ResourceContext* context, |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 517 | const GURL& url, |
| 518 | const GURL& page_url, |
| 519 | const std::string& mime_type, |
| 520 | bool allow_wildcard, |
| 521 | bool* is_stale, |
| 522 | webkit::WebPluginInfo* info, |
| 523 | std::string* actual_mime_type) { |
[email protected] | 91d9f3d | 2011-08-14 05:24:44 | [diff] [blame] | 524 | std::vector<webkit::WebPluginInfo> plugins; |
[email protected] | 6859807 | 2011-07-29 08:21:28 | [diff] [blame] | 525 | std::vector<std::string> mime_types; |
[email protected] | 88ca491 | 2011-10-12 14:00:43 | [diff] [blame] | 526 | bool stale = GetPluginInfoArray( |
| 527 | url, mime_type, allow_wildcard, &plugins, &mime_types); |
| 528 | if (is_stale) |
| 529 | *is_stale = stale; |
[email protected] | dfba876 | 2011-09-02 12:49:54 | [diff] [blame] | 530 | |
[email protected] | 6859807 | 2011-07-29 08:21:28 | [diff] [blame] | 531 | for (size_t i = 0; i < plugins.size(); ++i) { |
[email protected] | 05f51128 | 2013-02-05 15:02:50 | [diff] [blame] | 532 | if (!filter_ || filter_->IsPluginAvailable(render_process_id, |
| 533 | render_view_id, |
| 534 | context, |
| 535 | url, |
| 536 | page_url, |
| 537 | &plugins[i])) { |
[email protected] | 6859807 | 2011-07-29 08:21:28 | [diff] [blame] | 538 | *info = plugins[i]; |
| 539 | if (actual_mime_type) |
| 540 | *actual_mime_type = mime_types[i]; |
| 541 | return true; |
| 542 | } |
| 543 | } |
| 544 | return false; |
[email protected] | 6fdd418 | 2010-10-14 23:59:26 | [diff] [blame] | 545 | } |
| 546 | |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 547 | bool PluginServiceImpl::GetPluginInfoByPath(const base::FilePath& plugin_path, |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 548 | webkit::WebPluginInfo* info) { |
[email protected] | 88ca491 | 2011-10-12 14:00:43 | [diff] [blame] | 549 | std::vector<webkit::WebPluginInfo> plugins; |
[email protected] | 480c7cc | 2012-06-29 17:38:44 | [diff] [blame] | 550 | plugin_list_->GetPluginsNoRefresh(&plugins); |
[email protected] | 88ca491 | 2011-10-12 14:00:43 | [diff] [blame] | 551 | |
| 552 | for (std::vector<webkit::WebPluginInfo>::iterator it = plugins.begin(); |
| 553 | it != plugins.end(); |
| 554 | ++it) { |
| 555 | if (it->path == plugin_path) { |
| 556 | *info = *it; |
| 557 | return true; |
| 558 | } |
| 559 | } |
| 560 | |
| 561 | return false; |
| 562 | } |
| 563 | |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 564 | string16 PluginServiceImpl::GetPluginDisplayNameByPath( |
| 565 | const base::FilePath& path) { |
[email protected] | 8be4584 | 2012-04-13 19:49:29 | [diff] [blame] | 566 | string16 plugin_name = path.LossyDisplayName(); |
| 567 | webkit::WebPluginInfo info; |
| 568 | if (PluginService::GetInstance()->GetPluginInfoByPath(path, &info) && |
| 569 | !info.name.empty()) { |
| 570 | plugin_name = info.name; |
| 571 | #if defined(OS_MACOSX) |
| 572 | // Many plugins on the Mac have .plugin in the actual name, which looks |
| 573 | // terrible, so look for that and strip it off if present. |
| 574 | const std::string kPluginExtension = ".plugin"; |
| 575 | if (EndsWith(plugin_name, ASCIIToUTF16(kPluginExtension), true)) |
| 576 | plugin_name.erase(plugin_name.length() - kPluginExtension.length()); |
| 577 | #endif // OS_MACOSX |
| 578 | } |
| 579 | return plugin_name; |
| 580 | } |
| 581 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 582 | void PluginServiceImpl::GetPlugins(const GetPluginsCallback& callback) { |
[email protected] | 4912595 | 2011-09-27 18:05:15 | [diff] [blame] | 583 | scoped_refptr<base::MessageLoopProxy> target_loop( |
[email protected] | dd32b127 | 2013-05-04 14:17:11 | [diff] [blame] | 584 | base::MessageLoop::current()->message_loop_proxy()); |
[email protected] | 4912595 | 2011-09-27 18:05:15 | [diff] [blame] | 585 | |
[email protected] | 1b51720 | 2012-12-19 17:16:10 | [diff] [blame] | 586 | if (LoadPluginListInProcess()) { |
| 587 | BrowserThread::GetBlockingPool()-> |
| 588 | PostSequencedWorkerTaskWithShutdownBehavior( |
| 589 | plugin_list_token_, |
| 590 | FROM_HERE, |
| 591 | base::Bind(&PluginServiceImpl::GetPluginsInternal, |
| 592 | base::Unretained(this), |
| 593 | target_loop, callback), |
| 594 | base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); |
| 595 | return; |
| 596 | } |
| 597 | #if defined(OS_POSIX) |
[email protected] | 4912595 | 2011-09-27 18:05:15 | [diff] [blame] | 598 | std::vector<webkit::WebPluginInfo> cached_plugins; |
[email protected] | 480c7cc | 2012-06-29 17:38:44 | [diff] [blame] | 599 | if (plugin_list_->GetPluginsNoRefresh(&cached_plugins)) { |
[email protected] | 4912595 | 2011-09-27 18:05:15 | [diff] [blame] | 600 | // Can't assume the caller is reentrant. |
| 601 | target_loop->PostTask(FROM_HERE, |
[email protected] | 00b2543 | 2012-04-07 04:21:37 | [diff] [blame] | 602 | base::Bind(callback, cached_plugins)); |
[email protected] | 4912595 | 2011-09-27 18:05:15 | [diff] [blame] | 603 | } else { |
[email protected] | 4bb85b9 | 2011-11-05 02:53:29 | [diff] [blame] | 604 | // If we switch back to loading plugins in process, then we need to make |
| 605 | // sure g_thread_init() gets called since plugins may call glib at load. |
[email protected] | fc72bb1 | 2013-06-02 21:13:46 | [diff] [blame] | 606 | if (!plugin_loader_.get()) |
[email protected] | d4af1e7 | 2011-10-21 17:45:43 | [diff] [blame] | 607 | plugin_loader_ = new PluginLoaderPosix; |
[email protected] | 4912595 | 2011-09-27 18:05:15 | [diff] [blame] | 608 | BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
[email protected] | d4af1e7 | 2011-10-21 17:45:43 | [diff] [blame] | 609 | base::Bind(&PluginLoaderPosix::LoadPlugins, plugin_loader_, |
| 610 | target_loop, callback)); |
[email protected] | 4912595 | 2011-09-27 18:05:15 | [diff] [blame] | 611 | } |
[email protected] | a33fa9d | 2012-05-16 14:47:49 | [diff] [blame] | 612 | #else |
[email protected] | 1b51720 | 2012-12-19 17:16:10 | [diff] [blame] | 613 | NOTREACHED(); |
[email protected] | 4912595 | 2011-09-27 18:05:15 | [diff] [blame] | 614 | #endif |
[email protected] | d33e7cc | 2011-09-23 01:43:56 | [diff] [blame] | 615 | } |
| 616 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 617 | void PluginServiceImpl::GetPluginsInternal( |
[email protected] | d33e7cc | 2011-09-23 01:43:56 | [diff] [blame] | 618 | base::MessageLoopProxy* target_loop, |
| 619 | const PluginService::GetPluginsCallback& callback) { |
[email protected] | a33fa9d | 2012-05-16 14:47:49 | [diff] [blame] | 620 | DCHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread( |
| 621 | plugin_list_token_)); |
[email protected] | d33e7cc | 2011-09-23 01:43:56 | [diff] [blame] | 622 | |
| 623 | std::vector<webkit::WebPluginInfo> plugins; |
[email protected] | 3a5180ae | 2011-12-21 02:39:38 | [diff] [blame] | 624 | plugin_list_->GetPlugins(&plugins); |
[email protected] | d33e7cc | 2011-09-23 01:43:56 | [diff] [blame] | 625 | |
| 626 | target_loop->PostTask(FROM_HERE, |
[email protected] | 00b2543 | 2012-04-07 04:21:37 | [diff] [blame] | 627 | base::Bind(callback, plugins)); |
[email protected] | dfba876 | 2011-09-02 12:49:54 | [diff] [blame] | 628 | } |
| 629 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 630 | void PluginServiceImpl::OnWaitableEventSignaled( |
[email protected] | 58052263 | 2009-08-17 21:55:55 | [diff] [blame] | 631 | base::WaitableEvent* waitable_event) { |
[email protected] | b547fd4 | 2009-04-23 23:16:27 | [diff] [blame] | 632 | #if defined(OS_WIN) |
[email protected] | 59383c78 | 2013-04-17 16:43:27 | [diff] [blame] | 633 | if (waitable_event == hkcu_event_) { |
[email protected] | b547fd4 | 2009-04-23 23:16:27 | [diff] [blame] | 634 | hkcu_key_.StartWatching(); |
| 635 | } else { |
| 636 | hklm_key_.StartWatching(); |
| 637 | } |
| 638 | |
[email protected] | 3a5180ae | 2011-12-21 02:39:38 | [diff] [blame] | 639 | plugin_list_->RefreshPlugins(); |
[email protected] | 45a22e6 | 2011-10-12 09:48:02 | [diff] [blame] | 640 | PurgePluginListCache(NULL, false); |
[email protected] | 634d23d | 2011-01-19 10:38:19 | [diff] [blame] | 641 | #else |
| 642 | // This event should only get signaled on a Windows machine. |
| 643 | NOTREACHED(); |
[email protected] | 9de09f8 | 2009-08-17 20:13:53 | [diff] [blame] | 644 | #endif // defined(OS_WIN) |
[email protected] | b547fd4 | 2009-04-23 23:16:27 | [diff] [blame] | 645 | } |
[email protected] | 894bb50 | 2009-05-21 22:39:57 | [diff] [blame] | 646 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 647 | void PluginServiceImpl::RegisterPepperPlugins() { |
[email protected] | 84396dbc | 2011-04-14 06:33:42 | [diff] [blame] | 648 | // TODO(abarth): It seems like the PepperPluginRegistry should do this work. |
[email protected] | a08ebea | 2011-02-13 17:50:20 | [diff] [blame] | 649 | PepperPluginRegistry::ComputeList(&ppapi_plugins_); |
| 650 | for (size_t i = 0; i < ppapi_plugins_.size(); ++i) { |
[email protected] | c6f3dea | 2012-01-14 02:23:11 | [diff] [blame] | 651 | RegisterInternalPlugin(ppapi_plugins_[i].ToWebPluginInfo(), true); |
[email protected] | 4e0616e | 2010-05-28 14:55:53 | [diff] [blame] | 652 | } |
| 653 | } |
[email protected] | 634d23d | 2011-01-19 10:38:19 | [diff] [blame] | 654 | |
[email protected] | eb415bf0e | 2011-04-14 02:45:42 | [diff] [blame] | 655 | // There should generally be very few plugins so a brute-force search is fine. |
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 656 | PepperPluginInfo* PluginServiceImpl::GetRegisteredPpapiPluginInfo( |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 657 | const base::FilePath& plugin_path) { |
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 658 | PepperPluginInfo* info = NULL; |
[email protected] | eb415bf0e | 2011-04-14 02:45:42 | [diff] [blame] | 659 | for (size_t i = 0; i < ppapi_plugins_.size(); i++) { |
[email protected] | 6b14feb | 2011-08-16 11:22:56 | [diff] [blame] | 660 | if (ppapi_plugins_[i].path == plugin_path) { |
| 661 | info = &ppapi_plugins_[i]; |
| 662 | break; |
| 663 | } |
[email protected] | eb415bf0e | 2011-04-14 02:45:42 | [diff] [blame] | 664 | } |
[email protected] | 07611759 | 2011-08-17 03:16:41 | [diff] [blame] | 665 | if (info) |
| 666 | return info; |
| 667 | // We did not find the plugin in our list. But wait! the plugin can also |
| 668 | // be a latecomer, as it happens with pepper flash. This information |
| 669 | // can be obtained from the PluginList singleton and we can use it to |
| 670 | // construct it and add it to the list. This same deal needs to be done |
| 671 | // in the renderer side in PepperPluginRegistry. |
| 672 | webkit::WebPluginInfo webplugin_info; |
[email protected] | 88ca491 | 2011-10-12 14:00:43 | [diff] [blame] | 673 | if (!GetPluginInfoByPath(plugin_path, &webplugin_info)) |
[email protected] | 07611759 | 2011-08-17 03:16:41 | [diff] [blame] | 674 | return NULL; |
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 675 | PepperPluginInfo new_pepper_info; |
[email protected] | 07611759 | 2011-08-17 03:16:41 | [diff] [blame] | 676 | if (!MakePepperPluginInfo(webplugin_info, &new_pepper_info)) |
| 677 | return NULL; |
| 678 | ppapi_plugins_.push_back(new_pepper_info); |
| 679 | return &ppapi_plugins_[ppapi_plugins_.size() - 1]; |
[email protected] | eb415bf0e | 2011-04-14 02:45:42 | [diff] [blame] | 680 | } |
| 681 | |
[email protected] | 52348b2 | 2012-11-07 10:19:34 | [diff] [blame] | 682 | #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) |
[email protected] | 634d23d | 2011-01-19 10:38:19 | [diff] [blame] | 683 | // static |
[email protected] | 07b71c8 | 2013-01-08 19:07:31 | [diff] [blame] | 684 | void PluginServiceImpl::RegisterFilePathWatcher(FilePathWatcher* watcher, |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 685 | const base::FilePath& path) { |
[email protected] | 07b71c8 | 2013-01-08 19:07:31 | [diff] [blame] | 686 | bool result = watcher->Watch(path, false, |
| 687 | base::Bind(&NotifyPluginDirChanged)); |
[email protected] | 634d23d | 2011-01-19 10:38:19 | [diff] [blame] | 688 | DCHECK(result); |
| 689 | } |
| 690 | #endif |
[email protected] | f520b5b | 2011-11-08 02:42:14 | [diff] [blame] | 691 | |
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 692 | void PluginServiceImpl::SetFilter(PluginServiceFilter* filter) { |
[email protected] | 3a5180ae | 2011-12-21 02:39:38 | [diff] [blame] | 693 | filter_ = filter; |
| 694 | } |
| 695 | |
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 696 | PluginServiceFilter* PluginServiceImpl::GetFilter() { |
[email protected] | 3a5180ae | 2011-12-21 02:39:38 | [diff] [blame] | 697 | return filter_; |
| 698 | } |
| 699 | |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 700 | void PluginServiceImpl::ForcePluginShutdown(const base::FilePath& plugin_path) { |
[email protected] | b6a2f8de | 2012-01-31 17:28:49 | [diff] [blame] | 701 | if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
| 702 | BrowserThread::PostTask( |
| 703 | BrowserThread::IO, FROM_HERE, |
| 704 | base::Bind(&PluginServiceImpl::ForcePluginShutdown, |
| 705 | base::Unretained(this), plugin_path)); |
| 706 | return; |
| 707 | } |
| 708 | |
| 709 | PluginProcessHost* plugin = FindNpapiPluginProcess(plugin_path); |
| 710 | if (plugin) |
| 711 | plugin->ForceShutdown(); |
| 712 | } |
| 713 | |
[email protected] | 47214d88 | 2012-02-29 06:28:48 | [diff] [blame] | 714 | static const unsigned int kMaxCrashesPerInterval = 3; |
| 715 | static const unsigned int kCrashesInterval = 120; |
| 716 | |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 717 | void PluginServiceImpl::RegisterPluginCrash(const base::FilePath& path) { |
[email protected] | 47214d88 | 2012-02-29 06:28:48 | [diff] [blame] | 718 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 719 | std::map<base::FilePath, std::vector<base::Time> >::iterator i = |
[email protected] | 47214d88 | 2012-02-29 06:28:48 | [diff] [blame] | 720 | crash_times_.find(path); |
| 721 | if (i == crash_times_.end()) { |
| 722 | crash_times_[path] = std::vector<base::Time>(); |
| 723 | i = crash_times_.find(path); |
| 724 | } |
| 725 | if (i->second.size() == kMaxCrashesPerInterval) { |
| 726 | i->second.erase(i->second.begin()); |
| 727 | } |
| 728 | base::Time time = base::Time::Now(); |
| 729 | i->second.push_back(time); |
| 730 | } |
| 731 | |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 732 | bool PluginServiceImpl::IsPluginUnstable(const base::FilePath& path) { |
[email protected] | 47214d88 | 2012-02-29 06:28:48 | [diff] [blame] | 733 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 734 | std::map<base::FilePath, std::vector<base::Time> >::const_iterator i = |
[email protected] | 47214d88 | 2012-02-29 06:28:48 | [diff] [blame] | 735 | crash_times_.find(path); |
| 736 | if (i == crash_times_.end()) { |
| 737 | return false; |
| 738 | } |
| 739 | if (i->second.size() != kMaxCrashesPerInterval) { |
| 740 | return false; |
| 741 | } |
| 742 | base::TimeDelta delta = base::Time::Now() - i->second[0]; |
[email protected] | d8c7006 | 2013-04-24 00:22:34 | [diff] [blame] | 743 | return delta.InSeconds() <= kCrashesInterval; |
[email protected] | 47214d88 | 2012-02-29 06:28:48 | [diff] [blame] | 744 | } |
| 745 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 746 | void PluginServiceImpl::RefreshPlugins() { |
[email protected] | 3a5180ae | 2011-12-21 02:39:38 | [diff] [blame] | 747 | plugin_list_->RefreshPlugins(); |
[email protected] | f520b5b | 2011-11-08 02:42:14 | [diff] [blame] | 748 | } |
| 749 | |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 750 | void PluginServiceImpl::AddExtraPluginPath(const base::FilePath& path) { |
[email protected] | 3a5180ae | 2011-12-21 02:39:38 | [diff] [blame] | 751 | plugin_list_->AddExtraPluginPath(path); |
[email protected] | f520b5b | 2011-11-08 02:42:14 | [diff] [blame] | 752 | } |
| 753 | |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 754 | void PluginServiceImpl::AddExtraPluginDir(const base::FilePath& path) { |
[email protected] | c6f3dea | 2012-01-14 02:23:11 | [diff] [blame] | 755 | plugin_list_->AddExtraPluginDir(path); |
| 756 | } |
| 757 | |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 758 | void PluginServiceImpl::RemoveExtraPluginPath(const base::FilePath& path) { |
[email protected] | 3a5180ae | 2011-12-21 02:39:38 | [diff] [blame] | 759 | plugin_list_->RemoveExtraPluginPath(path); |
[email protected] | f520b5b | 2011-11-08 02:42:14 | [diff] [blame] | 760 | } |
| 761 | |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 762 | void PluginServiceImpl::UnregisterInternalPlugin(const base::FilePath& path) { |
[email protected] | 3a5180ae | 2011-12-21 02:39:38 | [diff] [blame] | 763 | plugin_list_->UnregisterInternalPlugin(path); |
[email protected] | f520b5b | 2011-11-08 02:42:14 | [diff] [blame] | 764 | } |
| 765 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 766 | void PluginServiceImpl::SetPluginListForTesting( |
[email protected] | ee06617 | 2011-11-10 23:20:05 | [diff] [blame] | 767 | webkit::npapi::PluginList* plugin_list) { |
| 768 | plugin_list_ = plugin_list; |
| 769 | } |
| 770 | |
[email protected] | 5904cb4 | 2012-09-24 15:05:20 | [diff] [blame] | 771 | #if defined(OS_MACOSX) |
| 772 | void PluginServiceImpl::AppActivated() { |
| 773 | BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
[email protected] | 07b71c8 | 2013-01-08 19:07:31 | [diff] [blame] | 774 | base::Bind(&NotifyPluginsOfActivation)); |
[email protected] | 5904cb4 | 2012-09-24 15:05:20 | [diff] [blame] | 775 | } |
| 776 | #endif |
| 777 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 778 | void PluginServiceImpl::RegisterInternalPlugin( |
[email protected] | c6f3dea | 2012-01-14 02:23:11 | [diff] [blame] | 779 | const webkit::WebPluginInfo& info, |
| 780 | bool add_at_beginning) { |
| 781 | plugin_list_->RegisterInternalPlugin(info, add_at_beginning); |
[email protected] | f520b5b | 2011-11-08 02:42:14 | [diff] [blame] | 782 | } |
| 783 | |
[email protected] | 57aece2 | 2012-10-10 22:10:27 | [diff] [blame] | 784 | void PluginServiceImpl::GetInternalPlugins( |
| 785 | std::vector<webkit::WebPluginInfo>* plugins) { |
| 786 | plugin_list_->GetInternalPlugins(plugins); |
| 787 | } |
| 788 | |
[email protected] | e67385f | 2011-12-21 06:00:56 | [diff] [blame] | 789 | webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() { |
[email protected] | 3a5180ae | 2011-12-21 02:39:38 | [diff] [blame] | 790 | return plugin_list_; |
[email protected] | f520b5b | 2011-11-08 02:42:14 | [diff] [blame] | 791 | } |
[email protected] | 13075767 | 2012-10-24 00:26:19 | [diff] [blame] | 792 | |
| 793 | } // namespace content |