summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoridanan@chromium.org <idanan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-28 19:41:36 +0000
committeridanan@chromium.org <idanan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-28 19:41:36 +0000
commitd0a96b6e4e7cc643c2af3c9ff434edb7ff2be2f3 (patch)
treec34cfdc608065a3ad4b4cebd43d891a7da99656f
parent294202d3462e9cf80c71b71a75a004844ee892b0 (diff)
downloadchromium_src-d0a96b6e4e7cc643c2af3c9ff434edb7ff2be2f3.zip
chromium_src-d0a96b6e4e7cc643c2af3c9ff434edb7ff2be2f3.tar.gz
chromium_src-d0a96b6e4e7cc643c2af3c9ff434edb7ff2be2f3.tar.bz2
Moved the logical dependency on Blacklist from URLRequestContext
to ChromeURLRequestContext. BUG=16932 TEST=none Review URL: http://codereview.chromium.org/159519 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21874 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/automation/automation_profile_impl.cc1
-rw-r--r--chrome/browser/net/chrome_url_request_context.h8
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host.cc8
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc6
-rw-r--r--net/url_request/url_request_context.h8
5 files changed, 17 insertions, 14 deletions
diff --git a/chrome/browser/automation/automation_profile_impl.cc b/chrome/browser/automation/automation_profile_impl.cc
index 51923ae..02e2cc1 100644
--- a/chrome/browser/automation/automation_profile_impl.cc
+++ b/chrome/browser/automation/automation_profile_impl.cc
@@ -21,7 +21,6 @@ class AutomationURLRequestContext : public URLRequestContext {
cookie_policy_.set_type(original_context->cookie_policy()->type());
force_tls_state_ = original_context->force_tls_state();
// ftp_auth_cache_ = original_context->ftp_auth_cache();
- blacklist_ = original_context->blacklist();
accept_language_ = original_context->accept_language();
accept_charset_ = original_context->accept_charset();
referrer_charset_ = original_context->referrer_charset();
diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h
index 9dc0393..debee5c 100644
--- a/chrome/browser/net/chrome_url_request_context.h
+++ b/chrome/browser/net/chrome_url_request_context.h
@@ -8,8 +8,10 @@
#include "chrome/common/pref_service.h"
#include "net/url_request/url_request_context.h"
-class Profile;
+class Blacklist;
class CommandLine;
+class Profile;
+
namespace net {
class ProxyConfig;
}
@@ -69,6 +71,9 @@ class ChromeURLRequestContext : public URLRequestContext,
virtual bool AllowSendingCookies(const URLRequest* request) const;
+ // Gets the Privacy Blacklist, if any for this context.
+ const Blacklist* blacklist() const { return blacklist_; }
+
private:
// Private constructor, use the static factory methods instead. This is
// expected to be called on the UI thread.
@@ -114,6 +119,7 @@ private:
scoped_ptr<SQLitePersistentCookieStore> cookie_db_;
PrefService* prefs_;
+ const Blacklist* blacklist_;
bool is_media_;
bool is_off_the_record_;
};
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc
index 0ea39ca..a626f06 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc
@@ -22,6 +22,7 @@
#include "chrome/browser/download/save_file_manager.h"
#include "chrome/browser/external_protocol_handler.h"
#include "chrome/browser/in_process_webkit/webkit_thread.h"
+#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/plugin_service.h"
#include "chrome/browser/privacy_blacklist/blacklist.h"
#include "chrome/browser/profile.h"
@@ -364,10 +365,11 @@ void ResourceDispatcherHost::BeginRequest(
int route_id) {
ChildProcessInfo::ProcessType process_type = receiver_->type();
int process_id = receiver_->GetProcessId();
- URLRequestContext* context =
- receiver_->GetRequestContext(request_id, request_data);
+ ChromeURLRequestContext* context = static_cast<ChromeURLRequestContext*>(
+ receiver_->GetRequestContext(request_id, request_data));
if (!context)
- context = Profile::GetDefaultRequestContext();
+ context = static_cast<ChromeURLRequestContext*>(
+ Profile::GetDefaultRequestContext());
if (is_shutdown_ ||
!ShouldServiceRequest(process_type, process_id, request_data)) {
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index 5cb59a1..be61cf3 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/extensions/extension_message_service.h"
#include "chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h"
+#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/net/dns_global.h"
#include "chrome/browser/plugin_service.h"
#include "chrome/browser/profile.h"
@@ -434,8 +435,9 @@ void ResourceMessageFilter::OnMsgCreateWidget(int opener_id,
void ResourceMessageFilter::OnSetCookie(const GURL& url,
const GURL& first_party_for_cookies,
const std::string& cookie) {
- URLRequestContext* context = url.SchemeIs(chrome::kExtensionScheme) ?
- extensions_request_context_.get() : request_context_.get();
+ ChromeURLRequestContext* context = static_cast<ChromeURLRequestContext*>(
+ url.SchemeIs(chrome::kExtensionScheme) ?
+ extensions_request_context_.get() : request_context_.get());
if (context->cookie_policy()->CanSetCookie(url, first_party_for_cookies)) {
if (context->blacklist()) {
Blacklist::Match* match = context->blacklist()->findMatch(url);
diff --git a/net/url_request/url_request_context.h b/net/url_request/url_request_context.h
index 3682112..63ab217 100644
--- a/net/url_request/url_request_context.h
+++ b/net/url_request/url_request_context.h
@@ -23,7 +23,6 @@ class FtpTransactionFactory;
class HttpTransactionFactory;
class ProxyService;
}
-class Blacklist;
class URLRequest;
// Subclass to provide application-specific context for URLRequest instances.
@@ -36,8 +35,7 @@ class URLRequestContext :
http_transaction_factory_(NULL),
ftp_transaction_factory_(NULL),
cookie_store_(NULL),
- force_tls_state_(NULL),
- blacklist_(NULL) {
+ force_tls_state_(NULL) {
}
net::HostResolver* host_resolver() const {
@@ -70,9 +68,6 @@ class URLRequestContext :
// Gets the FTP authentication cache for this context.
net::FtpAuthCache* ftp_auth_cache() { return &ftp_auth_cache_; }
- // Gets the Privacy Blacklist, if any for this context.
- const Blacklist* blacklist() { return blacklist_; }
-
// Gets the value of 'Accept-Charset' header field.
const std::string& accept_charset() const { return accept_charset_; }
@@ -121,7 +116,6 @@ class URLRequestContext :
net::CookiePolicy cookie_policy_;
net::ForceTLSState* force_tls_state_;;
net::FtpAuthCache ftp_auth_cache_;
- const Blacklist* blacklist_;
std::string accept_language_;
std::string accept_charset_;
// The charset of the referrer where this request comes from. It's not