OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_METRICS_BROWSER_WINDOW_HISTOGRAM_HELPER_H_ | |
6 #define CHROME_BROWSER_METRICS_BROWSER_WINDOW_HISTOGRAM_HELPER_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/scoped_observer.h" | |
12 #include "base/time/time.h" | |
13 #include "ui/compositor/compositor_observer.h" | |
14 | |
15 // Class that encapsulates logic of recording | |
16 // Startup.BrowserWindow.FirstPaint* histograms. | |
Alexei Svitkine (slow)
2017/04/19 16:52:16
Add a sentence here to mention that this is not in
themblsha
2017/04/19 17:27:40
Done.
| |
17 class BrowserWindowHistogramHelper : public ui::CompositorObserver { | |
18 public: | |
19 ~BrowserWindowHistogramHelper() override; | |
20 | |
21 // Call this when the Browser finishes painting its UI, and the user will see | |
22 // it after next Compositor frame swap. | |
23 // |compositor| is the compositor that composites the just-painted Browser | |
24 // widget, or nullptr in Cocoa (we're using CoreAnimation's compositor there). | |
25 // Returned object should stay alive until next |OnCompositingStarted| | |
26 // callback. | |
27 static std::unique_ptr<BrowserWindowHistogramHelper> | |
28 RecordValueAndMaybeCreateInstanceOnBrowserPainted(ui::Compositor* compositor); | |
Alexei Svitkine (slow)
2017/04/19 16:52:16
Nit: The "Record value" part is also under Maybe s
themblsha
2017/04/19 17:27:40
Good point, done.
| |
29 | |
30 private: | |
31 explicit BrowserWindowHistogramHelper(ui::Compositor* compositor); | |
32 | |
33 // ui::CompositorObserver: | |
34 | |
Alexei Svitkine (slow)
2017/04/19 16:52:16
Nit: Remove empty line
themblsha
2017/04/19 17:27:41
Done.
| |
35 void OnCompositingDidCommit(ui::Compositor* compositor) override {} | |
36 void OnCompositingStarted(ui::Compositor* compositor, | |
37 base::TimeTicks start_time) override; | |
38 void OnCompositingLockStateChanged(ui::Compositor* compositor) override {} | |
39 void OnCompositingShuttingDown(ui::Compositor* compositor) override; | |
40 | |
41 ScopedObserver<ui::Compositor, ui::CompositorObserver> scoped_observer_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(BrowserWindowHistogramHelper); | |
44 }; | |
45 | |
46 #endif // CHROME_BROWSER_METRICS_BROWSER_WINDOW_HISTOGRAM_HELPER_H_ | |
OLD | NEW |