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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // have been observed. | 53 // have been observed. |
54 class TestingObserver { | 54 class TestingObserver { |
55 public: | 55 public: |
56 enum class IPCType { LEGACY, MOJO }; | 56 enum class IPCType { LEGACY, MOJO }; |
57 | 57 |
58 explicit TestingObserver(content::WebContents* web_contents); | 58 explicit TestingObserver(content::WebContents* web_contents); |
59 virtual ~TestingObserver(); | 59 virtual ~TestingObserver(); |
60 | 60 |
61 void OnGoingAway(); | 61 void OnGoingAway(); |
62 | 62 |
63 // Invoked when a new PageLoadTiming update has been received and processed. | 63 virtual void OnCommit(PageLoadTracker* tracker) {} |
64 virtual void OnTimingUpdated(bool is_main_frame, | |
65 const mojom::PageLoadTiming& timing, | |
66 const mojom::PageLoadMetadata& metadata) {} | |
67 | |
68 virtual void DidReceiveTimingUpdate(IPCType type) {} | 64 virtual void DidReceiveTimingUpdate(IPCType type) {} |
69 | 65 |
70 private: | 66 private: |
71 page_load_metrics::MetricsWebContentsObserver* observer_; | 67 page_load_metrics::MetricsWebContentsObserver* observer_; |
72 | 68 |
73 DISALLOW_COPY_AND_ASSIGN(TestingObserver); | 69 DISALLOW_COPY_AND_ASSIGN(TestingObserver); |
74 }; | 70 }; |
75 | 71 |
76 // Note that the returned metrics is owned by the web contents. | 72 // Note that the returned metrics is owned by the web contents. |
77 static MetricsWebContentsObserver* CreateForWebContents( | 73 static MetricsWebContentsObserver* CreateForWebContents( |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 base::ObserverList<TestingObserver> testing_observers_; | 227 base::ObserverList<TestingObserver> testing_observers_; |
232 content::WebContentsFrameBindingSet<mojom::PageLoadMetrics> | 228 content::WebContentsFrameBindingSet<mojom::PageLoadMetrics> |
233 page_load_metrics_binding_; | 229 page_load_metrics_binding_; |
234 | 230 |
235 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); | 231 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); |
236 }; | 232 }; |
237 | 233 |
238 } // namespace page_load_metrics | 234 } // namespace page_load_metrics |
239 | 235 |
240 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ | 236 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ |
OLD | NEW |