Index: chrome/browser/ui/browser_view_histogram_helper.h |
diff --git a/chrome/browser/ui/browser_view_histogram_helper.h b/chrome/browser/ui/browser_view_histogram_helper.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..037b51d53233c40daedda8a39bdccd7bcf1de545 |
--- /dev/null |
+++ b/chrome/browser/ui/browser_view_histogram_helper.h |
@@ -0,0 +1,38 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_UI_BROWSER_VIEW_HISTOGRAM_HELPER_H_ |
+#define CHROME_BROWSER_UI_BROWSER_VIEW_HISTOGRAM_HELPER_H_ |
+ |
+#include "base/macros.h" |
+#include "base/scoped_observer.h" |
+#include "base/time/time.h" |
+#include "ui/compositor/compositor_observer.h" |
+ |
+// Class that encapsulates logic of recording |
+// Startup.BrowserView.Paint-histograms. |
+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.
|
+ public: |
+ BrowserViewHistogramHelper(); |
+ ~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
|
+ |
+ 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.
|
+ |
+ private: |
+ void RemoveCompositorObserver(); |
+ |
+ // ui::CompositorObserver: |
+ void OnCompositingDidCommit(ui::Compositor* compositor) override {} |
+ void OnCompositingStarted(ui::Compositor* compositor, |
+ base::TimeTicks start_time) override; |
+ void OnCompositingLockStateChanged(ui::Compositor* compositor) override {} |
+ void OnCompositingShuttingDown(ui::Compositor* compositor) override; |
+ |
+ ScopedObserver<ui::Compositor, ui::CompositorObserver> scoped_observer_; |
+ bool did_first_paint_ = false; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(BrowserViewHistogramHelper); |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_BROWSER_VIEW_HISTOGRAM_HELPER_H_ |