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_ |