summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net
diff options
context:
space:
mode:
authoramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-30 21:37:04 +0000
committeramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-30 21:37:04 +0000
commita8af771d9040b87f64b3a85131cfa0e265ac5639 (patch)
tree6cd5020fcda0b6616be7fec09bd2307743763fc0 /chrome/browser/net
parent23cc9a18ab9c4893e3cad94c3683e7ffecefcbf0 (diff)
downloadchromium_src-a8af771d9040b87f64b3a85131cfa0e265ac5639.zip
chromium_src-a8af771d9040b87f64b3a85131cfa0e265ac5639.tar.gz
chromium_src-a8af771d9040b87f64b3a85131cfa0e265ac5639.tar.bz2
ChromeURLRequestContext fallout
Fix the issues caused by static_cast<ChromeURLRequestContext*>. There were assumptions in the code that a URLRequestContext* will always be ChromeURLRequestContext* and resulting 'static_cast's. This assumption is no longer true. Instead, URLlRequestContext now has a member GetChromeURLRequestContext that returns a ChromeURLRequestContext* if it really that type. BUG=none TEST=none Review URL: http://codereview.chromium.org/160332 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22104 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc23
-rw-r--r--chrome/browser/net/chrome_url_request_context.h3
2 files changed, 25 insertions, 1 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index 7130b45..f6df4a2 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -324,6 +324,29 @@ ChromeURLRequestContext::ChromeURLRequestContext(Profile* profile)
}
}
+ChromeURLRequestContext::ChromeURLRequestContext(
+ ChromeURLRequestContext* other) {
+ // Set URLRequestContext members
+ host_resolver_ = other->host_resolver_;
+ proxy_service_ = other->proxy_service_;
+ http_transaction_factory_ = other->http_transaction_factory_;
+ ftp_transaction_factory_ = other->ftp_transaction_factory_;
+ cookie_store_ = other->cookie_store_;
+ cookie_policy_.set_type(other->cookie_policy_.type());
+ force_tls_state_ = other->force_tls_state_;
+ accept_language_ = other->accept_language_;
+ accept_charset_ = other->accept_charset_;
+ referrer_charset_ = other->referrer_charset_;
+
+ // Set ChromeURLRequestContext members
+ extension_paths_ = other->extension_paths_;
+ user_script_dir_path_ = other->user_script_dir_path_;
+ prefs_ = other->prefs_;
+ blacklist_ = other->blacklist_;
+ is_media_ = other->is_media_;
+ is_off_the_record_ = other->is_off_the_record_;
+}
+
// NotificationObserver implementation.
void ChromeURLRequestContext::Observe(NotificationType type,
const NotificationSource& source,
diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h
index debee5c..f4baea6 100644
--- a/chrome/browser/net/chrome_url_request_context.h
+++ b/chrome/browser/net/chrome_url_request_context.h
@@ -74,10 +74,11 @@ class ChromeURLRequestContext : public URLRequestContext,
// Gets the Privacy Blacklist, if any for this context.
const Blacklist* blacklist() const { return blacklist_; }
-private:
+ protected:
// Private constructor, use the static factory methods instead. This is
// expected to be called on the UI thread.
ChromeURLRequestContext(Profile* profile);
+ ChromeURLRequestContext(ChromeURLRequestContext* other);
// Create a request context for media resources from a regular request
// context. This helper method is called from CreateOriginalForMedia and