Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |