| 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 <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 int aborted_chain_size_same_url); | 128 int aborted_chain_size_same_url); |
| 129 ~PageLoadTracker(); | 129 ~PageLoadTracker(); |
| 130 void Redirect(content::NavigationHandle* navigation_handle); | 130 void Redirect(content::NavigationHandle* navigation_handle); |
| 131 void Commit(content::NavigationHandle* navigation_handle); | 131 void Commit(content::NavigationHandle* navigation_handle); |
| 132 void FailedProvisionalLoad(content::NavigationHandle* navigation_handle); | 132 void FailedProvisionalLoad(content::NavigationHandle* navigation_handle); |
| 133 void WebContentsHidden(); | 133 void WebContentsHidden(); |
| 134 void WebContentsShown(); | 134 void WebContentsShown(); |
| 135 | 135 |
| 136 void OnInputEvent(const blink::WebInputEvent& event); | 136 void OnInputEvent(const blink::WebInputEvent& event); |
| 137 | 137 |
| 138 void NotifyClientRedirectTo(const PageLoadTracker& destination); |
| 139 |
| 138 // Returns true if the timing was successfully updated. | 140 // Returns true if the timing was successfully updated. |
| 139 bool UpdateTiming(const PageLoadTiming& timing, | 141 bool UpdateTiming(const PageLoadTiming& timing, |
| 140 const PageLoadMetadata& metadata); | 142 const PageLoadMetadata& metadata); |
| 141 | 143 |
| 142 void set_renderer_tracked(bool renderer_tracked); | 144 void set_renderer_tracked(bool renderer_tracked); |
| 143 bool renderer_tracked() const { return renderer_tracked_; } | 145 bool renderer_tracked() const { return renderer_tracked_; } |
| 144 | 146 |
| 145 int aborted_chain_size() const { return aborted_chain_size_; } | 147 int aborted_chain_size() const { return aborted_chain_size_; } |
| 146 int aborted_chain_size_same_url() const { | 148 int aborted_chain_size_same_url() const { |
| 147 return aborted_chain_size_same_url_; | 149 return aborted_chain_size_same_url_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 174 bool IsLikelyProvisionalAbort(base::TimeTicks abort_cause_time); | 176 bool IsLikelyProvisionalAbort(base::TimeTicks abort_cause_time); |
| 175 | 177 |
| 176 bool MatchesOriginalNavigation(content::NavigationHandle* navigation_handle); | 178 bool MatchesOriginalNavigation(content::NavigationHandle* navigation_handle); |
| 177 | 179 |
| 178 // Only valid to call post-commit. | 180 // Only valid to call post-commit. |
| 179 const GURL& committed_url() const { | 181 const GURL& committed_url() const { |
| 180 DCHECK(!commit_time_.is_null()); | 182 DCHECK(!commit_time_.is_null()); |
| 181 return url_; | 183 return url_; |
| 182 } | 184 } |
| 183 | 185 |
| 186 base::TimeTicks navigation_start() const { return navigation_start_; } |
| 187 |
| 184 PageLoadExtraInfo ComputePageLoadExtraInfo(); | 188 PageLoadExtraInfo ComputePageLoadExtraInfo(); |
| 185 | 189 |
| 186 private: | 190 private: |
| 187 // This function converts a TimeTicks value taken in the browser process | 191 // This function converts a TimeTicks value taken in the browser process |
| 188 // to navigation_start_ if: | 192 // to navigation_start_ if: |
| 189 // - base::TimeTicks is not comparable across processes because the clock | 193 // - base::TimeTicks is not comparable across processes because the clock |
| 190 // is not system wide monotonic. | 194 // is not system wide monotonic. |
| 191 // - *event_time < navigation_start_ | 195 // - *event_time < navigation_start_ |
| 192 void ClampBrowserTimestampIfInterProcessTimeTickSkew( | 196 void ClampBrowserTimestampIfInterProcessTimeTickSkew( |
| 193 base::TimeTicks* event_time); | 197 base::TimeTicks* event_time); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 341 |
| 338 // Has the MWCO observed at least one navigation? | 342 // Has the MWCO observed at least one navigation? |
| 339 bool has_navigated_; | 343 bool has_navigated_; |
| 340 | 344 |
| 341 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); | 345 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); |
| 342 }; | 346 }; |
| 343 | 347 |
| 344 } // namespace page_load_metrics | 348 } // namespace page_load_metrics |
| 345 | 349 |
| 346 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_ | 350 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |