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

Side by Side Diff: content/renderer/stats_collection_controller.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/stats_collection_controller.h" 5 #include "content/renderer/stats_collection_controller.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/metrics/statistics_recorder.h" 9 #include "base/metrics/statistics_recorder.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } else { 59 } else {
60 item.SetDouble("load_start_ms", (load_start_time - base::Time::UnixEpoch()) 60 item.SetDouble("load_start_ms", (load_start_time - base::Time::UnixEpoch())
61 .InMillisecondsF()); 61 .InMillisecondsF());
62 } 62 }
63 if (load_start_time.is_null() || load_stop_time.is_null()) { 63 if (load_start_time.is_null() || load_stop_time.is_null()) {
64 item.Set("load_duration_ms", base::Value::CreateNullValue()); 64 item.Set("load_duration_ms", base::Value::CreateNullValue());
65 } else { 65 } else {
66 item.SetDouble("load_duration_ms", 66 item.SetDouble("load_duration_ms",
67 (load_stop_time - load_start_time).InMillisecondsF()); 67 (load_stop_time - load_start_time).InMillisecondsF());
68 } 68 }
69 base::JSONWriter::Write(&item, result); 69 base::JSONWriter::Write(item, result);
70 } 70 }
71 71
72 } // namespace 72 } // namespace
73 73
74 // static 74 // static
75 gin::WrapperInfo StatsCollectionController::kWrapperInfo = { 75 gin::WrapperInfo StatsCollectionController::kWrapperInfo = {
76 gin::kEmbedderNativeGin 76 gin::kEmbedderNativeGin
77 }; 77 };
78 78
79 // static 79 // static
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 151 }
152 152
153 std::string tab_timing_json; 153 std::string tab_timing_json;
154 ConvertLoadTimeToJSON( 154 ConvertLoadTimeToJSON(
155 observer->load_start_time(), observer->load_stop_time(), 155 observer->load_start_time(), observer->load_stop_time(),
156 &tab_timing_json); 156 &tab_timing_json);
157 return tab_timing_json; 157 return tab_timing_json;
158 } 158 }
159 159
160 } // namespace content 160 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.cc ('k') | content/shell/browser/shell_devtools_frontend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698