| Index: components/page_load_metrics/browser/metrics_navigation_throttle.h
|
| diff --git a/components/page_load_metrics/browser/metrics_navigation_throttle.h b/components/page_load_metrics/browser/metrics_navigation_throttle.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1f39b7947cc5436f9753a64ac2e867469780b213
|
| --- /dev/null
|
| +++ b/components/page_load_metrics/browser/metrics_navigation_throttle.h
|
| @@ -0,0 +1,36 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_NAVIGATION_THROTTLE_H_
|
| +#define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_NAVIGATION_THROTTLE_H_
|
| +
|
| +#include <memory>
|
| +
|
| +#include "base/macros.h"
|
| +#include "content/public/browser/navigation_throttle.h"
|
| +
|
| +namespace page_load_metrics {
|
| +
|
| +// This class is used to forward calls to the MetricsWebContentsObserver.
|
| +// Namely, WillStartRequest() is called on NavigationThrottles, but not on
|
| +// WebContentsObservers. Data from the NavigationHandle accessed at this point
|
| +// is used to obtain more reliable abort metrics (like page transition type).
|
| +class MetricsNavigationThrottle : public content::NavigationThrottle {
|
| + public:
|
| + static std::unique_ptr<content::NavigationThrottle> Create(
|
| + content::NavigationHandle* handle);
|
| + ~MetricsNavigationThrottle() override;
|
| +
|
| + // content::NavigationThrottle:
|
| + content::NavigationThrottle::ThrottleCheckResult WillStartRequest() override;
|
| +
|
| + private:
|
| + explicit MetricsNavigationThrottle(content::NavigationHandle* handle);
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(MetricsNavigationThrottle);
|
| +};
|
| +
|
| +} // namespace page_load_metrics
|
| +
|
| +#endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_NAVIGATION_THROTTLE_H_
|
|
|