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

Side by Side Diff: content/common/tab_load_stats.cc

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, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/common/tab_load_stats.h"
6
7 #include "base/json/json_writer.h"
8 #include "base/values.h"
9
10 namespace content {
11
12 void ConvertTabLoadTimeToJSON(
13 const content::TabLoadTime& tab_load_time,
14 const base::TimeTicks& timer_start,
15 std::string *result) {
16 DictionaryValue item;
17 base::TimeDelta delta_start = tab_load_time.start_time - timer_start;
18
19 item.SetDouble("load_start_ms", delta_start.InMillisecondsF());
20 if (tab_load_time.stop_time.is_null()) {
21 item.Set("load_stop_ms", Value::CreateNullValue());
22 } else {
23 base::TimeDelta delta_stop = tab_load_time.stop_time - timer_start;
24 item.SetDouble("load_stop_ms", delta_stop.InMillisecondsF());
25 }
26 base::JSONWriter::Write(&item, result);
27 }
28
29 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698