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

Unified Diff: content/common/tab_load_stats.h

Issue 12389073: Collect tab timing information for use in telementry-based startup tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: formatting/compile fix Created 7 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: content/common/tab_load_stats.h
diff --git a/content/common/tab_load_stats.h b/content/common/tab_load_stats.h
new file mode 100644
index 0000000000000000000000000000000000000000..4d2c0523cacd3f0090d752b4458a68d697af686f
--- /dev/null
+++ b/content/common/tab_load_stats.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2013 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 CONTENT_COMMON_TAB_LOAD_STATS_H_
+#define CONTENT_COMMON_TAB_LOAD_STATS_H_
+
+#include <string>
+#include <vector>
+
+#include "base/time.h"
+
+namespace content {
+
+// Holds onto start and stop timestamps for a particular tab.
+struct TabLoadTime {
jam 2013/04/04 17:28:39 tab is a chrome concept, content doesn't know abou
jeremy 2013/04/07 14:51:54 Renamed tab -> web_contents globally.
+ public:
+ TabLoadTime() {}
+
+ explicit TabLoadTime(base::TimeTicks started)
+ : start_time(started) {
+ }
+
+ ~TabLoadTime() {}
+
+ void set_stop_time(base::TimeTicks stopped) {
+ stop_time = stopped;
+ }
+
+ base::TimeTicks start_time;
+ base::TimeTicks stop_time;
+};
+
+// Encodes a TabLoadTime as JSON.
+// Input:
+// - |tab_load_time| - data to encode.
+// - |timer_start| - clock start, output times are recorded as deltas from this
+// point in time.
+// - |result| - returned JSON.
+// Example return value:
+// {'start_time_ms': 1, 'stop_time_ms': 2.5}
+// stop_time_ms values may be null if a tab hasn't fully loaded.
+void ConvertTabLoadTimeToJSON(
jam 2013/04/04 17:28:39 this method is only called in the renderer. why is
jeremy 2013/04/07 14:51:54 Done.
+ const content::TabLoadTime& tab_load_time,
+ const base::TimeTicks& timer_start,
+ std::string *result);
+
+} // namespace content
+
+#endif // CONTENT_COMMON_TAB_LOAD_STATS_H_

Powered by Google App Engine
This is Rietveld 408576698