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