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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // such as the arrivial of PageLoadTiming messages from the render process, | 49 // such as the arrivial of PageLoadTiming messages from the render process, |
50 // have been observed. | 50 // have been observed. |
51 class TestingObserver { | 51 class TestingObserver { |
52 public: | 52 public: |
53 explicit TestingObserver(content::WebContents* web_contents); | 53 explicit TestingObserver(content::WebContents* web_contents); |
54 virtual ~TestingObserver(); | 54 virtual ~TestingObserver(); |
55 | 55 |
56 void OnGoingAway(); | 56 void OnGoingAway(); |
57 | 57 |
58 // Invoked when a new PageLoadTiming update has been received and processed. | 58 // Invoked when a new PageLoadTiming update has been received and processed. |
59 virtual void OnTimingUpdated(const PageLoadTiming& timing, | 59 virtual void OnTimingUpdated(bool is_main_frame, |
| 60 const PageLoadTiming& timing, |
60 const PageLoadMetadata& metadata) {} | 61 const PageLoadMetadata& metadata) {} |
61 | 62 |
62 private: | 63 private: |
63 page_load_metrics::MetricsWebContentsObserver* observer_; | 64 page_load_metrics::MetricsWebContentsObserver* observer_; |
64 | 65 |
65 DISALLOW_COPY_AND_ASSIGN(TestingObserver); | 66 DISALLOW_COPY_AND_ASSIGN(TestingObserver); |
66 }; | 67 }; |
67 | 68 |
68 // Note that the returned metrics is owned by the web contents. | 69 // Note that the returned metrics is owned by the web contents. |
69 static MetricsWebContentsObserver* CreateForWebContents( | 70 static MetricsWebContentsObserver* CreateForWebContents( |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 bool has_navigated_; | 213 bool has_navigated_; |
213 | 214 |
214 base::ObserverList<TestingObserver> testing_observers_; | 215 base::ObserverList<TestingObserver> testing_observers_; |
215 | 216 |
216 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); | 217 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); |
217 }; | 218 }; |
218 | 219 |
219 } // namespace page_load_metrics | 220 } // namespace page_load_metrics |
220 | 221 |
221 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ | 222 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ |
OLD | NEW |