| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_UKM_PAGE_LOAD_METRICS_OBSERVE
R_H_ | 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_UKM_PAGE_LOAD_METRICS_OBSERVE
R_H_ |
| 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_UKM_PAGE_LOAD_METRICS_OBSERVE
R_H_ | 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_UKM_PAGE_LOAD_METRICS_OBSERVE
R_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/optional.h" |
| 10 #include "base/time/time.h" |
| 9 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" | 11 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" |
| 10 #include "net/nqe/network_quality_estimator.h" | 12 #include "net/nqe/network_quality_estimator.h" |
| 11 #include "ui/base/page_transition_types.h" | 13 #include "ui/base/page_transition_types.h" |
| 12 | 14 |
| 13 namespace content { | 15 namespace content { |
| 14 class WebContents; | 16 class WebContents; |
| 15 } | 17 } |
| 16 | 18 |
| 17 namespace internal { | 19 namespace internal { |
| 18 | 20 |
| 19 // Name constants are exposed here so they can be referenced from tests. | 21 // Name constants are exposed here so they can be referenced from tests. |
| 20 extern const char kUkmPageLoadEventName[]; | 22 extern const char kUkmPageLoadEventName[]; |
| 21 extern const char kUkmParseStartName[]; | 23 extern const char kUkmParseStartName[]; |
| 22 extern const char kUkmDomContentLoadedName[]; | 24 extern const char kUkmDomContentLoadedName[]; |
| 23 extern const char kUkmLoadEventName[]; | 25 extern const char kUkmLoadEventName[]; |
| 24 extern const char kUkmFirstContentfulPaintName[]; | 26 extern const char kUkmFirstContentfulPaintName[]; |
| 25 extern const char kUkmFirstMeaningfulPaintName[]; | 27 extern const char kUkmFirstMeaningfulPaintName[]; |
| 26 extern const char kUkmForegroundDurationName[]; | 28 extern const char kUkmForegroundDurationName[]; |
| 27 extern const char kUkmFailedProvisionaLoadName[]; | 29 extern const char kUkmFailedProvisionaLoadName[]; |
| 28 extern const char kUkmNetErrorCode[]; | 30 extern const char kUkmNetErrorCode[]; |
| 29 extern const char kUkmEffectiveConnectionType[]; | 31 extern const char kUkmEffectiveConnectionType[]; |
| 32 extern const char kUkmHttpRttEstimate[]; |
| 33 extern const char kUkmTransportRttEstimate[]; |
| 30 extern const char kUkmPageTransition[]; | 34 extern const char kUkmPageTransition[]; |
| 31 | 35 |
| 32 } // namespace internal | 36 } // namespace internal |
| 33 | 37 |
| 34 // If URL-Keyed-Metrics (UKM) is enabled in the system, this is used to | 38 // If URL-Keyed-Metrics (UKM) is enabled in the system, this is used to |
| 35 // populate it with top-level page-load metrics. | 39 // populate it with top-level page-load metrics. |
| 36 class UkmPageLoadMetricsObserver | 40 class UkmPageLoadMetricsObserver |
| 37 : public page_load_metrics::PageLoadMetricsObserver { | 41 : public page_load_metrics::PageLoadMetricsObserver { |
| 38 public: | 42 public: |
| 39 // Returns a UkmPageLoadMetricsObserver, or nullptr if it is not needed. | 43 // Returns a UkmPageLoadMetricsObserver, or nullptr if it is not needed. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 void RecordPageLoadExtraInfoMetrics( | 82 void RecordPageLoadExtraInfoMetrics( |
| 79 const page_load_metrics::PageLoadExtraInfo& info, | 83 const page_load_metrics::PageLoadExtraInfo& info, |
| 80 base::TimeTicks app_background_time); | 84 base::TimeTicks app_background_time); |
| 81 | 85 |
| 82 net::NetworkQualityEstimator::NetworkQualityProvider* const | 86 net::NetworkQualityEstimator::NetworkQualityProvider* const |
| 83 network_quality_provider_; | 87 network_quality_provider_; |
| 84 | 88 |
| 85 // Unique UKM identifier for the page load we are recording metrics for. | 89 // Unique UKM identifier for the page load we are recording metrics for. |
| 86 const int32_t source_id_; | 90 const int32_t source_id_; |
| 87 | 91 |
| 92 // Network quality estimates. |
| 88 net::EffectiveConnectionType effective_connection_type_ = | 93 net::EffectiveConnectionType effective_connection_type_ = |
| 89 net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN; | 94 net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN; |
| 95 base::Optional<base::TimeDelta> http_rtt_estimate_; |
| 96 base::Optional<base::TimeDelta> transport_rtt_estimate_; |
| 90 | 97 |
| 91 // PAGE_TRANSITION_LINK is the default PageTransition value. | 98 // PAGE_TRANSITION_LINK is the default PageTransition value. |
| 92 ui::PageTransition page_transition_ = ui::PAGE_TRANSITION_LINK; | 99 ui::PageTransition page_transition_ = ui::PAGE_TRANSITION_LINK; |
| 93 | 100 |
| 94 DISALLOW_COPY_AND_ASSIGN(UkmPageLoadMetricsObserver); | 101 DISALLOW_COPY_AND_ASSIGN(UkmPageLoadMetricsObserver); |
| 95 }; | 102 }; |
| 96 | 103 |
| 97 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_UKM_PAGE_LOAD_METRICS_OBSE
RVER_H_ | 104 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_UKM_PAGE_LOAD_METRICS_OBSE
RVER_H_ |
| OLD | NEW |