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

Side by Side Diff: content/browser/loader/resource_loader.cc

Issue 2944033002: PlzNavigate: improve bf navigations metrics (Closed)
Patch Set: Addressed comments Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/browser/loader/resource_loader.h" 5 #include "content/browser/loader/resource_loader.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 scoped_refptr<ResourceResponse> response = new ResourceResponse(); 644 scoped_refptr<ResourceResponse> response = new ResourceResponse();
645 PopulateResourceResponse(info, request_.get(), response.get()); 645 PopulateResourceResponse(info, request_.get(), response.get());
646 646
647 delegate_->DidReceiveResponse(this, response.get()); 647 delegate_->DidReceiveResponse(this, response.get());
648 648
649 // For back-forward navigations, record metrics. 649 // For back-forward navigations, record metrics.
650 // TODO(clamy): Remove once we understand the root cause behind the regression 650 // TODO(clamy): Remove once we understand the root cause behind the regression
651 // of PLT for b/f navigations in PlzNavigate. 651 // of PLT for b/f navigations in PlzNavigate.
652 if ((info->GetPageTransition() & ui::PAGE_TRANSITION_FORWARD_BACK) && 652 if ((info->GetPageTransition() & ui::PAGE_TRANSITION_FORWARD_BACK) &&
653 IsResourceTypeFrame(info->GetResourceType()) && 653 IsResourceTypeFrame(info->GetResourceType()) &&
654 !request_->url().SchemeIsBlob()) { 654 request_->url().SchemeIsHTTPOrHTTPS()) {
655 UMA_HISTOGRAM_BOOLEAN("Navigation.BackForward.WasCached", 655 UMA_HISTOGRAM_BOOLEAN("Navigation.BackForward.WasCached",
656 request_->was_cached()); 656 request_->was_cached());
657 } 657 }
658 658
659 read_deferral_start_time_ = base::TimeTicks::Now(); 659 read_deferral_start_time_ = base::TimeTicks::Now();
660 // Using a ScopedDeferral here would result in calling ReadMore(true) on sync 660 // Using a ScopedDeferral here would result in calling ReadMore(true) on sync
661 // success. Calling PrepareToReadMore(false) here instead allows small 661 // success. Calling PrepareToReadMore(false) here instead allows small
662 // responses to be handled completely synchronously, if no ResourceHandler 662 // responses to be handled completely synchronously, if no ResourceHandler
663 // defers handling of the response. 663 // defers handling of the response.
664 deferred_stage_ = DEFERRED_SYNC; 664 deferred_stage_ = DEFERRED_SYNC;
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", prefetch_status, 817 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", prefetch_status,
818 STATUS_MAX); 818 STATUS_MAX);
819 } 819 }
820 } else if (request_->response_info().unused_since_prefetch) { 820 } else if (request_->response_info().unused_since_prefetch) {
821 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time(); 821 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time();
822 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time); 822 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time);
823 } 823 }
824 } 824 }
825 825
826 } // namespace content 826 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698