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

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

Issue 10736066: Adding histograms showing fraction of page load times (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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.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) {
« no previous file with comments | « chrome/browser/net/chrome_url_request_context.h ('k') | chrome/browser/profiles/off_the_record_profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698