Chromium Code Reviews| 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_UI_BROWSER_VIEW_HISTOGRAM_HELPER_H_ | |
| 6 #define CHROME_BROWSER_UI_BROWSER_VIEW_HISTOGRAM_HELPER_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "base/scoped_observer.h" | |
| 10 #include "base/time/time.h" | |
| 11 #include "ui/compositor/compositor_observer.h" | |
| 12 | |
| 13 // Class that encapsulates logic of recording | |
| 14 // Startup.BrowserView.Paint-histograms. | |
| 15 class BrowserViewHistogramHelper : public ui::CompositorObserver { | |
|
sky
2017/04/11 17:13:36
This class is only used for metrics recording. I t
themblsha
2017/04/12 17:18:29
Done. But I'm not sure how to add it to the GN in
sky
2017/04/12 19:34:08
The new file should be in the target that contains
themblsha
2017/04/17 17:34:49
Thanks! Moved, also updated histogram names.
| |
| 16 public: | |
| 17 BrowserViewHistogramHelper(); | |
| 18 ~BrowserViewHistogramHelper(); | |
|
sky
2017/04/11 17:13:36
override
themblsha
2017/04/12 17:18:28
Ah yes, I currently don't have the https://coderev
| |
| 19 | |
| 20 void OnDidPaintChildren(ui::Compositor* compositor); | |
|
sky
2017/04/11 17:13:36
Document this. Also, that it happens to be called
themblsha
2017/04/12 17:18:28
Better name, thanks! Renamed.
| |
| 21 | |
| 22 private: | |
| 23 void RemoveCompositorObserver(); | |
| 24 | |
| 25 // ui::CompositorObserver: | |
| 26 void OnCompositingDidCommit(ui::Compositor* compositor) override {} | |
| 27 void OnCompositingStarted(ui::Compositor* compositor, | |
| 28 base::TimeTicks start_time) override; | |
| 29 void OnCompositingLockStateChanged(ui::Compositor* compositor) override {} | |
| 30 void OnCompositingShuttingDown(ui::Compositor* compositor) override; | |
| 31 | |
| 32 ScopedObserver<ui::Compositor, ui::CompositorObserver> scoped_observer_; | |
| 33 bool did_first_paint_ = false; | |
| 34 | |
| 35 DISALLOW_COPY_AND_ASSIGN(BrowserViewHistogramHelper); | |
| 36 }; | |
| 37 | |
| 38 #endif // CHROME_BROWSER_UI_BROWSER_VIEW_HISTOGRAM_HELPER_H_ | |
| OLD | NEW |