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

Unified Diff: components/html_viewer/stats_collection_observer.h

Issue 1278673002: Add stats collection for telemetry startup.warm.blank_page test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cache and reuse a single mojo:tracing connection in mojo:html_viewer. Created 5 years, 4 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: components/html_viewer/stats_collection_observer.h
diff --git a/components/html_viewer/stats_collection_observer.h b/components/html_viewer/stats_collection_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..2dbda97707224863f05c370aa451fd0ef3f9d52f
--- /dev/null
+++ b/components/html_viewer/stats_collection_observer.h
@@ -0,0 +1,37 @@
+// Copyright 2015 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 COMPONENTS_HTML_VIEWER_STATS_COLLECTION_OBSERVER_H_
+#define COMPONENTS_HTML_VIEWER_STATS_COLLECTION_OBSERVER_H_
+
+#include "base/time/time.h"
+#include "components/html_viewer/html_document.h"
+
+namespace html_viewer {
+
+// Collect timing information for page loads.
+class StatsCollectionObserver : public HTMLDocument::Observer {
+ public:
+ explicit StatsCollectionObserver(HTMLDocument* html_document);
+ ~StatsCollectionObserver() override;
+
+ // HTMLDocument::Observer implementation
+ void DidStartLoading() override;
+ void DidStopLoading() override;
+
+ // Timing for the page load start and stop. These functions may return
+ // a null time value under various circumstances.
+ const base::Time& load_start_time() { return start_time_; }
yzshen1 2015/08/13 15:59:12 Please use the same name for getter and the corres
msw 2015/08/14 23:20:35 Removed.
+ const base::Time& load_stop_time() { return stop_time_; }
+
+ private:
+ base::Time start_time_;
sky 2015/08/12 23:54:36 Shouldn't this use timeticks?
msw 2015/08/14 23:20:35 Removed.
+ base::Time stop_time_;
+
+ DISALLOW_COPY_AND_ASSIGN(StatsCollectionObserver);
+};
+
+} // namespace html_viewer
+
+#endif // COMPONENTS_HTML_VIEWER_STATS_COLLECTION_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698