Index: chrome/browser/net/chrome_url_request_context.cc |
=================================================================== |
--- chrome/browser/net/chrome_url_request_context.cc (revision 148459) |
+++ chrome/browser/net/chrome_url_request_context.cc (working copy) |
@@ -10,6 +10,7 @@ |
#include "base/message_loop_proxy.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/io_thread.h" |
+#include "chrome/browser/net/cache_stats.h" |
#include "chrome/browser/prefs/pref_service.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/profiles/profile_io_data.h" |
@@ -290,14 +291,21 @@ |
// ChromeURLRequestContext |
// ---------------------------------------------------------------------------- |
-ChromeURLRequestContext::ChromeURLRequestContext() |
+ChromeURLRequestContext::ChromeURLRequestContext( |
+ ContextType type, |
+ chrome_browser_net::CacheStats* cache_stats) |
: ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), |
- is_incognito_(false) { |
+ is_incognito_(false), |
+ cache_stats_(cache_stats) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
+ if (cache_stats_) |
+ cache_stats_->RegisterURLRequestContext(this, type); |
} |
ChromeURLRequestContext::~ChromeURLRequestContext() { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
+ if (cache_stats_) |
+ cache_stats_->UnregisterURLRequestContext(this); |
} |
void ChromeURLRequestContext::CopyFrom(ChromeURLRequestContext* other) { |