| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_METRICS_WEB_CONTENTS_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ | 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // ABORT_OTHER, and the |abort_cause_time| is within a sufficiently close | 194 // ABORT_OTHER, and the |abort_cause_time| is within a sufficiently close |
| 195 // delta to when it was aborted. Note that only provisional loads can be | 195 // delta to when it was aborted. Note that only provisional loads can be |
| 196 // aborted with ABORT_OTHER. While this heuristic is coarse, it works better | 196 // aborted with ABORT_OTHER. While this heuristic is coarse, it works better |
| 197 // and is simpler than other feasible methods. See https://goo.gl/WKRG98. | 197 // and is simpler than other feasible methods. See https://goo.gl/WKRG98. |
| 198 bool IsLikelyProvisionalAbort(base::TimeTicks abort_cause_time) const; | 198 bool IsLikelyProvisionalAbort(base::TimeTicks abort_cause_time) const; |
| 199 | 199 |
| 200 bool MatchesOriginalNavigation(content::NavigationHandle* navigation_handle); | 200 bool MatchesOriginalNavigation(content::NavigationHandle* navigation_handle); |
| 201 | 201 |
| 202 // Only valid to call post-commit. | 202 // Only valid to call post-commit. |
| 203 const GURL& committed_url() const { | 203 const GURL& committed_url() const { |
| 204 DCHECK(!commit_time_.is_null()); | 204 DCHECK(!committed_url_.is_empty()); |
| 205 return url_; | 205 return committed_url_; |
| 206 } | 206 } |
| 207 | 207 |
| 208 base::TimeTicks navigation_start() const { return navigation_start_; } | 208 base::TimeTicks navigation_start() const { return navigation_start_; } |
| 209 | 209 |
| 210 PageLoadExtraInfo ComputePageLoadExtraInfo(); | 210 PageLoadExtraInfo ComputePageLoadExtraInfo(); |
| 211 | 211 |
| 212 ui::PageTransition page_transition() const { return page_transition_; } | 212 ui::PageTransition page_transition() const { return page_transition_; } |
| 213 | 213 |
| 214 private: | 214 private: |
| 215 // This function converts a TimeTicks value taken in the browser process | 215 // This function converts a TimeTicks value taken in the browser process |
| (...skipping 19 matching lines...) Expand all Loading... |
| 235 // metrics in DidFinishNavigation. | 235 // metrics in DidFinishNavigation. |
| 236 bool did_stop_tracking_; | 236 bool did_stop_tracking_; |
| 237 | 237 |
| 238 // Whether the application went into the background when this PageLoadTracker | 238 // Whether the application went into the background when this PageLoadTracker |
| 239 // was active. This is a temporary boolean for UMA tracking. | 239 // was active. This is a temporary boolean for UMA tracking. |
| 240 bool app_entered_background_; | 240 bool app_entered_background_; |
| 241 | 241 |
| 242 // The navigation start in TimeTicks, not the wall time reported by Blink. | 242 // The navigation start in TimeTicks, not the wall time reported by Blink. |
| 243 const base::TimeTicks navigation_start_; | 243 const base::TimeTicks navigation_start_; |
| 244 | 244 |
| 245 // Time this page load was committed. If this page load hasn't committed, | 245 // The committed URL of this page load. |
| 246 // |commit_time_| will be zero. | 246 GURL committed_url_; |
| 247 base::TimeTicks commit_time_; | |
| 248 | |
| 249 // The URL of this page load. This is the provisional url before commit | |
| 250 // (before redirects), and the committed url after commit. | |
| 251 GURL url_; | |
| 252 | 247 |
| 253 // The start URL for this page load (before redirects). | 248 // The start URL for this page load (before redirects). |
| 254 GURL start_url_; | 249 GURL start_url_; |
| 255 | 250 |
| 256 std::unique_ptr<FailedProvisionalLoadInfo> failed_provisional_load_info_; | 251 std::unique_ptr<FailedProvisionalLoadInfo> failed_provisional_load_info_; |
| 257 | 252 |
| 258 // Will be ABORT_NONE if we have not aborted this load yet. Otherwise will | 253 // Will be ABORT_NONE if we have not aborted this load yet. Otherwise will |
| 259 // be the first abort action the user performed. | 254 // be the first abort action the user performed. |
| 260 UserAbortType abort_type_; | 255 UserAbortType abort_type_; |
| 261 | 256 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 | 414 |
| 420 // Has the MWCO observed at least one navigation? | 415 // Has the MWCO observed at least one navigation? |
| 421 bool has_navigated_; | 416 bool has_navigated_; |
| 422 | 417 |
| 423 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); | 418 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); |
| 424 }; | 419 }; |
| 425 | 420 |
| 426 } // namespace page_load_metrics | 421 } // namespace page_load_metrics |
| 427 | 422 |
| 428 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ | 423 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |