| 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 COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_ | 5 #ifndef COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_ |
| 6 #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_ | 6 #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // This method returns true if this page load has been aborted with type of | 145 // This method returns true if this page load has been aborted with type of |
| 146 // ABORT_OTHER, and the |abort_cause_time| is within a sufficiently close | 146 // ABORT_OTHER, and the |abort_cause_time| is within a sufficiently close |
| 147 // delta to when it was aborted. Note that only provisional loads can be | 147 // delta to when it was aborted. Note that only provisional loads can be |
| 148 // aborted with ABORT_OTHER. While this heuristic is coarse, it works better | 148 // aborted with ABORT_OTHER. While this heuristic is coarse, it works better |
| 149 // and is simpler than other feasible methods. See https://goo.gl/WKRG98. | 149 // and is simpler than other feasible methods. See https://goo.gl/WKRG98. |
| 150 bool IsLikelyProvisionalAbort(base::TimeTicks abort_cause_time); | 150 bool IsLikelyProvisionalAbort(base::TimeTicks abort_cause_time); |
| 151 | 151 |
| 152 bool MatchesOriginalNavigation(content::NavigationHandle* navigation_handle); | 152 bool MatchesOriginalNavigation(content::NavigationHandle* navigation_handle); |
| 153 | 153 |
| 154 private: | 154 private: |
| 155 PageLoadExtraInfo GetPageLoadMetricsInfo(); | 155 PageLoadExtraInfo ComputePageLoadExtraInfo(); |
| 156 | 156 |
| 157 // Only valid to call post-commit. | 157 // Only valid to call post-commit. |
| 158 const GURL& committed_url(); | 158 const GURL& committed_url(); |
| 159 | 159 |
| 160 void UpdateAbortInternal(UserAbortType abort_type, | 160 void UpdateAbortInternal(UserAbortType abort_type, |
| 161 base::TimeTicks timestamp); | 161 base::TimeTicks timestamp); |
| 162 | 162 |
| 163 // If |final_navigation| is null, then this is an "unparented" abort chain, | 163 // If |final_navigation| is null, then this is an "unparented" abort chain, |
| 164 // and represents a sequence of provisional aborts that never ends with a | 164 // and represents a sequence of provisional aborts that never ends with a |
| 165 // committed load. | 165 // committed load. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 std::vector<scoped_ptr<PageLoadTracker>> aborted_provisional_loads_; | 282 std::vector<scoped_ptr<PageLoadTracker>> aborted_provisional_loads_; |
| 283 | 283 |
| 284 scoped_ptr<PageLoadTracker> committed_load_; | 284 scoped_ptr<PageLoadTracker> committed_load_; |
| 285 | 285 |
| 286 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); | 286 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); |
| 287 }; | 287 }; |
| 288 | 288 |
| 289 } // namespace page_load_metrics | 289 } // namespace page_load_metrics |
| 290 | 290 |
| 291 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_ | 291 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |