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

Unified Diff: content/browser/loader/resource_loader.cc

Issue 15211004: Add histogram to measure the read deferral on crosswebsite navigation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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: content/browser/loader/resource_loader.cc
diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc
index 63195120388f9192f002504600611ac05d3dfe73..9ed51a38cbe6697657574f9a69b81ce611c362e7 100644
--- a/content/browser/loader/resource_loader.cc
+++ b/content/browser/loader/resource_loader.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/message_loop.h"
+#include "base/metrics/histogram.h"
#include "base/time.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/loader/doomed_resource_handler.h"
@@ -213,6 +214,7 @@ void ResourceLoader::Init(scoped_ptr<net::URLRequest> request,
delegate_ = delegate;
last_upload_position_ = 0;
waiting_for_upload_progress_ack_ = false;
+ compute_read_deferral_histogram_ = false;
is_transferring_ = false;
client_cert_store_ = client_cert_store.Pass();
@@ -362,8 +364,11 @@ void ResourceLoader::OnResponseStarted(net::URLRequest* unused) {
CompleteResponseStarted();
- if (is_deferred())
+ if (is_deferred()) {
+ compute_read_deferral_histogram_ = true;
pasko 2013/05/21 16:37:51 I think reflecting the state rather than intention
James Simonsen 2013/08/01 19:17:40 I don't think you need this bool at all. Just chec
clamy 2013/08/05 14:33:44 Done.
+ deferral_time_ = base::TimeTicks::Now();
pasko 2013/05/21 16:37:51 this would sound more logical with the name respon
return;
+ }
if (request_->status().is_success()) {
StartReading(false); // Read the first chunk.
@@ -585,6 +590,11 @@ void ResourceLoader::StartReading(bool is_continuation) {
void ResourceLoader::ResumeReading() {
DCHECK(!is_deferred());
+ if (compute_read_deferral_histogram_) {
+ compute_read_deferral_histogram_ = false;
+ UMA_HISTOGRAM_TIMES("Net.ResourceLoader.ReadDeferral",
pasko 2013/05/21 16:37:51 please also add a pairing change in: tools/metrics
+ base::TimeTicks::Now() - deferral_time_);
+ }
if (request_->status().is_success()) {
StartReading(false); // Read the next chunk (OK to complete synchronously).
} else {
« content/browser/loader/resource_loader.h ('K') | « content/browser/loader/resource_loader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698