| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 webkit::npapi::PluginList* plugin_list) OVERRIDE; | 113 webkit::npapi::PluginList* plugin_list) OVERRIDE; |
| 114 #if defined(OS_MACOSX) | 114 #if defined(OS_MACOSX) |
| 115 virtual void AppActivated() OVERRIDE; | 115 virtual void AppActivated() OVERRIDE; |
| 116 #endif | 116 #endif |
| 117 | 117 |
| 118 // Returns the plugin process host corresponding to the plugin process that | 118 // Returns the plugin process host corresponding to the plugin process that |
| 119 // has been started by this service. This will start a process to host the | 119 // has been started by this service. This will start a process to host the |
| 120 // 'plugin_path' if needed. If the process fails to start, the return value | 120 // 'plugin_path' if needed. If the process fails to start, the return value |
| 121 // is NULL. Must be called on the IO thread. | 121 // is NULL. Must be called on the IO thread. |
| 122 PluginProcessHost* FindOrStartNpapiPluginProcess( | 122 PluginProcessHost* FindOrStartNpapiPluginProcess( |
| 123 const FilePath& plugin_path); | 123 int render_process_id, const FilePath& plugin_path); |
| 124 PpapiPluginProcessHost* FindOrStartPpapiPluginProcess( | 124 PpapiPluginProcessHost* FindOrStartPpapiPluginProcess( |
| 125 int render_process_id, |
| 125 const FilePath& plugin_path, | 126 const FilePath& plugin_path, |
| 126 const FilePath& profile_data_directory, | 127 const FilePath& profile_data_directory, |
| 127 PpapiPluginProcessHost::PluginClient* client); | 128 PpapiPluginProcessHost::PluginClient* client); |
| 128 PpapiPluginProcessHost* FindOrStartPpapiBrokerProcess( | 129 PpapiPluginProcessHost* FindOrStartPpapiBrokerProcess( |
| 129 const FilePath& plugin_path); | 130 int render_process_id, const FilePath& plugin_path); |
| 130 | 131 |
| 131 // Opens a channel to a plugin process for the given mime type, starting | 132 // Opens a channel to a plugin process for the given mime type, starting |
| 132 // a new plugin process if necessary. This must be called on the IO thread | 133 // a new plugin process if necessary. This must be called on the IO thread |
| 133 // or else a deadlock can occur. | 134 // or else a deadlock can occur. |
| 134 void OpenChannelToNpapiPlugin(int render_process_id, | 135 void OpenChannelToNpapiPlugin(int render_process_id, |
| 135 int render_view_id, | 136 int render_view_id, |
| 136 const GURL& url, | 137 const GURL& url, |
| 137 const GURL& page_url, | 138 const GURL& page_url, |
| 138 const std::string& mime_type, | 139 const std::string& mime_type, |
| 139 PluginProcessHost::Client* client); | 140 PluginProcessHost::Client* client); |
| 140 void OpenChannelToPpapiPlugin(const FilePath& plugin_path, | 141 void OpenChannelToPpapiPlugin(int render_process_id, |
| 142 const FilePath& plugin_path, |
| 141 const FilePath& profile_data_directory, | 143 const FilePath& profile_data_directory, |
| 142 PpapiPluginProcessHost::PluginClient* client); | 144 PpapiPluginProcessHost::PluginClient* client); |
| 143 void OpenChannelToPpapiBroker(const FilePath& path, | 145 void OpenChannelToPpapiBroker(int render_process_id, |
| 146 const FilePath& path, |
| 144 PpapiPluginProcessHost::BrokerClient* client); | 147 PpapiPluginProcessHost::BrokerClient* client); |
| 145 | 148 |
| 146 // Cancels opening a channel to a NPAPI plugin. | 149 // Cancels opening a channel to a NPAPI plugin. |
| 147 void CancelOpenChannelToNpapiPlugin(PluginProcessHost::Client* client); | 150 void CancelOpenChannelToNpapiPlugin(PluginProcessHost::Client* client); |
| 148 | 151 |
| 149 // Used to monitor plug-in stability. | 152 // Used to monitor plug-in stability. |
| 150 void RegisterPluginCrash(const FilePath& plugin_path); | 153 void RegisterPluginCrash(const FilePath& plugin_path); |
| 151 | 154 |
| 152 private: | 155 private: |
| 153 friend struct DefaultSingletonTraits<PluginServiceImpl>; | 156 friend struct DefaultSingletonTraits<PluginServiceImpl>; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 int render_process_id, | 192 int render_process_id, |
| 190 int render_view_id, | 193 int render_view_id, |
| 191 const GURL& url, | 194 const GURL& url, |
| 192 const GURL& page_url, | 195 const GURL& page_url, |
| 193 const std::string& mime_type, | 196 const std::string& mime_type, |
| 194 PluginProcessHost::Client* client, | 197 PluginProcessHost::Client* client, |
| 195 ResourceContext* resource_context); | 198 ResourceContext* resource_context); |
| 196 | 199 |
| 197 // Helper so we can finish opening the channel after looking up the | 200 // Helper so we can finish opening the channel after looking up the |
| 198 // plugin. | 201 // plugin. |
| 199 void FinishOpenChannelToPlugin(const FilePath& plugin_path, | 202 void FinishOpenChannelToPlugin(int render_process_id, |
| 203 const FilePath& plugin_path, |
| 200 PluginProcessHost::Client* client); | 204 PluginProcessHost::Client* client); |
| 201 | 205 |
| 202 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) | 206 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) |
| 203 // Registers a new FilePathWatcher for a given path. | 207 // Registers a new FilePathWatcher for a given path. |
| 204 static void RegisterFilePathWatcher(base::FilePathWatcher* watcher, | 208 static void RegisterFilePathWatcher(base::FilePathWatcher* watcher, |
| 205 const FilePath& path); | 209 const FilePath& path); |
| 206 #endif | 210 #endif |
| 207 | 211 |
| 208 // The plugin list instance. | 212 // The plugin list instance. |
| 209 webkit::npapi::PluginList* plugin_list_; | 213 webkit::npapi::PluginList* plugin_list_; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 238 | 242 |
| 239 // Used to detect if a given plug-in is crashing over and over. | 243 // Used to detect if a given plug-in is crashing over and over. |
| 240 std::map<FilePath, std::vector<base::Time> > crash_times_; | 244 std::map<FilePath, std::vector<base::Time> > crash_times_; |
| 241 | 245 |
| 242 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); | 246 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); |
| 243 }; | 247 }; |
| 244 | 248 |
| 245 } // namespace content | 249 } // namespace content |
| 246 | 250 |
| 247 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ | 251 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
| OLD | NEW |