Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4465)

Unified Diff: chrome/browser/renderer_host/buffered_resource_handler.h

Issue 164305: Ensure we don't load plugins on the IO thread (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/plugin_service.cc ('k') | chrome/browser/renderer_host/buffered_resource_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/buffered_resource_handler.h
===================================================================
--- chrome/browser/renderer_host/buffered_resource_handler.h (revision 23449)
+++ chrome/browser/renderer_host/buffered_resource_handler.h (working copy)
@@ -30,6 +30,7 @@
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 @@
// 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 @@
int bytes_read_;
bool sniff_content_;
bool should_buffer_;
+ bool wait_for_plugins_;
bool buffering_;
bool finished_;
« no previous file with comments | « chrome/browser/plugin_service.cc ('k') | chrome/browser/renderer_host/buffered_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698