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" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/chromeos/chromeos_version.h" | 12 #include "base/chromeos/chromeos_version.h" |
13 #include "base/eintr_wrapper.h" | 13 #include "base/eintr_wrapper.h" |
14 #include "base/memory/ref_counted_memory.h" | 14 #include "base/memory/ref_counted_memory.h" |
15 #include "base/message_loop.h" | |
15 #include "base/platform_file.h" | 16 #include "base/platform_file.h" |
16 #include "base/string_util.h" | 17 #include "base/string_util.h" |
17 #include "base/threading/worker_pool.h" | 18 #include "base/threading/worker_pool.h" |
18 #include "dbus/bus.h" | 19 #include "dbus/bus.h" |
19 #include "dbus/message.h" | 20 #include "dbus/message.h" |
20 #include "dbus/object_path.h" | 21 #include "dbus/object_path.h" |
21 #include "dbus/object_proxy.h" | 22 #include "dbus/object_proxy.h" |
22 #include "net/base/file_stream.h" | 23 #include "net/base/file_stream.h" |
23 #include "net/base/io_buffer.h" | 24 #include "net/base/io_buffer.h" |
24 #include "net/base/net_errors.h" | 25 #include "net/base/net_errors.h" |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
530 virtual void StartSystemTracing() OVERRIDE {} | 531 virtual void StartSystemTracing() OVERRIDE {} |
531 virtual bool RequestStopSystemTracing(const StopSystemTracingCallback& | 532 virtual bool RequestStopSystemTracing(const StopSystemTracingCallback& |
532 callback) OVERRIDE { | 533 callback) OVERRIDE { |
533 std::string no_data; | 534 std::string no_data; |
534 callback.Run(base::RefCountedString::TakeString(&no_data)); | 535 callback.Run(base::RefCountedString::TakeString(&no_data)); |
535 return true; | 536 return true; |
536 } | 537 } |
537 virtual void GetRoutes(bool numeric, bool ipv6, | 538 virtual void GetRoutes(bool numeric, bool ipv6, |
538 const GetRoutesCallback& callback) OVERRIDE { | 539 const GetRoutesCallback& callback) OVERRIDE { |
539 std::vector<std::string> empty; | 540 std::vector<std::string> empty; |
540 callback.Run(false, empty); | 541 MessageLoop::current()->PostTask(FROM_HERE, |
542 base::Bind(callback, false, empty)); | |
541 } | 543 } |
542 virtual void GetNetworkStatus(const GetNetworkStatusCallback& callback) | 544 virtual void GetNetworkStatus(const GetNetworkStatusCallback& callback) |
543 OVERRIDE { | 545 OVERRIDE { |
544 callback.Run(false, ""); | 546 MessageLoop::current()->PostTask(FROM_HERE, |
547 base::Bind(callback, false, "")); | |
545 } | 548 } |
546 virtual void GetModemStatus(const GetModemStatusCallback& callback) | 549 virtual void GetModemStatus(const GetModemStatusCallback& callback) |
547 OVERRIDE { | 550 OVERRIDE { |
548 callback.Run(false, ""); | 551 MessageLoop::current()->PostTask(FROM_HERE, |
552 base::Bind(callback, false, "")); | |
549 } | 553 } |
550 virtual void GetNetworkInterfaces( | 554 virtual void GetNetworkInterfaces( |
551 const GetNetworkInterfacesCallback& callback) OVERRIDE { | 555 const GetNetworkInterfacesCallback& callback) OVERRIDE { |
552 callback.Run(false, ""); | 556 MessageLoop::current()->PostTask(FROM_HERE, |
557 base::Bind(callback, false, "")); | |
553 } | 558 } |
554 virtual void GetAllLogs(const GetLogsCallback& callback) OVERRIDE { | 559 virtual void GetAllLogs(const GetLogsCallback& callback) OVERRIDE { |
555 std::map<std::string, std::string> empty; | 560 std::map<std::string, std::string> empty; |
556 callback.Run(false, empty); | 561 MessageLoop::current()->PostTask(FROM_HERE, |
562 base::Bind(callback, false, empty)); | |
557 } | 563 } |
558 virtual void GetUserLogFiles(const GetLogsCallback& callback) OVERRIDE { | 564 virtual void GetUserLogFiles(const GetLogsCallback& callback) OVERRIDE { |
559 std::map<std::string, std::string> empty; | 565 std::map<std::string, std::string> empty; |
560 callback.Run(false, empty); | 566 MessageLoop::current()->PostTask(FROM_HERE, |
567 base::Bind(callback, false, empty)); | |
561 } | 568 } |
562 | 569 |
563 virtual void TestICMP(const std::string& ip_address, | 570 virtual void TestICMP(const std::string& ip_address, |
564 const TestICMPCallback& callback) OVERRIDE { | 571 const TestICMPCallback& callback) OVERRIDE { |
565 callback.Run(false, ""); | 572 MessageLoop::current()->PostTask(FROM_HERE, |
573 base::Bind(callback, false, "")); | |
satorux1
2012/11/12 00:40:43
Changes in this file seem to be unrelated to the m
stevenjb
2012/11/12 19:46:40
Sorry, meant to mention that. These were from http
| |
566 } | 574 } |
567 }; | 575 }; |
568 | 576 |
569 DebugDaemonClient::DebugDaemonClient() { | 577 DebugDaemonClient::DebugDaemonClient() { |
570 } | 578 } |
571 | 579 |
572 DebugDaemonClient::~DebugDaemonClient() { | 580 DebugDaemonClient::~DebugDaemonClient() { |
573 } | 581 } |
574 | 582 |
575 // static | 583 // static |
576 DebugDaemonClient::StopSystemTracingCallback | 584 DebugDaemonClient::StopSystemTracingCallback |
577 DebugDaemonClient::EmptyStopSystemTracingCallback() { | 585 DebugDaemonClient::EmptyStopSystemTracingCallback() { |
578 return base::Bind(&EmptyStopSystemTracingCallbackBody); | 586 return base::Bind(&EmptyStopSystemTracingCallbackBody); |
579 } | 587 } |
580 | 588 |
581 // static | 589 // static |
582 DebugDaemonClient* DebugDaemonClient::Create(DBusClientImplementationType type, | 590 DebugDaemonClient* DebugDaemonClient::Create(DBusClientImplementationType type, |
583 dbus::Bus* bus) { | 591 dbus::Bus* bus) { |
584 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 592 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
585 return new DebugDaemonClientImpl(bus); | 593 return new DebugDaemonClientImpl(bus); |
586 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 594 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
587 return new DebugDaemonClientStubImpl(); | 595 return new DebugDaemonClientStubImpl(); |
588 } | 596 } |
589 | 597 |
590 } // namespace chromeos | 598 } // namespace chromeos |
OLD | NEW |