summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/buffered_resource_handler.h
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-30 21:52:32 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-30 21:52:32 +0000
commit90d4137638f7f8e0abd591d796ff0bd396ae6826 (patch)
treec26377fb9157fa2cd08e61fcd0cdbe2bc46986e3 /chrome/browser/renderer_host/buffered_resource_handler.h
parentac52245b577be6105226d4a4befb9b55fe45ef19 (diff)
downloadchromium_src-90d4137638f7f8e0abd591d796ff0bd396ae6826.zip
chromium_src-90d4137638f7f8e0abd591d796ff0bd396ae6826.tar.gz
chromium_src-90d4137638f7f8e0abd591d796ff0bd396ae6826.tar.bz2
Relocate plugin list fetching to PluginService
We fetch the plugin list from three places. Previously, each location had custom code to proxy the query to the file thread. This change moves the query to the PluginService, which then internally manages posting to the file thread and calling back. I experimented with some different approaches to handling the lifetimes of the requests and responses. The approach now is simple: - The PluginService plugin methods are called and respond on the IO thread. Two of the three consumers of the plugin lists are already on the IO thread, so they don't need any complicated thread handling. - None of the callers ever need to cancel their requests: one is a singleton, and the other two always wait (in terms of holding a ref on the object) for the requests to complete. This makes lifetime management a lot simpler than it would otherwise be. With this change in place, I can then look at refactoring the PluginService implementation on Linux to do more complicated plugin loading as needed in bug 17863. BUG=17863 Review URL: http://codereview.chromium.org/437069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33344 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/buffered_resource_handler.h')
-rw-r--r--chrome/browser/renderer_host/buffered_resource_handler.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/chrome/browser/renderer_host/buffered_resource_handler.h b/chrome/browser/renderer_host/buffered_resource_handler.h
index 6bc34e1..3bed83a7 100644
--- a/chrome/browser/renderer_host/buffered_resource_handler.h
+++ b/chrome/browser/renderer_host/buffered_resource_handler.h
@@ -7,6 +7,7 @@
#include <string>
+#include "chrome/browser/plugin_service.h"
#include "chrome/browser/renderer_host/resource_handler.h"
class MessageLoop;
@@ -14,7 +15,8 @@ class ResourceDispatcherHost;
class URLRequest;
// Used to buffer a request until enough data has been received.
-class BufferedResourceHandler : public ResourceHandler {
+class BufferedResourceHandler : public ResourceHandler,
+ public PluginService::GetPluginListClient {
public:
BufferedResourceHandler(ResourceHandler* handler,
ResourceDispatcherHost* host,
@@ -63,11 +65,8 @@ class BufferedResourceHandler : public ResourceHandler {
// loaded.
bool ShouldDownload(bool* need_plugin_list);
- // Called on the file thread to load the list of plugins.
- void LoadPlugins();
-
// Called on the IO thread once the list of plugins has been loaded.
- void OnPluginsLoaded();
+ void OnGetPluginList(const std::vector<WebPluginInfo>& plugins);
scoped_refptr<ResourceHandler> real_handler_;
scoped_refptr<ResourceResponse> response_;