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

Side by Side Diff: content/browser/tracing/tracing_controller_impl.cc

Issue 2125983002: Bulk Reports - Add datetime metadata to traces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 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 #include "content/browser/tracing/tracing_controller_impl.h" 4 #include "content/browser/tracing/tracing_controller_impl.h"
5 5
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/cpu.h" 7 #include "base/cpu.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/json/string_escape.h" 10 #include "base/json/string_escape.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 std::unique_ptr<TracingDelegate> delegate( 162 std::unique_ptr<TracingDelegate> delegate(
163 GetContentClient()->browser()->GetTracingDelegate()); 163 GetContentClient()->browser()->GetTracingDelegate());
164 if (delegate) 164 if (delegate)
165 delegate->GenerateMetadataDict(metadata_dict.get()); 165 delegate->GenerateMetadataDict(metadata_dict.get());
166 166
167 metadata_dict->SetString("clock-domain", GetClockString()); 167 metadata_dict->SetString("clock-domain", GetClockString());
168 metadata_dict->SetBoolean("highres-ticks", 168 metadata_dict->SetBoolean("highres-ticks",
169 base::TimeTicks::IsHighResolution()); 169 base::TimeTicks::IsHighResolution());
170 170
171 base::Time::Exploded ctime;
172 base::Time::Now().UTCExplode(&ctime);
173 std::string time_string = base::StringPrintf("%u-%u-%u %d:%d:%d",
174 ctime.year, ctime.month, ctime.day_of_month, ctime.hour,
175 ctime.minute, ctime.second);
176 metadata_dict->SetString("trace-capture-datetime-ms", time_string);
oystein (OOO til 10th of July) 2016/07/11 18:35:21 Why -ms?
177
171 return metadata_dict; 178 return metadata_dict;
172 } 179 }
173 180
174 } // namespace 181 } // namespace
175 182
176 TracingController* TracingController::GetInstance() { 183 TracingController* TracingController::GetInstance() {
177 return TracingControllerImpl::GetInstance(); 184 return TracingControllerImpl::GetInstance();
178 } 185 }
179 186
180 TracingControllerImpl::TracingControllerImpl() 187 TracingControllerImpl::TracingControllerImpl()
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 // Schedule the next queued dump (if applicable). 1084 // Schedule the next queued dump (if applicable).
1078 if (!queued_memory_dump_requests_.empty()) { 1085 if (!queued_memory_dump_requests_.empty()) {
1079 BrowserThread::PostTask( 1086 BrowserThread::PostTask(
1080 BrowserThread::UI, FROM_HERE, 1087 BrowserThread::UI, FROM_HERE,
1081 base::Bind(&TracingControllerImpl::PerformNextQueuedGlobalMemoryDump, 1088 base::Bind(&TracingControllerImpl::PerformNextQueuedGlobalMemoryDump,
1082 base::Unretained(this))); 1089 base::Unretained(this)));
1083 } 1090 }
1084 } 1091 }
1085 1092
1086 } // namespace content 1093 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698