| Index: content/browser/plugin_service.h
|
| diff --git a/content/browser/plugin_service.h b/content/browser/plugin_service.h
|
| index 6be2c4f3623da48ed3d5fab10ca438be07473a8b..d1dcb5dd913e5efac95a887e4733700adaebe169 100644
|
| --- a/content/browser/plugin_service.h
|
| +++ b/content/browser/plugin_service.h
|
| @@ -154,11 +154,11 @@ class CONTENT_EXPORT PluginService
|
|
|
| // Asynchronously loads plugins if necessary and then calls back to the
|
| // provided function on the calling MessageLoop on completion.
|
| - void GetPlugins(const GetPluginsCallback& callback);
|
| + virtual void GetPlugins(const GetPluginsCallback& callback);
|
|
|
| // Asynchronously loads the list of plugin groups if necessary and then calls
|
| // back to the provided function on the calling MessageLoop on completion.
|
| - void GetPluginGroups(const GetPluginGroupsCallback& callback);
|
| + virtual void GetPluginGroups(const GetPluginGroupsCallback& callback);
|
|
|
| // Tells all the renderer processes associated with the given browser context
|
| // to throw away their cache of the plugin list, and optionally also reload
|
| @@ -173,7 +173,6 @@ class CONTENT_EXPORT PluginService
|
| }
|
| content::PluginServiceFilter* filter() { return filter_; }
|
|
|
| -
|
| // The following functions are wrappers around webkit::npapi::PluginList.
|
| // These must be used instead of those in order to ensure that we have a
|
| // single global list in the component build and so that we don't
|
| @@ -189,14 +188,19 @@ class CONTENT_EXPORT PluginService
|
| // TODO(dpranke): This should be private.
|
| webkit::npapi::PluginList* plugin_list();
|
|
|
| - private:
|
| - friend struct DefaultSingletonTraits<PluginService>;
|
| + void SetPluginListForTesting(webkit::npapi::PluginList* plugin_list);
|
|
|
| - // Creates the PluginService object, but doesn't actually build the plugin
|
| - // list yet. It's generated lazily.
|
| + protected:
|
| + // Creates the PluginService object, but the actual plugin list is generated
|
| + // lazily. In tests, use MockPluginList for dependency injection.
|
| PluginService();
|
| virtual ~PluginService();
|
|
|
| + void Init();
|
| +
|
| + private:
|
| + friend struct DefaultSingletonTraits<PluginService>;
|
| +
|
| // base::WaitableEventWatcher::Delegate implementation.
|
| virtual void OnWaitableEventSignaled(base::WaitableEvent* waitable_event);
|
|
|
| @@ -245,6 +249,12 @@ class CONTENT_EXPORT PluginService
|
| base::files::FilePathWatcher::Delegate* delegate);
|
| #endif
|
|
|
| + // Whether or not the Init() method was called.
|
| + bool did_init_;
|
| +
|
| + // The plugin list instance.
|
| + webkit::npapi::PluginList* plugin_list_;
|
| +
|
| // The browser's UI locale.
|
| const std::string ui_locale_;
|
|
|
|
|