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_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 } | 270 } |
271 | 271 |
272 // ---------------------------------------------------------------------------- | 272 // ---------------------------------------------------------------------------- |
273 // ChromeURLRequestContext | 273 // ChromeURLRequestContext |
274 // ---------------------------------------------------------------------------- | 274 // ---------------------------------------------------------------------------- |
275 | 275 |
276 ChromeURLRequestContext::ChromeURLRequestContext( | 276 ChromeURLRequestContext::ChromeURLRequestContext( |
277 ContextType type, | 277 ContextType type, |
278 chrome_browser_net::LoadTimeStats* load_time_stats) | 278 chrome_browser_net::LoadTimeStats* load_time_stats) |
279 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), | 279 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), |
280 is_incognito_(false), | |
281 load_time_stats_(load_time_stats) { | 280 load_time_stats_(load_time_stats) { |
282 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 281 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
283 if (load_time_stats_) | 282 if (load_time_stats_) |
284 load_time_stats_->RegisterURLRequestContext(this, type); | 283 load_time_stats_->RegisterURLRequestContext(this, type); |
285 } | 284 } |
286 | 285 |
287 ChromeURLRequestContext::~ChromeURLRequestContext() { | 286 ChromeURLRequestContext::~ChromeURLRequestContext() { |
288 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 287 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
289 if (load_time_stats_) | 288 if (load_time_stats_) |
290 load_time_stats_->UnregisterURLRequestContext(this); | 289 load_time_stats_->UnregisterURLRequestContext(this); |
291 } | 290 } |
292 | 291 |
293 void ChromeURLRequestContext::CopyFrom(ChromeURLRequestContext* other) { | 292 void ChromeURLRequestContext::CopyFrom(ChromeURLRequestContext* other) { |
294 URLRequestContext::CopyFrom(other); | 293 URLRequestContext::CopyFrom(other); |
295 | 294 |
296 // Copy ChromeURLRequestContext parameters. | 295 // Copy ChromeURLRequestContext parameters. |
297 set_is_incognito(other->is_incognito()); | |
298 } | 296 } |
OLD | NEW |