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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 dbus::MethodCall method_call(debugd::kDebugdInterface, | 249 dbus::MethodCall method_call(debugd::kDebugdInterface, |
250 debugd::kGetAllLogs); | 250 debugd::kGetAllLogs); |
251 debugdaemon_proxy_->CallMethod( | 251 debugdaemon_proxy_->CallMethod( |
252 &method_call, | 252 &method_call, |
253 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 253 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
254 base::Bind(&DebugDaemonClientImpl::OnGetAllLogs, | 254 base::Bind(&DebugDaemonClientImpl::OnGetAllLogs, |
255 weak_ptr_factory_.GetWeakPtr(), | 255 weak_ptr_factory_.GetWeakPtr(), |
256 callback)); | 256 callback)); |
257 } | 257 } |
258 | 258 |
| 259 virtual void GetFeedbackLogs(const GetLogsCallback& callback) |
| 260 OVERRIDE { |
| 261 dbus::MethodCall method_call(debugd::kDebugdInterface, |
| 262 debugd::kGetFeedbackLogs); |
| 263 debugdaemon_proxy_->CallMethod( |
| 264 &method_call, |
| 265 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
| 266 base::Bind(&DebugDaemonClientImpl::OnGetAllLogs, |
| 267 weak_ptr_factory_.GetWeakPtr(), |
| 268 callback)); |
| 269 } |
| 270 |
259 virtual void GetUserLogFiles( | 271 virtual void GetUserLogFiles( |
260 const GetLogsCallback& callback) OVERRIDE { | 272 const GetLogsCallback& callback) OVERRIDE { |
261 dbus::MethodCall method_call(debugd::kDebugdInterface, | 273 dbus::MethodCall method_call(debugd::kDebugdInterface, |
262 debugd::kGetUserLogFiles); | 274 debugd::kGetUserLogFiles); |
263 debugdaemon_proxy_->CallMethod( | 275 debugdaemon_proxy_->CallMethod( |
264 &method_call, | 276 &method_call, |
265 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 277 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
266 base::Bind(&DebugDaemonClientImpl::OnGetUserLogFiles, | 278 base::Bind(&DebugDaemonClientImpl::OnGetUserLogFiles, |
267 weak_ptr_factory_.GetWeakPtr(), | 279 weak_ptr_factory_.GetWeakPtr(), |
268 callback)); | 280 callback)); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 }; | 528 }; |
517 | 529 |
518 // The DebugDaemonClient implementation used on Linux desktop, | 530 // The DebugDaemonClient implementation used on Linux desktop, |
519 // which does nothing. | 531 // which does nothing. |
520 class DebugDaemonClientStubImpl : public DebugDaemonClient { | 532 class DebugDaemonClientStubImpl : public DebugDaemonClient { |
521 // DebugDaemonClient overrides. | 533 // DebugDaemonClient overrides. |
522 virtual void GetDebugLogs(base::PlatformFile file, | 534 virtual void GetDebugLogs(base::PlatformFile file, |
523 const GetDebugLogsCallback& callback) OVERRIDE { | 535 const GetDebugLogsCallback& callback) OVERRIDE { |
524 callback.Run(false); | 536 callback.Run(false); |
525 } | 537 } |
| 538 |
526 virtual void SetDebugMode(const std::string& subsystem, | 539 virtual void SetDebugMode(const std::string& subsystem, |
527 const SetDebugModeCallback& callback) OVERRIDE { | 540 const SetDebugModeCallback& callback) OVERRIDE { |
528 callback.Run(false); | 541 callback.Run(false); |
529 } | 542 } |
| 543 |
530 virtual void StartSystemTracing() OVERRIDE {} | 544 virtual void StartSystemTracing() OVERRIDE {} |
| 545 |
531 virtual bool RequestStopSystemTracing(const StopSystemTracingCallback& | 546 virtual bool RequestStopSystemTracing(const StopSystemTracingCallback& |
532 callback) OVERRIDE { | 547 callback) OVERRIDE { |
533 std::string no_data; | 548 std::string no_data; |
534 callback.Run(base::RefCountedString::TakeString(&no_data)); | 549 callback.Run(base::RefCountedString::TakeString(&no_data)); |
535 return true; | 550 return true; |
536 } | 551 } |
| 552 |
537 virtual void GetRoutes(bool numeric, bool ipv6, | 553 virtual void GetRoutes(bool numeric, bool ipv6, |
538 const GetRoutesCallback& callback) OVERRIDE { | 554 const GetRoutesCallback& callback) OVERRIDE { |
539 std::vector<std::string> empty; | 555 std::vector<std::string> empty; |
540 callback.Run(false, empty); | 556 callback.Run(false, empty); |
541 } | 557 } |
| 558 |
542 virtual void GetNetworkStatus(const GetNetworkStatusCallback& callback) | 559 virtual void GetNetworkStatus(const GetNetworkStatusCallback& callback) |
543 OVERRIDE { | 560 OVERRIDE { |
544 callback.Run(false, ""); | 561 callback.Run(false, ""); |
545 } | 562 } |
| 563 |
546 virtual void GetModemStatus(const GetModemStatusCallback& callback) | 564 virtual void GetModemStatus(const GetModemStatusCallback& callback) |
547 OVERRIDE { | 565 OVERRIDE { |
548 callback.Run(false, ""); | 566 callback.Run(false, ""); |
549 } | 567 } |
| 568 |
550 virtual void GetNetworkInterfaces( | 569 virtual void GetNetworkInterfaces( |
551 const GetNetworkInterfacesCallback& callback) OVERRIDE { | 570 const GetNetworkInterfacesCallback& callback) OVERRIDE { |
552 callback.Run(false, ""); | 571 callback.Run(false, ""); |
553 } | 572 } |
| 573 |
554 virtual void GetAllLogs(const GetLogsCallback& callback) OVERRIDE { | 574 virtual void GetAllLogs(const GetLogsCallback& callback) OVERRIDE { |
555 std::map<std::string, std::string> empty; | 575 std::map<std::string, std::string> empty; |
556 callback.Run(false, empty); | 576 callback.Run(false, empty); |
557 } | 577 } |
| 578 |
558 virtual void GetUserLogFiles(const GetLogsCallback& callback) OVERRIDE { | 579 virtual void GetUserLogFiles(const GetLogsCallback& callback) OVERRIDE { |
559 std::map<std::string, std::string> empty; | 580 std::map<std::string, std::string> empty; |
560 callback.Run(false, empty); | 581 callback.Run(false, empty); |
561 } | 582 } |
562 | 583 |
| 584 virtual void GetFeedbackLogs(const GetLogsCallback& callback) OVERRIDE { |
| 585 std::map<std::string, std::string> empty; |
| 586 callback.Run(false, empty); |
| 587 } |
| 588 |
563 virtual void TestICMP(const std::string& ip_address, | 589 virtual void TestICMP(const std::string& ip_address, |
564 const TestICMPCallback& callback) OVERRIDE { | 590 const TestICMPCallback& callback) OVERRIDE { |
565 callback.Run(false, ""); | 591 callback.Run(false, ""); |
566 } | 592 } |
567 }; | 593 }; |
568 | 594 |
569 DebugDaemonClient::DebugDaemonClient() { | 595 DebugDaemonClient::DebugDaemonClient() { |
570 } | 596 } |
571 | 597 |
572 DebugDaemonClient::~DebugDaemonClient() { | 598 DebugDaemonClient::~DebugDaemonClient() { |
573 } | 599 } |
574 | 600 |
575 // static | 601 // static |
576 DebugDaemonClient::StopSystemTracingCallback | 602 DebugDaemonClient::StopSystemTracingCallback |
577 DebugDaemonClient::EmptyStopSystemTracingCallback() { | 603 DebugDaemonClient::EmptyStopSystemTracingCallback() { |
578 return base::Bind(&EmptyStopSystemTracingCallbackBody); | 604 return base::Bind(&EmptyStopSystemTracingCallbackBody); |
579 } | 605 } |
580 | 606 |
581 // static | 607 // static |
582 DebugDaemonClient* DebugDaemonClient::Create(DBusClientImplementationType type, | 608 DebugDaemonClient* DebugDaemonClient::Create(DBusClientImplementationType type, |
583 dbus::Bus* bus) { | 609 dbus::Bus* bus) { |
584 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 610 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
585 return new DebugDaemonClientImpl(bus); | 611 return new DebugDaemonClientImpl(bus); |
586 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 612 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
587 return new DebugDaemonClientStubImpl(); | 613 return new DebugDaemonClientStubImpl(); |
588 } | 614 } |
589 | 615 |
590 } // namespace chromeos | 616 } // namespace chromeos |
OLD | NEW |