Index: content/browser/plugin_service.cc |
diff --git a/content/browser/plugin_service.cc b/content/browser/plugin_service.cc |
index 5e0e910656076fa2394cec4f57f871b1f52a079b..76e0102b181c42872218369e39ee2f0a63a9a9a3 100644 |
--- a/content/browser/plugin_service.cc |
+++ b/content/browser/plugin_service.cc |
@@ -113,9 +113,31 @@ PluginService* PluginService::GetInstance() { |
} |
PluginService::PluginService() |
- : ui_locale_( |
+ : plugin_list_(NULL), |
+ ui_locale_( |
content::GetContentClient()->browser()->GetApplicationLocale()), |
filter_(NULL) { |
+} |
+ |
+PluginService::~PluginService() { |
+#if defined(OS_WIN) |
+ // Release the events since they're owned by RegKey, not WaitableEvent. |
+ hkcu_watcher_.StopWatching(); |
+ hklm_watcher_.StopWatching(); |
+ if (hkcu_event_.get()) |
+ hkcu_event_->Release(); |
+ if (hklm_event_.get()) |
+ hklm_event_->Release(); |
+#endif |
+ // Make sure no plugin channel requests have been leaked. |
+ DCHECK(pending_plugin_clients_.empty()); |
+} |
+ |
+void PluginService::Init(webkit::npapi::PluginList* a_plugin_list) { |
+ DCHECK(!plugin_list_) << "PluginService already initialized"; |
+ DCHECK(a_plugin_list); |
+ plugin_list_ = a_plugin_list; |
+ |
plugin_list()->set_will_load_plugins_callback( |
base::Bind(&WillLoadPluginsCallback)); |
@@ -140,20 +162,6 @@ PluginService::PluginService() |
#endif |
} |
-PluginService::~PluginService() { |
-#if defined(OS_WIN) |
- // Release the events since they're owned by RegKey, not WaitableEvent. |
- hkcu_watcher_.StopWatching(); |
- hklm_watcher_.StopWatching(); |
- if (hkcu_event_.get()) |
- hkcu_event_->Release(); |
- if (hklm_event_.get()) |
- hklm_event_->Release(); |
-#endif |
- // Make sure no plugin channel requests have been leaked. |
- DCHECK(pending_plugin_clients_.empty()); |
-} |
- |
void PluginService::StartWatchingPlugins() { |
// Start watching for changes in the plugin list. This means watching |
// for changes in the Windows registry keys and on both Windows and POSIX |