Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_NAVIGATION_THROTTLE_H_ | |
| 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_NAVIGATION_THROTTLE_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "content/public/browser/navigation_throttle.h" | |
| 12 | |
| 13 namespace page_load_metrics { | |
| 14 | |
| 15 // This class is used to forward calls to the MetricsWebContentsObserver. | |
| 16 // Namely, WillStartRequest() is called on NavigationThrottles, but not on | |
| 17 // WebContentsObservers. Data from the NavigationHandle accessed at this point | |
| 18 // is used to obtain more reliable abort metrics (like page transition type). | |
|
nasko
2016/08/01 15:29:22
Based on some poking I've done on separate CLs I'v
Charlie Harrison
2016/08/01 17:42:19
It is generally correct. There are some gotchas ar
| |
| 19 class MetricsNavigationThrottle : public content::NavigationThrottle { | |
| 20 public: | |
| 21 static std::unique_ptr<content::NavigationThrottle> Create( | |
| 22 content::NavigationHandle* handle); | |
| 23 ~MetricsNavigationThrottle() override; | |
| 24 | |
| 25 // content::NavigationThrottle: | |
| 26 content::NavigationThrottle::ThrottleCheckResult WillStartRequest() override; | |
| 27 | |
| 28 private: | |
| 29 explicit MetricsNavigationThrottle(content::NavigationHandle* handle); | |
| 30 | |
| 31 DISALLOW_COPY_AND_ASSIGN(MetricsNavigationThrottle); | |
| 32 }; | |
| 33 | |
| 34 } // namespace page_load_metrics | |
| 35 | |
| 36 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_NAVIGATION_THROTTLE_H_ | |
| OLD | NEW |