Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(871)

Unified Diff: chrome/browser/ui/views/frame/browser_view_histogram_helper.h

Issue 2773973002: Add Startup.BrowserView.FirstPaint / .CompositingEnded histograms. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/browser_view_histogram_helper.h
diff --git a/chrome/browser/ui/views/frame/browser_view_histogram_helper.h b/chrome/browser/ui/views/frame/browser_view_histogram_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..84b4d382446c1f0ce8a11a147b828b8bb70b7aaf
--- /dev/null
+++ b/chrome/browser/ui/views/frame/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_VIEWS_FRAME_BROWSER_VIEW_HISTOGRAM_HELPER_H_
+#define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_HISTOGRAM_HELPER_H_
+
+#include "base/macros.h"
+#include "base/time/time.h"
+#include "ui/compositor/compositor_observer.h"
+
+// Class that encapsulates logic of recording BrowserView.Paint-histograms.
+class BrowserViewHistogramHelper : public ui::CompositorObserver {
+ public:
+ BrowserViewHistogramHelper();
Peter Kasting 2017/03/24 22:39:18 Nit: Feel free to use =default
themblsha 2017/03/31 14:32:31 Seems to be no longer applicable with ScopedObserv
+ ~BrowserViewHistogramHelper();
+
+ void OnDidPaintChildren(ui::Compositor* compositor);
+
+ private:
+ void RemoveCompositorObserver();
+
+ // ui::CompositorObserver:
+ void OnCompositingDidCommit(ui::Compositor* compositor) override {}
+ void OnCompositingStarted(ui::Compositor* compositor,
+ base::TimeTicks start_time) override {}
+ void OnCompositingEnded(ui::Compositor* compositor) override;
+ void OnCompositingLockStateChanged(ui::Compositor* compositor) override {}
+ void OnCompositingShuttingDown(ui::Compositor* compositor) override;
+
+ ui::Compositor* compositor_ = nullptr;
+
Peter Kasting 2017/03/24 22:39:18 Nit: Blank line unnecessary
themblsha 2017/03/31 14:32:31 Done.
+ bool did_first_paint_ = false;
+
+ DISALLOW_COPY_AND_ASSIGN(BrowserViewHistogramHelper);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_HISTOGRAM_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698