summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/buffered_resource_handler.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-15 00:04:01 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-15 00:04:01 +0000
commit35fa6a20ef621d22e6ba79e7306abad870cab4e4 (patch)
treed976dc15d9ac13976cb444cce875d5cbb790e102 /chrome/browser/renderer_host/buffered_resource_handler.h
parentb7a20d363af744159a2bb85bfe3db027d2d4819e (diff)
downloadchromium_src-35fa6a20ef621d22e6ba79e7306abad870cab4e4.zip
chromium_src-35fa6a20ef621d22e6ba79e7306abad870cab4e4.tar.gz
chromium_src-35fa6a20ef621d22e6ba79e7306abad870cab4e4.tar.bz2
Ensure we don't load plugins on the IO thread.
I had to move the locks from PluginService to PluginList, so that a lock (which can block other threads) isn't held while loading the plugins. BUG=17938 TEST=added asserts which crash if plugins loaded on IO thread, current UI tests exercise them Review URL: http://codereview.chromium.org/164305 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23501 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.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/buffered_resource_handler.h b/chrome/browser/renderer_host/buffered_resource_handler.h
index 3799b99..1a0af52 100644
--- a/chrome/browser/renderer_host/buffered_resource_handler.h
+++ b/chrome/browser/renderer_host/buffered_resource_handler.h
@@ -30,6 +30,7 @@ class BufferedResourceHandler : public ResourceHandler {
bool OnResponseCompleted(int request_id,
const URLRequestStatus& status,
const std::string& security_info);
+ void OnRequestClosed();
private:
// Returns true if we should delay OnResponseStarted forwarding.
@@ -49,6 +50,22 @@ class BufferedResourceHandler : public ResourceHandler {
// this is invoked from |OnResponseCompleted|.
bool CompleteResponseStarted(int request_id, bool in_complete);
+ // Returns true if we have to wait until the plugin list is generated.
+ bool ShouldWaitForPlugins();
+
+ // A test to determining whether the request should be forwarded to the
+ // download thread. If need_plugin_list was passed in and was set to true,
+ // that means that the check couldn't be fully done because the plugins aren't
+ // loaded. The function should be called again after the plugin list is
+ // 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();
+
scoped_refptr<ResourceHandler> real_handler_;
scoped_refptr<ResourceResponse> response_;
ResourceDispatcherHost* host_;
@@ -59,6 +76,7 @@ class BufferedResourceHandler : public ResourceHandler {
int bytes_read_;
bool sniff_content_;
bool should_buffer_;
+ bool wait_for_plugins_;
bool buffering_;
bool finished_;