| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/debug_daemon_client.h" | 5 #include "chromeos/dbus/debug_daemon_client.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <unistd.h> | 8 #include <unistd.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 226 |
| 227 pipe_reader_.reset(new PipeReaderForString( | 227 pipe_reader_.reset(new PipeReaderForString( |
| 228 task_runner, | 228 task_runner, |
| 229 base::Bind(&DebugDaemonClientImpl::OnIOComplete, | 229 base::Bind(&DebugDaemonClientImpl::OnIOComplete, |
| 230 weak_ptr_factory_.GetWeakPtr()))); | 230 weak_ptr_factory_.GetWeakPtr()))); |
| 231 | 231 |
| 232 base::File pipe_write_end = pipe_reader_->StartIO(); | 232 base::File pipe_write_end = pipe_reader_->StartIO(); |
| 233 // Create dbus::FileDescriptor on the worker thread; on return we'll | 233 // Create dbus::FileDescriptor on the worker thread; on return we'll |
| 234 // issue the D-Bus request to stop tracing and collect results. | 234 // issue the D-Bus request to stop tracing and collect results. |
| 235 base::PostTaskAndReplyWithResult( | 235 base::PostTaskAndReplyWithResult( |
| 236 task_runner, | 236 task_runner.get(), |
| 237 FROM_HERE, | 237 FROM_HERE, |
| 238 base::Bind( | 238 base::Bind( |
| 239 &DebugDaemonClientImpl::CreateFileDescriptorToStopSystemTracing, | 239 &DebugDaemonClientImpl::CreateFileDescriptorToStopSystemTracing, |
| 240 base::Passed(&pipe_write_end)), | 240 base::Passed(&pipe_write_end)), |
| 241 base::Bind( | 241 base::Bind( |
| 242 &DebugDaemonClientImpl::OnCreateFileDescriptorRequestStopSystem, | 242 &DebugDaemonClientImpl::OnCreateFileDescriptorRequestStopSystem, |
| 243 weak_ptr_factory_.GetWeakPtr(), | 243 weak_ptr_factory_.GetWeakPtr(), |
| 244 callback)); | 244 callback)); |
| 245 return true; | 245 return true; |
| 246 } | 246 } |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 DebugDaemonClient::EmptyStopSystemTracingCallback() { | 545 DebugDaemonClient::EmptyStopSystemTracingCallback() { |
| 546 return base::Bind(&EmptyStopSystemTracingCallbackBody); | 546 return base::Bind(&EmptyStopSystemTracingCallbackBody); |
| 547 } | 547 } |
| 548 | 548 |
| 549 // static | 549 // static |
| 550 DebugDaemonClient* DebugDaemonClient::Create() { | 550 DebugDaemonClient* DebugDaemonClient::Create() { |
| 551 return new DebugDaemonClientImpl(); | 551 return new DebugDaemonClientImpl(); |
| 552 } | 552 } |
| 553 | 553 |
| 554 } // namespace chromeos | 554 } // namespace chromeos |
| OLD | NEW |