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

Unified Diff: chrome/browser/net/chrome_url_request_context.h

Issue 10918279: Provide mutable members of UrlRequestContext via pure-virtual interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add TODO Created 8 years, 2 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
Index: chrome/browser/net/chrome_url_request_context.h
diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h
index 16fdbb9d1850b32879bce573a6c5698dc4f9c863..5fc9e207d8321b5e44142435e14ed70b21048a1a 100644
--- a/chrome/browser/net/chrome_url_request_context.h
+++ b/chrome/browser/net/chrome_url_request_context.h
@@ -8,9 +8,6 @@
#include <string>
#include "base/memory/scoped_ptr.h"
-#include "base/prefs/public/pref_change_registrar.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_job_factory.h"
@@ -53,8 +50,6 @@ class ChromeURLRequestContext : public net::URLRequestContext {
return is_incognito_;
}
- virtual const std::string& GetUserAgent(const GURL& url) const OVERRIDE;
-
// TODO(willchan): Get rid of the need for this accessor. Really, this should
// move completely to ProfileIOData.
ChromeURLDataManagerBackend* chrome_url_data_manager_backend() const;
@@ -66,12 +61,6 @@ class ChromeURLRequestContext : public net::URLRequestContext {
void set_chrome_url_data_manager_backend(
ChromeURLDataManagerBackend* backend);
- // Callback for when the accept language changes.
- void OnAcceptLanguageChange(const std::string& accept_language);
-
- // Callback for when the default charset changes.
- void OnDefaultCharsetChange(const std::string& default_charset);
-
private:
base::WeakPtrFactory<ChromeURLRequestContext> weak_factory_;
@@ -98,16 +87,12 @@ class ChromeURLRequestContext : public net::URLRequestContext {
//
// Most methods are expected to be called on the UI thread, except for
// the destructor and GetURLRequestContext().
-class ChromeURLRequestContextGetter : public net::URLRequestContextGetter,
- public content::NotificationObserver {
+class ChromeURLRequestContextGetter : public net::URLRequestContextGetter {
public:
// Constructs a ChromeURLRequestContextGetter that will use |factory| to
- // create the ChromeURLRequestContext. If |profile| is non-NULL, then the
- // ChromeURLRequestContextGetter will additionally watch the preferences for
- // changes to charset/language and CleanupOnUIThread() will need to be
- // called to unregister.
- ChromeURLRequestContextGetter(Profile* profile,
- ChromeURLRequestContextFactory* factory);
+ // create the ChromeURLRequestContext.
+ explicit ChromeURLRequestContextGetter(
+ ChromeURLRequestContextFactory* factory);
// Note that GetURLRequestContext() can only be called from the IO
// thread (it will assert otherwise).
@@ -176,30 +161,9 @@ class ChromeURLRequestContextGetter : public net::URLRequestContextGetter,
scoped_ptr<net::URLRequestJobFactory::Interceptor>
protocol_handler_interceptor);
- // Clean up UI thread resources. This is expected to get called on the UI
- // thread before the instance is deleted on the IO thread.
- void CleanupOnUIThread();
-
- // content::NotificationObserver implementation.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
private:
- // Must be called on the IO thread.
virtual ~ChromeURLRequestContextGetter();
- // Registers an observer on |profile|'s preferences which will be used
- // to update the context when the default language and charset change.
- void RegisterPrefsObserver(Profile* profile);
-
- // These methods simply forward to the corresponding method on
- // ChromeURLRequestContext.
- void OnAcceptLanguageChange(const std::string& accept_language);
- void OnDefaultCharsetChange(const std::string& default_charset);
-
- PrefChangeRegistrar registrar_;
-
// Deferred logic for creating a ChromeURLRequestContext.
// Access only from the IO thread.
scoped_ptr<ChromeURLRequestContextFactory> factory_;

Powered by Google App Engine
This is Rietveld 408576698