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

Unified Diff: chrome/browser/page_load_metrics/metrics_navigation_throttle.h

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: nasko@ nits Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/page_load_metrics/metrics_navigation_throttle.h
diff --git a/chrome/browser/page_load_metrics/metrics_navigation_throttle.h b/chrome/browser/page_load_metrics/metrics_navigation_throttle.h
new file mode 100644
index 0000000000000000000000000000000000000000..64a3ebfa4fe03b698cec14d76dfb40e21f3ecef4
--- /dev/null
+++ b/chrome/browser/page_load_metrics/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 CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_NAVIGATION_THROTTLE_H_
+#define CHROME_BROWSER_PAGE_LOAD_METRICS_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 // CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_NAVIGATION_THROTTLE_H_
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/page_load_metrics/metrics_navigation_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698