OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 protocol_handlers)); | 291 protocol_handlers)); |
292 } | 292 } |
293 | 293 |
294 // ---------------------------------------------------------------------------- | 294 // ---------------------------------------------------------------------------- |
295 // ChromeURLRequestContext | 295 // ChromeURLRequestContext |
296 // ---------------------------------------------------------------------------- | 296 // ---------------------------------------------------------------------------- |
297 | 297 |
298 ChromeURLRequestContext::ChromeURLRequestContext( | 298 ChromeURLRequestContext::ChromeURLRequestContext( |
299 ContextType type, | 299 ContextType type, |
300 chrome_browser_net::LoadTimeStats* load_time_stats) | 300 chrome_browser_net::LoadTimeStats* load_time_stats) |
301 : load_time_stats_(load_time_stats) { | 301 : weak_factory_(this), |
| 302 load_time_stats_(load_time_stats) { |
302 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 303 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
303 if (load_time_stats_) | 304 if (load_time_stats_) |
304 load_time_stats_->RegisterURLRequestContext(this, type); | 305 load_time_stats_->RegisterURLRequestContext(this, type); |
305 } | 306 } |
306 | 307 |
307 ChromeURLRequestContext::~ChromeURLRequestContext() { | 308 ChromeURLRequestContext::~ChromeURLRequestContext() { |
308 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 309 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
309 if (load_time_stats_) | 310 if (load_time_stats_) |
310 load_time_stats_->UnregisterURLRequestContext(this); | 311 load_time_stats_->UnregisterURLRequestContext(this); |
311 } | 312 } |
312 | 313 |
313 void ChromeURLRequestContext::CopyFrom(ChromeURLRequestContext* other) { | 314 void ChromeURLRequestContext::CopyFrom(ChromeURLRequestContext* other) { |
314 URLRequestContext::CopyFrom(other); | 315 URLRequestContext::CopyFrom(other); |
315 | 316 |
316 // Copy ChromeURLRequestContext parameters. | 317 // Copy ChromeURLRequestContext parameters. |
317 } | 318 } |
OLD | NEW |