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

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

Issue 2132603002: [page_load_metrics] Add a NavigationThrottle for richer abort metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More browser tests Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/page_load_metrics/browser/metrics_navigation_throttle.h"
6
7 #include "base/memory/ptr_util.h"
8 #include "components/page_load_metrics/browser/metrics_web_contents_observer.h"
9 #include "content/public/browser/navigation_handle.h"
10
11 namespace page_load_metrics {
12
13 // static
14 std::unique_ptr<content::NavigationThrottle> MetricsNavigationThrottle::Create(
15 content::NavigationHandle* handle) {
16 return base::WrapUnique(new MetricsNavigationThrottle(handle));
17 }
18
19 MetricsNavigationThrottle::~MetricsNavigationThrottle() {}
20
21 content::NavigationThrottle::ThrottleCheckResult
22 MetricsNavigationThrottle::WillStartRequest() {
23 MetricsWebContentsObserver* observer =
24 MetricsWebContentsObserver::FromWebContents(
25 navigation_handle()->GetWebContents());
26 if (observer)
Bryan McQuade 2016/07/12 16:45:29 just for my own knowledge, are there cases where w
Charlie Harrison 2016/07/12 19:20:22 There are some times when a web contents does not
27 observer->WillStartNavigationRequest(navigation_handle());
28 return content::NavigationThrottle::PROCEED;
29 }
30 content::NavigationThrottle::ThrottleCheckResult
31 MetricsNavigationThrottle::WillRedirectRequest() {
Bryan McQuade 2016/07/12 16:45:29 looks like the base class implementation is identi
Charlie Harrison 2016/07/12 19:20:22 Done.
32 return content::NavigationThrottle::PROCEED;
33 }
34
35 content::NavigationThrottle::ThrottleCheckResult
36 MetricsNavigationThrottle::WillProcessResponse() {
Bryan McQuade 2016/07/12 16:45:29 same - can we omit this?
Charlie Harrison 2016/07/12 19:20:22 Done.
37 return content::NavigationThrottle::PROCEED;
38 }
39
40 MetricsNavigationThrottle::MetricsNavigationThrottle(
41 content::NavigationHandle* handle)
42 : content::NavigationThrottle(handle) {}
43
44 } // namespace page_load_metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698