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