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 #pragma once | 10 #pragma once |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 webkit::npapi::PluginList* plugin_list) OVERRIDE; | 121 webkit::npapi::PluginList* plugin_list) OVERRIDE; |
122 | 122 |
123 // Returns the plugin process host corresponding to the plugin process that | 123 // Returns the plugin process host corresponding to the plugin process that |
124 // has been started by this service. This will start a process to host the | 124 // has been started by this service. This will start a process to host the |
125 // 'plugin_path' if needed. If the process fails to start, the return value | 125 // 'plugin_path' if needed. If the process fails to start, the return value |
126 // is NULL. Must be called on the IO thread. | 126 // is NULL. Must be called on the IO thread. |
127 PluginProcessHost* FindOrStartNpapiPluginProcess( | 127 PluginProcessHost* FindOrStartNpapiPluginProcess( |
128 const FilePath& plugin_path); | 128 const FilePath& plugin_path); |
129 PpapiPluginProcessHost* FindOrStartPpapiPluginProcess( | 129 PpapiPluginProcessHost* FindOrStartPpapiPluginProcess( |
130 const FilePath& plugin_path, | 130 const FilePath& plugin_path, |
| 131 const FilePath& profile_data_directory_path, |
131 PpapiPluginProcessHost::PluginClient* client); | 132 PpapiPluginProcessHost::PluginClient* client); |
132 PpapiPluginProcessHost* FindOrStartPpapiBrokerProcess( | 133 PpapiPluginProcessHost* FindOrStartPpapiBrokerProcess( |
133 const FilePath& plugin_path); | 134 const FilePath& plugin_path); |
134 | 135 |
135 // Opens a channel to a plugin process for the given mime type, starting | 136 // Opens a channel to a plugin process for the given mime type, starting |
136 // a new plugin process if necessary. This must be called on the IO thread | 137 // a new plugin process if necessary. This must be called on the IO thread |
137 // or else a deadlock can occur. | 138 // or else a deadlock can occur. |
138 void OpenChannelToNpapiPlugin(int render_process_id, | 139 void OpenChannelToNpapiPlugin(int render_process_id, |
139 int render_view_id, | 140 int render_view_id, |
140 const GURL& url, | 141 const GURL& url, |
141 const GURL& page_url, | 142 const GURL& page_url, |
142 const std::string& mime_type, | 143 const std::string& mime_type, |
143 PluginProcessHost::Client* client); | 144 PluginProcessHost::Client* client); |
144 void OpenChannelToPpapiPlugin(const FilePath& path, | 145 void OpenChannelToPpapiPlugin(const FilePath& plugin_path, |
| 146 const FilePath& data_directory_path, |
145 PpapiPluginProcessHost::PluginClient* client); | 147 PpapiPluginProcessHost::PluginClient* client); |
146 void OpenChannelToPpapiBroker(const FilePath& path, | 148 void OpenChannelToPpapiBroker(const FilePath& path, |
147 PpapiPluginProcessHost::BrokerClient* client); | 149 PpapiPluginProcessHost::BrokerClient* client); |
148 | 150 |
149 // Cancels opening a channel to a NPAPI plugin. | 151 // Cancels opening a channel to a NPAPI plugin. |
150 void CancelOpenChannelToNpapiPlugin(PluginProcessHost::Client* client); | 152 void CancelOpenChannelToNpapiPlugin(PluginProcessHost::Client* client); |
151 | 153 |
152 // Used to monitor plug-in stability. | 154 // Used to monitor plug-in stability. |
153 void RegisterPluginCrash(const FilePath& plugin_path); | 155 void RegisterPluginCrash(const FilePath& plugin_path); |
154 | 156 |
(...skipping 11 matching lines...) Expand all Loading... |
166 | 168 |
167 // content::NotificationObserver implementation | 169 // content::NotificationObserver implementation |
168 virtual void Observe(int type, | 170 virtual void Observe(int type, |
169 const content::NotificationSource& source, | 171 const content::NotificationSource& source, |
170 const content::NotificationDetails& details) OVERRIDE; | 172 const content::NotificationDetails& details) OVERRIDE; |
171 | 173 |
172 // Returns the plugin process host corresponding to the plugin process that | 174 // Returns the plugin process host corresponding to the plugin process that |
173 // has been started by this service. Returns NULL if no process has been | 175 // has been started by this service. Returns NULL if no process has been |
174 // started. | 176 // started. |
175 PluginProcessHost* FindNpapiPluginProcess(const FilePath& plugin_path); | 177 PluginProcessHost* FindNpapiPluginProcess(const FilePath& plugin_path); |
176 PpapiPluginProcessHost* FindPpapiPluginProcess(const FilePath& plugin_path); | 178 PpapiPluginProcessHost* FindPpapiPluginProcess( |
| 179 const FilePath& plugin_path, |
| 180 const FilePath& data_directory_path); |
177 PpapiPluginProcessHost* FindPpapiBrokerProcess(const FilePath& broker_path); | 181 PpapiPluginProcessHost* FindPpapiBrokerProcess(const FilePath& broker_path); |
178 | 182 |
179 void RegisterPepperPlugins(); | 183 void RegisterPepperPlugins(); |
180 | 184 |
181 #if defined(OS_WIN) | 185 #if defined(OS_WIN) |
182 // Run on the blocking pool to load the plugins synchronously. | 186 // Run on the blocking pool to load the plugins synchronously. |
183 void GetPluginsInternal(base::MessageLoopProxy* target_loop, | 187 void GetPluginsInternal(base::MessageLoopProxy* target_loop, |
184 const GetPluginsCallback& callback); | 188 const GetPluginsCallback& callback); |
185 #endif | 189 #endif |
186 | 190 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 scoped_refptr<PluginLoaderPosix> plugin_loader_; | 255 scoped_refptr<PluginLoaderPosix> plugin_loader_; |
252 #endif | 256 #endif |
253 | 257 |
254 // Used to detect if a given plug-in is crashing over and over. | 258 // Used to detect if a given plug-in is crashing over and over. |
255 std::map<FilePath, std::vector<base::Time> > crash_times_; | 259 std::map<FilePath, std::vector<base::Time> > crash_times_; |
256 | 260 |
257 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); | 261 DISALLOW_COPY_AND_ASSIGN(PluginServiceImpl); |
258 }; | 262 }; |
259 | 263 |
260 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ | 264 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_IMPL_H_ |
OLD | NEW |