OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_IMPL_H_ | 8 #ifndef CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
9 #define CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ | 9 #define CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // base::Bind() has limited arity, and the filter-related methods tend to | 57 // base::Bind() has limited arity, and the filter-related methods tend to |
58 // surpass that limit. | 58 // surpass that limit. |
59 struct PluginServiceFilterParams { | 59 struct PluginServiceFilterParams { |
60 int render_process_id; | 60 int render_process_id; |
61 int render_view_id; | 61 int render_view_id; |
62 GURL page_url; | 62 GURL page_url; |
63 ResourceContext* resource_context; | 63 ResourceContext* resource_context; |
64 }; | 64 }; |
65 | 65 |
66 class CONTENT_EXPORT PluginServiceImpl | 66 class CONTENT_EXPORT PluginServiceImpl |
67 : NON_EXPORTED_BASE(public PluginService), | 67 : NON_EXPORTED_BASE(public PluginService) { |
68 public base::WaitableEventWatcher::Delegate { | |
69 public: | 68 public: |
70 // Returns the PluginServiceImpl singleton. | 69 // Returns the PluginServiceImpl singleton. |
71 static PluginServiceImpl* GetInstance(); | 70 static PluginServiceImpl* GetInstance(); |
72 | 71 |
73 // PluginService implementation: | 72 // PluginService implementation: |
74 virtual void Init() OVERRIDE; | 73 virtual void Init() OVERRIDE; |
75 virtual void StartWatchingPlugins() OVERRIDE; | 74 virtual void StartWatchingPlugins() OVERRIDE; |
76 virtual bool GetPluginInfoArray( | 75 virtual bool GetPluginInfoArray( |
77 const GURL& url, | 76 const GURL& url, |
78 const std::string& mime_type, | 77 const std::string& mime_type, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 void RegisterPluginCrash(const FilePath& plugin_path); | 149 void RegisterPluginCrash(const FilePath& plugin_path); |
151 | 150 |
152 private: | 151 private: |
153 friend struct DefaultSingletonTraits<PluginServiceImpl>; | 152 friend struct DefaultSingletonTraits<PluginServiceImpl>; |
154 | 153 |
155 // Creates the PluginServiceImpl object, but doesn't actually build the plugin | 154 // Creates the PluginServiceImpl object, but doesn't actually build the plugin |
156 // list yet. It's generated lazily. | 155 // list yet. It's generated lazily. |
157 PluginServiceImpl(); | 156 PluginServiceImpl(); |
158 virtual ~PluginServiceImpl(); | 157 virtual ~PluginServiceImpl(); |
159 | 158 |
160 // base::WaitableEventWatcher::Delegate implementation. | 159 void OnWaitableEventSignaled(base::WaitableEvent* waitable_event); |
161 virtual void OnWaitableEventSignaled( | |
162 base::WaitableEvent* waitable_event) OVERRIDE; | |
163 | 160 |
164 // Returns the plugin process host corresponding to the plugin process that | 161 // Returns the plugin process host corresponding to the plugin process that |
165 // has been started by this service. Returns NULL if no process has been | 162 // has been started by this service. Returns NULL if no process has been |
166 // started. | 163 // started. |
167 PluginProcessHost* FindNpapiPluginProcess(const FilePath& plugin_path); | 164 PluginProcessHost* FindNpapiPluginProcess(const FilePath& plugin_path); |
168 PpapiPluginProcessHost* FindPpapiPluginProcess( | 165 PpapiPluginProcessHost* FindPpapiPluginProcess( |
169 const FilePath& plugin_path, | 166 const FilePath& plugin_path, |
170 const FilePath& profile_data_directory); | 167 const FilePath& profile_data_directory); |
171 PpapiPluginProcessHost* FindPpapiBrokerProcess(const FilePath& broker_path); | 168 PpapiPluginProcessHost* FindPpapiBrokerProcess(const FilePath& broker_path); |
172 | 169 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 | 235 |
239 // Used to detect if a given plug-in is crashing over and over. | 236 // Used to detect if a given plug-in is crashing over and over. |
240 std::map<FilePath, std::vector<base::Time> > crash_times_; | 237 std::map<FilePath, std::vector<base::Time> > crash_times_; |
241 | 238 |
242 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); | 239 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); |
243 }; | 240 }; |
244 | 241 |
245 } // namespace content | 242 } // namespace content |
246 | 243 |
247 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ | 244 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
OLD | NEW |