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 <fcntl.h> | 5 #include <fcntl.h> |
6 #include <unistd.h> | 6 #include <unistd.h> |
7 | 7 |
8 #include "chromeos/dbus/debug_daemon_client.h" | 8 #include "chromeos/dbus/debug_daemon_client.h" |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
251 dbus::MethodCall method_call(debugd::kDebugdInterface, | 251 dbus::MethodCall method_call(debugd::kDebugdInterface, |
252 "GetAllLogs"); | 252 "GetAllLogs"); |
253 debugdaemon_proxy_->CallMethod( | 253 debugdaemon_proxy_->CallMethod( |
254 &method_call, | 254 &method_call, |
255 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 255 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
256 base::Bind(&DebugDaemonClientImpl::OnGetAllLogs, | 256 base::Bind(&DebugDaemonClientImpl::OnGetAllLogs, |
257 weak_ptr_factory_.GetWeakPtr(), | 257 weak_ptr_factory_.GetWeakPtr(), |
258 callback)); | 258 callback)); |
259 } | 259 } |
260 | 260 |
261 virtual void GetFeedbackLogs(const GetAllLogsCallback& callback) | |
262 OVERRIDE { | |
263 dbus::MethodCall method_call(debugd::kDebugdInterface, | |
264 "GetFeedbackLogs"); | |
265 debugdaemon_proxy_->CallMethod( | |
266 &method_call, | |
267 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | |
268 base::Bind(&DebugDaemonClientImpl::OnGetAllLogs, | |
269 weak_ptr_factory_.GetWeakPtr(), | |
270 callback)); | |
271 } | |
272 | |
261 virtual void StartSystemTracing() OVERRIDE { | 273 virtual void StartSystemTracing() OVERRIDE { |
262 dbus::MethodCall method_call( | 274 dbus::MethodCall method_call( |
263 debugd::kDebugdInterface, | 275 debugd::kDebugdInterface, |
264 debugd::kSystraceStart); | 276 debugd::kSystraceStart); |
265 dbus::MessageWriter writer(&method_call); | 277 dbus::MessageWriter writer(&method_call); |
266 writer.AppendString("all"); // TODO(sleffler) parameterize category list | 278 writer.AppendString("all"); // TODO(sleffler) parameterize category list |
267 | 279 |
268 DVLOG(1) << "Requesting a systrace start"; | 280 DVLOG(1) << "Requesting a systrace start"; |
269 debugdaemon_proxy_->CallMethod( | 281 debugdaemon_proxy_->CallMethod( |
270 &method_call, | 282 &method_call, |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
530 callback.Run(false, ""); | 542 callback.Run(false, ""); |
531 } | 543 } |
532 virtual void GetNetworkInterfaces( | 544 virtual void GetNetworkInterfaces( |
533 const GetNetworkInterfacesCallback& callback) OVERRIDE { | 545 const GetNetworkInterfacesCallback& callback) OVERRIDE { |
534 callback.Run(false, ""); | 546 callback.Run(false, ""); |
535 } | 547 } |
536 virtual void GetAllLogs(const GetAllLogsCallback& callback) OVERRIDE { | 548 virtual void GetAllLogs(const GetAllLogsCallback& callback) OVERRIDE { |
537 std::map<std::string, std::string> empty; | 549 std::map<std::string, std::string> empty; |
538 callback.Run(false, empty); | 550 callback.Run(false, empty); |
539 } | 551 } |
552 virtual void GetFeedbackLogs(const GetAllLogsCallback& callback) OVERRIDE { | |
rkc
2012/10/01 20:05:32
Need a whitespace between the end of the last meth
tudalex(Chromium)
2012/10/02 19:10:37
I've seen that they didn't have and I thought it w
| |
553 std::map<std::string, std::string> empty; | |
554 callback.Run(false, empty); | |
555 } | |
540 | 556 |
541 virtual void TestICMP(const std::string& ip_address, | 557 virtual void TestICMP(const std::string& ip_address, |
542 const TestICMPCallback& callback) OVERRIDE { | 558 const TestICMPCallback& callback) OVERRIDE { |
543 callback.Run(false, ""); | 559 callback.Run(false, ""); |
544 } | 560 } |
545 }; | 561 }; |
546 | 562 |
547 DebugDaemonClient::DebugDaemonClient() { | 563 DebugDaemonClient::DebugDaemonClient() { |
548 } | 564 } |
549 | 565 |
550 DebugDaemonClient::~DebugDaemonClient() { | 566 DebugDaemonClient::~DebugDaemonClient() { |
551 } | 567 } |
552 | 568 |
553 // static | 569 // static |
554 DebugDaemonClient::StopSystemTracingCallback | 570 DebugDaemonClient::StopSystemTracingCallback |
555 DebugDaemonClient::EmptyStopSystemTracingCallback() { | 571 DebugDaemonClient::EmptyStopSystemTracingCallback() { |
556 return base::Bind(&EmptyStopSystemTracingCallbackBody); | 572 return base::Bind(&EmptyStopSystemTracingCallbackBody); |
557 } | 573 } |
558 | 574 |
559 // static | 575 // static |
560 DebugDaemonClient* DebugDaemonClient::Create(DBusClientImplementationType type, | 576 DebugDaemonClient* DebugDaemonClient::Create(DBusClientImplementationType type, |
561 dbus::Bus* bus) { | 577 dbus::Bus* bus) { |
562 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 578 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
563 return new DebugDaemonClientImpl(bus); | 579 return new DebugDaemonClientImpl(bus); |
564 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 580 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
565 return new DebugDaemonClientStubImpl(); | 581 return new DebugDaemonClientStubImpl(); |
566 } | 582 } |
567 | 583 |
568 } // namespace chromeos | 584 } // namespace chromeos |
OLD | NEW |