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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 ERR_LAST_ENTRY, | 101 ERR_LAST_ENTRY, |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 // This class serves as a functional interface to various chrome// features. | 104 // This class serves as a functional interface to various chrome// features. |
| 105 // Impl version is defined in chrome/browser/page_load_metrics. | 105 // Impl version is defined in chrome/browser/page_load_metrics. |
| 106 class PageLoadMetricsEmbedderInterface { | 106 class PageLoadMetricsEmbedderInterface { |
| 107 public: | 107 public: |
| 108 virtual ~PageLoadMetricsEmbedderInterface() {} | 108 virtual ~PageLoadMetricsEmbedderInterface() {} |
| 109 virtual bool IsPrerendering(content::WebContents* web_contents) = 0; | 109 virtual bool IsPrerendering(content::WebContents* web_contents) = 0; |
| 110 virtual bool IsNewTabPageUrl(const GURL& url) = 0; | 110 virtual bool IsNewTabPageUrl(const GURL& url) = 0; |
| 111 virtual void RegisterObservers(PageLoadTracker* metrics) = 0; | 111 virtual void RegisterObservers(PageLoadTracker* metrics, |
| 112 content::WebContents* web_contents) = 0; | |
|
Bryan McQuade
2016/07/21 23:56:13
the PageLoadMetricsEmbedder implementation now has
Benoit L
2016/07/22 15:41:31
Ah, thanks!
Done.
| |
| 112 }; | 113 }; |
| 113 | 114 |
| 114 // This class tracks a given page load, starting from navigation start / | 115 // This class tracks a given page load, starting from navigation start / |
| 115 // provisional load, until a new navigation commits or the navigation fails. | 116 // provisional load, until a new navigation commits or the navigation fails. |
| 116 // MetricsWebContentsObserver manages a set of provisional PageLoadTrackers, as | 117 // MetricsWebContentsObserver manages a set of provisional PageLoadTrackers, as |
| 117 // well as a committed PageLoadTracker. | 118 // well as a committed PageLoadTracker. |
| 118 class PageLoadTracker { | 119 class PageLoadTracker { |
| 119 public: | 120 public: |
| 120 // Caller must guarantee that the embedder_interface pointer outlives this | 121 // Caller must guarantee that the embedder_interface pointer outlives this |
| 121 // class. The PageLoadTracker must not hold on to | 122 // class. The PageLoadTracker must not hold on to |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 342 | 343 |
| 343 // Has the MWCO observed at least one navigation? | 344 // Has the MWCO observed at least one navigation? |
| 344 bool has_navigated_; | 345 bool has_navigated_; |
| 345 | 346 |
| 346 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); | 347 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); |
| 347 }; | 348 }; |
| 348 | 349 |
| 349 } // namespace page_load_metrics | 350 } // namespace page_load_metrics |
| 350 | 351 |
| 351 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_ | 352 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_METRICS_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |