| OLD | NEW |
| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 } | 122 } |
| 123 | 123 |
| 124 bool EtwSystemEventConsumer::StopKernelSessionTracing() { | 124 bool EtwSystemEventConsumer::StopKernelSessionTracing() { |
| 125 HRESULT hr = base::win::EtwTraceController::Stop( | 125 HRESULT hr = base::win::EtwTraceController::Stop( |
| 126 KERNEL_LOGGER_NAME, &properties_); | 126 KERNEL_LOGGER_NAME, &properties_); |
| 127 return SUCCEEDED(hr); | 127 return SUCCEEDED(hr); |
| 128 } | 128 } |
| 129 | 129 |
| 130 // static | 130 // static |
| 131 EtwSystemEventConsumer* EtwSystemEventConsumer::GetInstance() { | 131 EtwSystemEventConsumer* EtwSystemEventConsumer::GetInstance() { |
| 132 return Singleton<EtwSystemEventConsumer>::get(); | 132 return base::Singleton<EtwSystemEventConsumer>::get(); |
| 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(); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |