diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-05 18:14:49 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-05 18:14:49 +0000 |
commit | 363119947a1e9111c19c326a2844bc60a29fabba (patch) | |
tree | a008f948a2591ffec99b7b25040d6c74815b6a01 /chrome/browser/renderer_host/resource_dispatcher_host.h | |
parent | 4f67d8a72d73ca17ae35434e3301e708fddd2970 (diff) | |
download | chromium_src-363119947a1e9111c19c326a2844bc60a29fabba.zip chromium_src-363119947a1e9111c19c326a2844bc60a29fabba.tar.gz chromium_src-363119947a1e9111c19c326a2844bc60a29fabba.tar.bz2 |
Implement delaying resource requests until privacy blacklists are ready.
Associate a BlacklistRequestInfo with each URLRequest started by ResourceDispatcherHost so that in various places we get access to the right BlacklistManager (each Profile has its own), and lazily cache a Blacklist::Match.
BlacklistListener controls delaying requests until the privacy blacklist is ready for the request.
BlacklistInterceptor handles substituting real response with a blocking page or blocking image. I've temporarily removed support for unblocking things. It was too hacky.
This change also removes a large block of blacklist-related code from RDH to more focused classes. Should make it a little more readable.
This should also make BlacklistManagerBrowserTest not flaky.
TEST=Covered by browser_tests and unit_tests.
BUG=21541, 29113
Review URL: http://codereview.chromium.org/501082
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35538 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/resource_dispatcher_host.h')
-rw-r--r-- | chrome/browser/renderer_host/resource_dispatcher_host.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.h b/chrome/browser/renderer_host/resource_dispatcher_host.h index 3dba767..da043eb 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.h +++ b/chrome/browser/renderer_host/resource_dispatcher_host.h @@ -22,12 +22,13 @@ #include "base/process.h" #include "base/timer.h" #include "chrome/common/child_process_info.h" -#include "chrome/browser/privacy_blacklist/blocked_response.h" +#include "chrome/browser/privacy_blacklist/blacklist_interceptor.h" #include "chrome/browser/renderer_host/resource_queue.h" #include "ipc/ipc_message.h" #include "net/url_request/url_request.h" #include "webkit/glue/resource_type.h" +class BlacklistListener; class CrossSiteResourceHandler; class DownloadFileManager; class DownloadRequestManager; @@ -409,6 +410,13 @@ class ResourceDispatcherHost : public URLRequest::Delegate { // We own the save file manager. scoped_refptr<SaveFileManager> save_file_manager_; + // Handles requests blocked by privacy blacklists. + BlacklistInterceptor blacklist_interceptor_; + + // Makes sure that each request is reliably checked against the privacy + // blacklist. + scoped_refptr<BlacklistListener> blacklist_listener_; + scoped_refptr<UserScriptListener> user_script_listener_; scoped_refptr<SafeBrowsingService> safe_browsing_; @@ -459,9 +467,6 @@ class ResourceDispatcherHost : public URLRequest::Delegate { // to the source of the message. Receiver* receiver_; - // Keeps track of elements blocked by the Privacy Blacklist. - chrome::BlockedResponse blocked_; - DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHost); }; |