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

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

Issue 1424703003: Kills TraceTicks, which was functionally the same as TimeTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed win compile error. Created 5 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/tracing/etw_system_event_consumer_win.h" 5 #include "content/browser/tracing/etw_system_event_consumer_win.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/json/json_string_value_serializer.h" 8 #include "base/json/json_string_value_serializer.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 133 }
134 134
135 // static 135 // static
136 void EtwSystemEventConsumer::ProcessEvent(EVENT_TRACE* event) { 136 void EtwSystemEventConsumer::ProcessEvent(EVENT_TRACE* event) {
137 EtwSystemEventConsumer::GetInstance()->AppendEventToBuffer(event); 137 EtwSystemEventConsumer::GetInstance()->AppendEventToBuffer(event);
138 } 138 }
139 139
140 void EtwSystemEventConsumer::AddSyncEventToBuffer() { 140 void EtwSystemEventConsumer::AddSyncEventToBuffer() {
141 // Sync the clocks. 141 // Sync the clocks.
142 base::Time walltime = base::Time::NowFromSystemTime(); 142 base::Time walltime = base::Time::NowFromSystemTime();
143 base::TraceTicks now = base::TraceTicks::Now(); 143 base::TimeTicks now = base::TimeTicks::Now();
144 144
145 LARGE_INTEGER walltime_in_us; 145 LARGE_INTEGER walltime_in_us;
146 walltime_in_us.QuadPart = walltime.ToInternalValue(); 146 walltime_in_us.QuadPart = walltime.ToInternalValue();
147 LARGE_INTEGER now_in_us; 147 LARGE_INTEGER now_in_us;
148 now_in_us.QuadPart = now.ToInternalValue(); 148 now_in_us.QuadPart = now.ToInternalValue();
149 149
150 // Add fields to the event. 150 // Add fields to the event.
151 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); 151 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
152 value->Set("guid", new base::StringValue("ClockSync")); 152 value->Set("guid", new base::StringValue("ClockSync"));
153 value->Set("walltime", new base::StringValue( 153 value->Set("walltime", new base::StringValue(
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 serializer.Serialize(*header.get()); 223 serializer.Serialize(*header.get());
224 224
225 // Pass the result to the UI Thread. 225 // Pass the result to the UI Thread.
226 scoped_refptr<base::RefCountedString> result = 226 scoped_refptr<base::RefCountedString> result =
227 base::RefCountedString::TakeString(&output); 227 base::RefCountedString::TakeString(&output);
228 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 228 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
229 base::Bind(callback, result)); 229 base::Bind(callback, result));
230 } 230 }
231 231
232 } // namespace content 232 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/devtools_frame_trace_recorder.cc ('k') | content/browser/tracing/trace_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698