| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 void RegisterPluginCrash(const base::FilePath& plugin_path); | 159 void RegisterPluginCrash(const base::FilePath& plugin_path); |
| 160 | 160 |
| 161 private: | 161 private: |
| 162 friend struct DefaultSingletonTraits<PluginServiceImpl>; | 162 friend struct DefaultSingletonTraits<PluginServiceImpl>; |
| 163 | 163 |
| 164 // Creates the PluginServiceImpl object, but doesn't actually build the plugin | 164 // Creates the PluginServiceImpl object, but doesn't actually build the plugin |
| 165 // list yet. It's generated lazily. | 165 // list yet. It's generated lazily. |
| 166 PluginServiceImpl(); | 166 PluginServiceImpl(); |
| 167 virtual ~PluginServiceImpl(); | 167 virtual ~PluginServiceImpl(); |
| 168 | 168 |
| 169 #if defined(OS_WIN) | 169 void OnWaitableEventSignaled(base::WaitableEvent* waitable_event); |
| 170 void OnKeyChanged(base::win::RegKey* key); | |
| 171 #endif | |
| 172 | 170 |
| 173 // Returns the plugin process host corresponding to the plugin process that | 171 // Returns the plugin process host corresponding to the plugin process that |
| 174 // has been started by this service. Returns NULL if no process has been | 172 // has been started by this service. Returns NULL if no process has been |
| 175 // started. | 173 // started. |
| 176 PluginProcessHost* FindNpapiPluginProcess(const base::FilePath& plugin_path); | 174 PluginProcessHost* FindNpapiPluginProcess(const base::FilePath& plugin_path); |
| 177 PpapiPluginProcessHost* FindPpapiPluginProcess( | 175 PpapiPluginProcessHost* FindPpapiPluginProcess( |
| 178 const base::FilePath& plugin_path, | 176 const base::FilePath& plugin_path, |
| 179 const base::FilePath& profile_data_directory); | 177 const base::FilePath& profile_data_directory); |
| 180 PpapiPluginProcessHost* FindPpapiBrokerProcess( | 178 PpapiPluginProcessHost* FindPpapiBrokerProcess( |
| 181 const base::FilePath& broker_path); | 179 const base::FilePath& broker_path); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) | 217 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) |
| 220 // Registers a new FilePathWatcher for a given path. | 218 // Registers a new FilePathWatcher for a given path. |
| 221 static void RegisterFilePathWatcher(base::FilePathWatcher* watcher, | 219 static void RegisterFilePathWatcher(base::FilePathWatcher* watcher, |
| 222 const base::FilePath& path); | 220 const base::FilePath& path); |
| 223 #endif | 221 #endif |
| 224 | 222 |
| 225 #if defined(OS_WIN) | 223 #if defined(OS_WIN) |
| 226 // Registry keys for getting notifications when new plugins are installed. | 224 // Registry keys for getting notifications when new plugins are installed. |
| 227 base::win::RegKey hkcu_key_; | 225 base::win::RegKey hkcu_key_; |
| 228 base::win::RegKey hklm_key_; | 226 base::win::RegKey hklm_key_; |
| 227 scoped_ptr<base::WaitableEvent> hkcu_event_; |
| 228 scoped_ptr<base::WaitableEvent> hklm_event_; |
| 229 base::WaitableEventWatcher hkcu_watcher_; |
| 230 base::WaitableEventWatcher hklm_watcher_; |
| 229 #endif | 231 #endif |
| 230 | 232 |
| 231 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) | 233 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) |
| 232 ScopedVector<base::FilePathWatcher> file_watchers_; | 234 ScopedVector<base::FilePathWatcher> file_watchers_; |
| 233 #endif | 235 #endif |
| 234 | 236 |
| 235 std::vector<PepperPluginInfo> ppapi_plugins_; | 237 std::vector<PepperPluginInfo> ppapi_plugins_; |
| 236 | 238 |
| 237 // Weak pointer; outlives us. | 239 // Weak pointer; outlives us. |
| 238 PluginServiceFilter* filter_; | 240 PluginServiceFilter* filter_; |
| 239 | 241 |
| 240 std::set<PluginProcessHost::Client*> pending_plugin_clients_; | 242 std::set<PluginProcessHost::Client*> pending_plugin_clients_; |
| 241 | 243 |
| 242 // Used to sequentialize loading plug-ins from disk. | 244 // Used to sequentialize loading plug-ins from disk. |
| 243 base::SequencedWorkerPool::SequenceToken plugin_list_token_; | 245 base::SequencedWorkerPool::SequenceToken plugin_list_token_; |
| 244 | 246 |
| 245 #if defined(OS_POSIX) | 247 #if defined(OS_POSIX) |
| 246 scoped_refptr<PluginLoaderPosix> plugin_loader_; | 248 scoped_refptr<PluginLoaderPosix> plugin_loader_; |
| 247 #endif | 249 #endif |
| 248 | 250 |
| 249 // Used to detect if a given plug-in is crashing over and over. | 251 // Used to detect if a given plug-in is crashing over and over. |
| 250 std::map<base::FilePath, std::vector<base::Time> > crash_times_; | 252 std::map<base::FilePath, std::vector<base::Time> > crash_times_; |
| 251 | 253 |
| 252 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); | 254 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); |
| 253 }; | 255 }; |
| 254 | 256 |
| 255 } // namespace content | 257 } // namespace content |
| 256 | 258 |
| 257 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ | 259 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
| OLD | NEW |