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

Side by Side Diff: chrome/browser/page_load_metrics/metrics_navigation_throttle.cc

Issue 2624283004: Associate a main resource request with its PageLoadTracker. (Closed)
Patch Set: fix comment Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/page_load_metrics/metrics_navigation_throttle.h" 5 #include "chrome/browser/page_load_metrics/metrics_navigation_throttle.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" 8 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h"
9 #include "content/public/browser/navigation_handle.h" 9 #include "content/public/browser/navigation_handle.h"
10 10
(...skipping 10 matching lines...) Expand all
21 content::NavigationThrottle::ThrottleCheckResult 21 content::NavigationThrottle::ThrottleCheckResult
22 MetricsNavigationThrottle::WillStartRequest() { 22 MetricsNavigationThrottle::WillStartRequest() {
23 MetricsWebContentsObserver* observer = 23 MetricsWebContentsObserver* observer =
24 MetricsWebContentsObserver::FromWebContents( 24 MetricsWebContentsObserver::FromWebContents(
25 navigation_handle()->GetWebContents()); 25 navigation_handle()->GetWebContents());
26 if (observer) 26 if (observer)
27 observer->WillStartNavigationRequest(navigation_handle()); 27 observer->WillStartNavigationRequest(navigation_handle());
28 return content::NavigationThrottle::PROCEED; 28 return content::NavigationThrottle::PROCEED;
29 } 29 }
30 30
31 content::NavigationThrottle::ThrottleCheckResult
32 MetricsNavigationThrottle::WillProcessResponse() {
33 MetricsWebContentsObserver* observer =
34 MetricsWebContentsObserver::FromWebContents(
35 navigation_handle()->GetWebContents());
36 if (observer)
37 observer->WillProcessNavigationResponse(navigation_handle());
38 return content::NavigationThrottle::PROCEED;
39 }
40
31 MetricsNavigationThrottle::MetricsNavigationThrottle( 41 MetricsNavigationThrottle::MetricsNavigationThrottle(
32 content::NavigationHandle* handle) 42 content::NavigationHandle* handle)
33 : content::NavigationThrottle(handle) {} 43 : content::NavigationThrottle(handle) {}
34 44
35 } // namespace page_load_metrics 45 } // namespace page_load_metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698