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 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 | 131 |
| 132 // Register / unregister TestingObservers. Should only be called from tests. | 132 // Register / unregister TestingObservers. Should only be called from tests. |
| 133 void AddTestingObserver(TestingObserver* observer); | 133 void AddTestingObserver(TestingObserver* observer); |
| 134 void RemoveTestingObserver(TestingObserver* observer); | 134 void RemoveTestingObserver(TestingObserver* observer); |
| 135 | 135 |
| 136 // public only for testing | 136 // public only for testing |
| 137 void OnTimingUpdated(content::RenderFrameHost* render_frame_host, | 137 void OnTimingUpdated(content::RenderFrameHost* render_frame_host, |
| 138 const mojom::PageLoadTiming& timing, | 138 const mojom::PageLoadTiming& timing, |
| 139 const mojom::PageLoadMetadata& metadata); | 139 const mojom::PageLoadMetadata& metadata); |
| 140 | 140 |
| 141 // Informs the observers of the currently committed load that the event | |
| 142 // corresponding to |event_key| has occurred. This should not be called within | |
| 143 // WebContentsObserver::DidFinishNavigation methods. | |
| 144 void BroadcastEventToObservers(const void* const event_key); | |
|
Bryan McQuade
2017/07/12 21:10:03
let's add to the comment that this API is subject
RyanSturm
2017/07/12 21:27:27
Done.
| |
| 145 | |
| 141 private: | 146 private: |
| 142 friend class content::WebContentsUserData<MetricsWebContentsObserver>; | 147 friend class content::WebContentsUserData<MetricsWebContentsObserver>; |
| 143 | 148 |
| 144 // page_load_metrics::mojom::PageLoadMetrics implementation. | 149 // page_load_metrics::mojom::PageLoadMetrics implementation. |
| 145 void UpdateTiming(mojom::PageLoadTimingPtr timing, | 150 void UpdateTiming(mojom::PageLoadTimingPtr timing, |
| 146 mojom::PageLoadMetadataPtr metadata) override; | 151 mojom::PageLoadMetadataPtr metadata) override; |
| 147 | 152 |
| 148 void HandleFailedNavigationForTrackedLoad( | 153 void HandleFailedNavigationForTrackedLoad( |
| 149 content::NavigationHandle* navigation_handle, | 154 content::NavigationHandle* navigation_handle, |
| 150 std::unique_ptr<PageLoadTracker> tracker); | 155 std::unique_ptr<PageLoadTracker> tracker); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 215 base::ObserverList<TestingObserver> testing_observers_; | 220 base::ObserverList<TestingObserver> testing_observers_; |
| 216 content::WebContentsFrameBindingSet<mojom::PageLoadMetrics> | 221 content::WebContentsFrameBindingSet<mojom::PageLoadMetrics> |
| 217 page_load_metrics_binding_; | 222 page_load_metrics_binding_; |
| 218 | 223 |
| 219 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); | 224 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); |
| 220 }; | 225 }; |
| 221 | 226 |
| 222 } // namespace page_load_metrics | 227 } // namespace page_load_metrics |
| 223 | 228 |
| 224 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ | 229 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ |
| OLD | NEW |