OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_METRICS_CHROME_BROWSER_MAIN_EXTRA_PARTS_METRICS_H_ | 5 #ifndef CHROME_BROWSER_METRICS_CHROME_BROWSER_MAIN_EXTRA_PARTS_METRICS_H_ |
6 #define CHROME_BROWSER_METRICS_CHROME_BROWSER_MAIN_EXTRA_PARTS_METRICS_H_ | 6 #define CHROME_BROWSER_METRICS_CHROME_BROWSER_MAIN_EXTRA_PARTS_METRICS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 11 matching lines...) Expand all Loading... | |
22 public: | 22 public: |
23 ChromeBrowserMainExtraPartsMetrics(); | 23 ChromeBrowserMainExtraPartsMetrics(); |
24 ~ChromeBrowserMainExtraPartsMetrics() override; | 24 ~ChromeBrowserMainExtraPartsMetrics() override; |
25 | 25 |
26 // Overridden from ChromeBrowserMainExtraParts: | 26 // Overridden from ChromeBrowserMainExtraParts: |
27 void PreProfileInit() override; | 27 void PreProfileInit() override; |
28 void PreBrowserStart() override; | 28 void PreBrowserStart() override; |
29 void PostBrowserStart() override; | 29 void PostBrowserStart() override; |
30 | 30 |
31 private: | 31 private: |
32 class FirstWebContentsProfiler; | |
33 | |
32 #if defined(OS_MACOSX) && !defined(OS_IOS) | 34 #if defined(OS_MACOSX) && !defined(OS_IOS) |
33 // Records Mac specific metrics. | 35 // Records Mac specific metrics. |
34 void RecordMacMetrics(); | 36 void RecordMacMetrics(); |
35 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 37 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
36 | 38 |
37 // DisplayObserver overrides. | 39 // DisplayObserver overrides. |
38 virtual void OnDisplayAdded(const gfx::Display& new_display) override; | 40 virtual void OnDisplayAdded(const gfx::Display& new_display) override; |
39 virtual void OnDisplayRemoved(const gfx::Display& old_display) override; | 41 virtual void OnDisplayRemoved(const gfx::Display& old_display) override; |
40 virtual void OnDisplayMetricsChanged(const gfx::Display& display, | 42 virtual void OnDisplayMetricsChanged(const gfx::Display& display, |
41 uint32_t changed_metrics) override; | 43 uint32_t changed_metrics) override; |
42 | 44 |
43 // If the number of displays has changed, emit a UMA metric. | 45 // If the number of displays has changed, emit a UMA metric. |
44 void EmitDisplaysChangedMetric(); | 46 void EmitDisplaysChangedMetric(); |
45 | 47 |
48 // Called by |first_web_contents_profiler_| when it wants to be destroyed. | |
49 void FirstWebContentsProfilerWantsDestruction(); | |
Ilya Sherman
2014/11/26 02:24:55
This feels pretty hacky. I wonder if it would be
erikchen
2014/11/26 03:48:43
I don't like the style where objects own their own
| |
50 | |
46 // A cached value for the number of displays. | 51 // A cached value for the number of displays. |
47 int display_count_; | 52 int display_count_; |
48 | 53 |
49 // True iff |this| instance is registered as an observer of the native | 54 // True iff |this| instance is registered as an observer of the native |
50 // screen. | 55 // screen. |
51 bool is_screen_observer_; | 56 bool is_screen_observer_; |
52 | 57 |
58 // Measures start up performance of the first active web contents. | |
59 scoped_ptr<FirstWebContentsProfiler> first_web_contents_profiler_; | |
60 | |
53 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsMetrics); | 61 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsMetrics); |
54 }; | 62 }; |
55 | 63 |
56 #endif // CHROME_BROWSER_METRICS_CHROME_BROWSER_MAIN_EXTRA_PARTS_METRICS_H_ | 64 #endif // CHROME_BROWSER_METRICS_CHROME_BROWSER_MAIN_EXTRA_PARTS_METRICS_H_ |
OLD | NEW |