OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/net/chrome_url_request_context.h" | 5 #include "chrome/browser/net/chrome_url_request_context.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 } // namespace | 112 } // namespace |
113 | 113 |
114 // ---------------------------------------------------------------------------- | 114 // ---------------------------------------------------------------------------- |
115 // ChromeURLRequestContextGetter | 115 // ChromeURLRequestContextGetter |
116 // ---------------------------------------------------------------------------- | 116 // ---------------------------------------------------------------------------- |
117 | 117 |
118 ChromeURLRequestContextGetter::ChromeURLRequestContextGetter( | 118 ChromeURLRequestContextGetter::ChromeURLRequestContextGetter( |
119 Profile* profile, | 119 Profile* profile, |
120 ChromeURLRequestContextFactory* factory) | 120 ChromeURLRequestContextFactory* factory) |
121 : io_thread_(g_browser_process->io_thread()), | 121 : factory_(factory) { |
122 factory_(factory) { | |
123 DCHECK(factory); | 122 DCHECK(factory); |
124 DCHECK(profile); | 123 DCHECK(profile); |
125 RegisterPrefsObserver(profile); | 124 RegisterPrefsObserver(profile); |
126 } | 125 } |
127 | 126 |
128 ChromeURLRequestContextGetter::~ChromeURLRequestContextGetter() { | 127 ChromeURLRequestContextGetter::~ChromeURLRequestContextGetter() { |
129 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 128 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
130 | 129 |
131 DCHECK(registrar_.IsEmpty()) << "Probably didn't call CleanupOnUIThread"; | 130 DCHECK(registrar_.IsEmpty()) << "Probably didn't call CleanupOnUIThread"; |
132 } | 131 } |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 net::HttpUtil::GenerateAcceptLanguageHeader(accept_language)); | 387 net::HttpUtil::GenerateAcceptLanguageHeader(accept_language)); |
389 } | 388 } |
390 | 389 |
391 void ChromeURLRequestContext::OnDefaultCharsetChange( | 390 void ChromeURLRequestContext::OnDefaultCharsetChange( |
392 const std::string& default_charset) { | 391 const std::string& default_charset) { |
393 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 392 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
394 set_referrer_charset(default_charset); | 393 set_referrer_charset(default_charset); |
395 set_accept_charset( | 394 set_accept_charset( |
396 net::HttpUtil::GenerateAcceptCharsetHeader(default_charset)); | 395 net::HttpUtil::GenerateAcceptCharsetHeader(default_charset)); |
397 } | 396 } |
OLD | NEW |