Chromium Code Reviews| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 // MetricsWebContentsObserver manages a set of provisional PageLoadTrackers, as | 106 // MetricsWebContentsObserver manages a set of provisional PageLoadTrackers, as |
| 107 // well as a committed PageLoadTracker. | 107 // well as a committed PageLoadTracker. |
| 108 class PageLoadTracker { | 108 class PageLoadTracker { |
| 109 public: | 109 public: |
| 110 // Caller must guarantee that the embedder_interface pointer outlives this | 110 // Caller must guarantee that the embedder_interface pointer outlives this |
| 111 // class. The PageLoadTracker must not hold on to | 111 // class. The PageLoadTracker must not hold on to |
| 112 // currently_committed_load_or_null or navigation_handle beyond the scope of | 112 // currently_committed_load_or_null or navigation_handle beyond the scope of |
| 113 // the constructor. | 113 // the constructor. |
| 114 PageLoadTracker(bool in_foreground, | 114 PageLoadTracker(bool in_foreground, |
| 115 PageLoadMetricsEmbedderInterface* embedder_interface, | 115 PageLoadMetricsEmbedderInterface* embedder_interface, |
| 116 PageLoadTracker* const currently_committed_load_or_null, | 116 const GURL& currently_committed_url, |
| 117 content::NavigationHandle* navigation_handle, | 117 content::NavigationHandle* navigation_handle, |
| 118 int aborted_chain_size, | 118 int aborted_chain_size, |
| 119 int aborted_chain_size_same_url); | 119 int aborted_chain_size_same_url); |
| 120 ~PageLoadTracker(); | 120 ~PageLoadTracker(); |
| 121 void Redirect(content::NavigationHandle* navigation_handle); | 121 void Redirect(content::NavigationHandle* navigation_handle); |
| 122 void Commit(content::NavigationHandle* navigation_handle); | 122 void Commit(content::NavigationHandle* navigation_handle); |
| 123 void FailedProvisionalLoad(content::NavigationHandle* navigation_handle); | 123 void FailedProvisionalLoad(content::NavigationHandle* navigation_handle); |
| 124 void WebContentsHidden(); | 124 void WebContentsHidden(); |
| 125 void WebContentsShown(); | 125 void WebContentsShown(); |
| 126 | 126 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 287 | 287 |
| 288 // Tracks aborted provisional loads for a little bit longer than usual (one | 288 // Tracks aborted provisional loads for a little bit longer than usual (one |
| 289 // more navigation commit at the max), in order to better understand how the | 289 // more navigation commit at the max), in order to better understand how the |
| 290 // navigation failed. This is because most provisional loads are destroyed and | 290 // navigation failed. This is because most provisional loads are destroyed and |
| 291 // vanish before we get signal about what caused the abort (new navigation, | 291 // vanish before we get signal about what caused the abort (new navigation, |
| 292 // stop button, etc.). | 292 // stop button, etc.). |
| 293 std::vector<std::unique_ptr<PageLoadTracker>> aborted_provisional_loads_; | 293 std::vector<std::unique_ptr<PageLoadTracker>> aborted_provisional_loads_; |
| 294 | 294 |
| 295 std::unique_ptr<PageLoadTracker> committed_load_; | 295 std::unique_ptr<PageLoadTracker> committed_load_; |
| 296 | 296 |
| 297 // Has the MWCO observed at least one navigation commit? | |
| 298 bool has_commit_; | |
|
Bryan McQuade
2016/04/26 18:36:39
any reason not to instead track whether at least o
Charlie Harrison
2016/04/26 19:02:41
Hm yeah I think you're right. We only want to use
| |
| 299 | |
| 297 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); | 300 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); |
| 298 }; | 301 }; |
| 299 | 302 |
| 300 } // namespace page_load_metrics | 303 } // namespace page_load_metrics |
| 301 | 304 |
| 302 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_ | 305 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |