OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 8 #ifndef CONTENT_BROWSER_PLUGIN_SERVICE_H_ |
9 #define CONTENT_BROWSER_PLUGIN_SERVICE_H_ | 9 #define CONTENT_BROWSER_PLUGIN_SERVICE_H_ |
10 #pragma once | 10 #pragma once |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 PluginProcessHost::Client* client); | 114 PluginProcessHost::Client* client); |
115 void OpenChannelToPpapiPlugin(const FilePath& path, | 115 void OpenChannelToPpapiPlugin(const FilePath& path, |
116 PpapiPluginProcessHost::Client* client); | 116 PpapiPluginProcessHost::Client* client); |
117 void OpenChannelToPpapiBroker(const FilePath& path, | 117 void OpenChannelToPpapiBroker(const FilePath& path, |
118 PpapiBrokerProcessHost::Client* client); | 118 PpapiBrokerProcessHost::Client* client); |
119 | 119 |
120 // Cancels opening a channel to a NPAPI plugin. | 120 // Cancels opening a channel to a NPAPI plugin. |
121 void CancelOpenChannelToNpapiPlugin(PluginProcessHost::Client* client); | 121 void CancelOpenChannelToNpapiPlugin(PluginProcessHost::Client* client); |
122 | 122 |
123 // Gets the plugin in the list of plugins that matches the given url and mime | 123 // Gets the plugin in the list of plugins that matches the given url and mime |
124 // type. Must be called on the FILE thread if |use_stale| is NULL. | 124 // type. Returns true if the data is frome a stale plugin list, false if it |
125 // is up to date. This can be called from any thread. | |
126 bool GetPluginInfoArray(const GURL& url, | |
jam
2011/09/30 17:01:21
is it really necessary to add a wrapper function a
Bernhard Bauer
2011/09/30 17:22:21
That's at least Robert's plan for the future. I co
jam
2011/09/30 17:40:19
I see. it's a bit unfortunate to have these wrappe
| |
127 const std::string& mime_type, | |
128 bool allow_wildcard, | |
129 std::vector<webkit::WebPluginInfo>* info, | |
130 std::vector<std::string>* actual_mime_types); | |
131 | |
132 // Gets plugin info for an individual plugin and filters the plugins using | |
133 // the |context| and renderer IDs. This will report whether the data is stale | |
134 // via |is_stale| and returns whether or not the plugin can be found. | |
125 bool GetPluginInfo(int render_process_id, | 135 bool GetPluginInfo(int render_process_id, |
126 int render_view_id, | 136 int render_view_id, |
127 const content::ResourceContext& context, | 137 const content::ResourceContext& context, |
128 const GURL& url, | 138 const GURL& url, |
129 const GURL& page_url, | 139 const GURL& page_url, |
130 const std::string& mime_type, | 140 const std::string& mime_type, |
131 bool allow_wildcard, | 141 bool allow_wildcard, |
132 bool* use_stale, | 142 bool* use_stale, |
133 webkit::WebPluginInfo* info, | 143 webkit::WebPluginInfo* info, |
134 std::string* actual_mime_type); | 144 std::string* actual_mime_type); |
135 | 145 |
136 // Marks the plugin list as dirty and will cause the plugins to be reloaded | 146 // Marks the plugin list as dirty and will cause the plugins to be reloaded |
137 // on the next access through GetPlugins() or GetPluginGroups(). | 147 // on the next access through GetPlugins() or GetPluginGroups(). |
138 void RefreshPluginList(); | 148 void RefreshPluginList(); |
139 | 149 |
140 // Asynchronously loads plugins if necessary and then calls back to the | 150 // Asynchronously loads plugins if necessary and then calls back to the |
141 // provided function on the calling MessageLoop on completion. | 151 // provided function on the calling MessageLoop with the list of plugins |
152 // on completion. | |
142 void GetPlugins(const GetPluginsCallback& callback); | 153 void GetPlugins(const GetPluginsCallback& callback); |
143 | 154 |
144 // Asynchronously loads the list of plugin groups if necessary and then calls | 155 // Asynchronously loads the list of plugin groups if necessary and then calls |
145 // back to the provided function on the calling MessageLoop on completion. | 156 // back to the provided function on the calling MessageLoop on completion. |
146 void GetPluginGroups(const GetPluginGroupsCallback& callback); | 157 void GetPluginGroups(const GetPluginGroupsCallback& callback); |
147 | 158 |
159 // Asynchronously loads plugins if necessary and then calls back to the | |
160 // provided function on the calling MessageLoop on completion. | |
161 void EnsurePluginsLoaded(const base::Closure& callback); | |
jam
2011/09/30 17:01:21
this function doesn't seem necessary since it can
Bernhard Bauer
2011/09/30 17:22:21
I find it a bit awkward having the list of plug-in
jam
2011/09/30 17:40:19
we already do this (i.e. BufferedRersourceHandler)
Bernhard Bauer
2011/10/05 13:34:33
ok, done.
| |
162 | |
148 // Tells all the renderer processes to throw away their cache of the plugin | 163 // Tells all the renderer processes to throw away their cache of the plugin |
149 // list, and optionally also reload all the pages with plugins. | 164 // list, and optionally also reload all the pages with plugins. |
150 // NOTE: can only be called on the UI thread. | 165 // NOTE: can only be called on the UI thread. |
151 static void PurgePluginListCache(bool reload_pages); | 166 static void PurgePluginListCache(bool reload_pages); |
152 | 167 |
153 void set_filter(content::PluginServiceFilter* filter) { | 168 void set_filter(content::PluginServiceFilter* filter) { |
154 filter_ = filter; | 169 filter_ = filter; |
155 } | 170 } |
156 content::PluginServiceFilter* filter() { return filter_; } | 171 content::PluginServiceFilter* filter() { return filter_; } |
157 | 172 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 content::PluginServiceFilter* filter_; | 243 content::PluginServiceFilter* filter_; |
229 | 244 |
230 std::set<PluginProcessHost::Client*> pending_plugin_clients_; | 245 std::set<PluginProcessHost::Client*> pending_plugin_clients_; |
231 | 246 |
232 DISALLOW_COPY_AND_ASSIGN(PluginService); | 247 DISALLOW_COPY_AND_ASSIGN(PluginService); |
233 }; | 248 }; |
234 | 249 |
235 DISABLE_RUNNABLE_METHOD_REFCOUNT(PluginService); | 250 DISABLE_RUNNABLE_METHOD_REFCOUNT(PluginService); |
236 | 251 |
237 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_H_ | 252 #endif // CONTENT_BROWSER_PLUGIN_SERVICE_H_ |
OLD | NEW |