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

Side by Side Diff: chromeos/dbus/fake_debug_daemon_client.cc

Issue 1614063005: Adds a callback to TracingAgent::StartAgentTracing() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 "chromeos/dbus/fake_debug_daemon_client.h" 5 #include "chromeos/dbus/fake_debug_daemon_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 50 }
51 51
52 std::string FakeDebugDaemonClient::GetTracingAgentName() { 52 std::string FakeDebugDaemonClient::GetTracingAgentName() {
53 return kCrOSTracingAgentName; 53 return kCrOSTracingAgentName;
54 } 54 }
55 55
56 std::string FakeDebugDaemonClient::GetTraceEventLabel() { 56 std::string FakeDebugDaemonClient::GetTraceEventLabel() {
57 return kCrOSTraceLabel; 57 return kCrOSTraceLabel;
58 } 58 }
59 59
60 bool FakeDebugDaemonClient::StartAgentTracing( 60 void FakeDebugDaemonClient::StartAgentTracing(
61 const base::trace_event::TraceConfig& trace_config) { 61 const base::trace_event::TraceConfig& trace_config,
62 return true; 62 const StartAgentTracingCallback& callback) {
63 base::ThreadTaskRunnerHandle::Get()->PostTask(
64 FROM_HERE,
65 base::Bind(callback, GetTracingAgentName(), true /* success */));
63 } 66 }
64 67
65 void FakeDebugDaemonClient::StopAgentTracing( 68 void FakeDebugDaemonClient::StopAgentTracing(
66 const StopAgentTracingCallback& callback) { 69 const StopAgentTracingCallback& callback) {
67 std::string no_data; 70 std::string no_data;
68 callback.Run(GetTracingAgentName(), GetTraceEventLabel(), 71 callback.Run(GetTracingAgentName(), GetTraceEventLabel(),
69 base::RefCountedString::TakeString(&no_data)); 72 base::RefCountedString::TakeString(&no_data));
70 } 73 }
71 74
72 void FakeDebugDaemonClient::SetStopAgentTracingTaskRunner( 75 void FakeDebugDaemonClient::SetStopAgentTracingTaskRunner(
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 if (!is_available) 202 if (!is_available)
200 return; 203 return;
201 204
202 std::vector<WaitForServiceToBeAvailableCallback> callbacks; 205 std::vector<WaitForServiceToBeAvailableCallback> callbacks;
203 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_); 206 callbacks.swap(pending_wait_for_service_to_be_available_callbacks_);
204 for (size_t i = 0; i < callbacks.size(); ++i) 207 for (size_t i = 0; i < callbacks.size(); ++i)
205 callbacks[i].Run(is_available); 208 callbacks[i].Run(is_available);
206 } 209 }
207 210
208 } // namespace chromeos 211 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_debug_daemon_client.h ('k') | content/browser/tracing/etw_system_event_consumer_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698