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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 if (!pipe_write_end.IsValid()) { | 560 if (!pipe_write_end.IsValid()) { |
561 LOG(ERROR) << "Cannot create pipe reader"; | 561 LOG(ERROR) << "Cannot create pipe reader"; |
562 // NB: continue anyway to shutdown tracing; toss trace data | 562 // NB: continue anyway to shutdown tracing; toss trace data |
563 pipe_write_end.Initialize(base::FilePath(FILE_PATH_LITERAL("/dev/null")), | 563 pipe_write_end.Initialize(base::FilePath(FILE_PATH_LITERAL("/dev/null")), |
564 base::File::FLAG_OPEN | base::File::FLAG_WRITE); | 564 base::File::FLAG_OPEN | base::File::FLAG_WRITE); |
565 // TODO(sleffler) if this fails AppendFileDescriptor will abort | 565 // TODO(sleffler) if this fails AppendFileDescriptor will abort |
566 } | 566 } |
567 scoped_ptr<dbus::FileDescriptor> file_descriptor(new dbus::FileDescriptor); | 567 scoped_ptr<dbus::FileDescriptor> file_descriptor(new dbus::FileDescriptor); |
568 file_descriptor->PutValue(pipe_write_end.TakePlatformFile()); | 568 file_descriptor->PutValue(pipe_write_end.TakePlatformFile()); |
569 file_descriptor->CheckValidity(); | 569 file_descriptor->CheckValidity(); |
570 return file_descriptor.Pass(); | 570 return file_descriptor; |
571 } | 571 } |
572 | 572 |
573 // Called when a CheckValidity response is received. | 573 // Called when a CheckValidity response is received. |
574 void OnCreateFileDescriptorRequestStopSystem( | 574 void OnCreateFileDescriptorRequestStopSystem( |
575 const StopAgentTracingCallback& callback, | 575 const StopAgentTracingCallback& callback, |
576 scoped_ptr<dbus::FileDescriptor> file_descriptor) { | 576 scoped_ptr<dbus::FileDescriptor> file_descriptor) { |
577 DCHECK(file_descriptor); | 577 DCHECK(file_descriptor); |
578 | 578 |
579 // Issue the dbus request to stop system tracing | 579 // Issue the dbus request to stop system tracing |
580 dbus::MethodCall method_call( | 580 dbus::MethodCall method_call( |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 DebugDaemonClient::EmptyStopAgentTracingCallback() { | 641 DebugDaemonClient::EmptyStopAgentTracingCallback() { |
642 return base::Bind(&EmptyStopAgentTracingCallbackBody); | 642 return base::Bind(&EmptyStopAgentTracingCallbackBody); |
643 } | 643 } |
644 | 644 |
645 // static | 645 // static |
646 DebugDaemonClient* DebugDaemonClient::Create() { | 646 DebugDaemonClient* DebugDaemonClient::Create() { |
647 return new DebugDaemonClientImpl(); | 647 return new DebugDaemonClientImpl(); |
648 } | 648 } |
649 | 649 |
650 } // namespace chromeos | 650 } // namespace chromeos |
OLD | NEW |