Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This class responds to requests from renderers for the list of plugins, and | 5 // This class responds to requests from renderers for the list of plugins, and |
| 6 // also a proxy object for plugin instances. | 6 // also a proxy object for plugin instances. |
| 7 | 7 |
| 8 #ifndef CONTENT_BROWSER_PLUGIN_SERVICE_H_ | 8 #ifndef CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
| 9 #define CONTENT_BROWSER_PLUGIN_SERVICE_H_ | 9 #define CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
| 10 #pragma once | 10 #pragma once |
| 11 | 11 |
| 12 #include <set> | 12 #include <set> |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
| 17 #include "base/memory/singleton.h" | 17 #include "base/memory/singleton.h" |
| 18 #include "base/synchronization/waitable_event_watcher.h" | 18 #include "base/synchronization/waitable_event_watcher.h" |
| 19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 50 struct PluginServiceFilterParams; | 50 struct PluginServiceFilterParams; |
| 51 } | 51 } |
| 52 | 52 |
| 53 namespace webkit { | 53 namespace webkit { |
| 54 namespace npapi { | 54 namespace npapi { |
| 55 class PluginGroup; | 55 class PluginGroup; |
| 56 class PluginList; | 56 class PluginList; |
| 57 } | 57 } |
| 58 } | 58 } |
| 59 | 59 |
| 60 class CONTENT_EXPORT PluginService | 60 class CONTENT_EXPORT PluginServiceImpl |
| 61 : NON_EXPORTED_BASE(public content::PluginService), | 61 : NON_EXPORTED_BASE(public content::PluginService), |
| 62 public base::WaitableEventWatcher::Delegate, | 62 public base::WaitableEventWatcher::Delegate, |
| 63 public content::NotificationObserver { | 63 public content::NotificationObserver { |
| 64 public: | 64 public: |
| 65 // Returns the PluginService singleton. | 65 // Returns the PluginServiceImpl singleton. |
| 66 static PluginService* GetInstance(); | 66 static PluginServiceImpl* GetInstance(); |
| 67 | 67 |
| 68 // content::PluginService implementation: | 68 // content::PluginService implementation: |
| 69 virtual void Init() OVERRIDE; | 69 virtual void Init() OVERRIDE; |
| 70 virtual void StartWatchingPlugins() OVERRIDE; | 70 virtual void StartWatchingPlugins() OVERRIDE; |
| 71 virtual PluginProcessHost* FindNpapiPluginProcess( | 71 virtual PluginProcessHost* FindNpapiPluginProcess( |
| 72 const FilePath& plugin_path) OVERRIDE; | 72 const FilePath& plugin_path) OVERRIDE; |
| 73 virtual bool GetPluginInfoArray( | 73 virtual bool GetPluginInfoArray( |
| 74 const GURL& url, | 74 const GURL& url, |
| 75 const std::string& mime_type, | 75 const std::string& mime_type, |
| 76 bool allow_wildcard, | 76 bool allow_wildcard, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 PpapiPluginProcessHost::PluginClient* client); | 136 PpapiPluginProcessHost::PluginClient* client); |
| 137 void OpenChannelToPpapiBroker(const FilePath& path, | 137 void OpenChannelToPpapiBroker(const FilePath& path, |
| 138 PpapiPluginProcessHost::BrokerClient* client); | 138 PpapiPluginProcessHost::BrokerClient* client); |
| 139 | 139 |
| 140 // Cancels opening a channel to a NPAPI plugin. | 140 // Cancels opening a channel to a NPAPI plugin. |
| 141 void CancelOpenChannelToNpapiPlugin(PluginProcessHost::Client* client); | 141 void CancelOpenChannelToNpapiPlugin(PluginProcessHost::Client* client); |
| 142 | 142 |
| 143 void SetPluginListForTesting(webkit::npapi::PluginList* plugin_list); | 143 void SetPluginListForTesting(webkit::npapi::PluginList* plugin_list); |
| 144 | 144 |
| 145 private: | 145 private: |
| 146 friend struct DefaultSingletonTraits<PluginService>; | 146 friend struct DefaultSingletonTraits<PluginServiceImpl>; |
| 147 | 147 |
| 148 // Creates the PluginService object, but doesn't actually build the plugin | 148 // Creates the PluginServiceImpl object, but doesn't actually build the plugin |
| 149 // list yet. It's generated lazily. | 149 // list yet. It's generated lazily. |
| 150 PluginService(); | 150 PluginServiceImpl(); |
| 151 virtual ~PluginService(); | 151 virtual ~PluginServiceImpl(); |
| 152 | 152 |
| 153 // base::WaitableEventWatcher::Delegate implementation. | 153 // base::WaitableEventWatcher::Delegate implementation. |
| 154 virtual void OnWaitableEventSignaled( | 154 virtual void OnWaitableEventSignaled( |
| 155 base::WaitableEvent* waitable_event) OVERRIDE; | 155 base::WaitableEvent* waitable_event) OVERRIDE; |
| 156 | 156 |
| 157 // content::NotificationObserver implementation | 157 // content::NotificationObserver implementation |
| 158 virtual void Observe(int type, | 158 virtual void Observe(int type, |
| 159 const content::NotificationSource& source, | 159 const content::NotificationSource& source, |
| 160 const content::NotificationDetails& details) OVERRIDE; | 160 const content::NotificationDetails& details) OVERRIDE; |
| 161 | 161 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 | 224 |
| 225 // Weak pointer; outlives us. | 225 // Weak pointer; outlives us. |
| 226 content::PluginServiceFilter* filter_; | 226 content::PluginServiceFilter* filter_; |
| 227 | 227 |
| 228 std::set<PluginProcessHost::Client*> pending_plugin_clients_; | 228 std::set<PluginProcessHost::Client*> pending_plugin_clients_; |
| 229 | 229 |
| 230 #if defined(OS_POSIX) | 230 #if defined(OS_POSIX) |
| 231 scoped_refptr<PluginLoaderPosix> plugin_loader_; | 231 scoped_refptr<PluginLoaderPosix> plugin_loader_; |
| 232 #endif | 232 #endif |
| 233 | 233 |
| 234 DISALLOW_COPY_AND_ASSIGN(PluginService); | 234 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); |
| 235 }; | 235 }; |
| 236 | 236 |
| 237 DISABLE_RUNNABLE_METHOD_REFCOUNT(PluginService); | 237 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
|
Nico
2011/12/21 03:38:39
Did you lose this intentionally?
jam
2011/12/21 04:56:50
it's not needed anymore now that we use bind
| |
| 238 | |
| 239 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_H_ | |
| OLD | NEW |