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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 writer.AppendUint32(duration); | 262 writer.AppendUint32(duration); |
263 | 263 |
264 debugdaemon_proxy_->CallMethod( | 264 debugdaemon_proxy_->CallMethod( |
265 &method_call, | 265 &method_call, |
266 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 266 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
267 base::Bind(&DebugDaemonClientImpl::OnGetPerfData, | 267 base::Bind(&DebugDaemonClientImpl::OnGetPerfData, |
268 weak_ptr_factory_.GetWeakPtr(), | 268 weak_ptr_factory_.GetWeakPtr(), |
269 callback)); | 269 callback)); |
270 } | 270 } |
271 | 271 |
| 272 virtual void GetScrubbedLogs(const GetLogsCallback& callback) OVERRIDE { |
| 273 dbus::MethodCall method_call(debugd::kDebugdInterface, |
| 274 debugd::kGetFeedbackLogs); |
| 275 debugdaemon_proxy_->CallMethod( |
| 276 &method_call, |
| 277 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
| 278 base::Bind(&DebugDaemonClientImpl::OnGetAllLogs, |
| 279 weak_ptr_factory_.GetWeakPtr(), |
| 280 callback)); |
| 281 } |
| 282 |
272 virtual void GetAllLogs(const GetLogsCallback& callback) | 283 virtual void GetAllLogs(const GetLogsCallback& callback) |
273 OVERRIDE { | 284 OVERRIDE { |
274 dbus::MethodCall method_call(debugd::kDebugdInterface, | 285 dbus::MethodCall method_call(debugd::kDebugdInterface, |
275 debugd::kGetAllLogs); | 286 debugd::kGetAllLogs); |
276 debugdaemon_proxy_->CallMethod( | 287 debugdaemon_proxy_->CallMethod( |
277 &method_call, | 288 &method_call, |
278 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 289 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
279 base::Bind(&DebugDaemonClientImpl::OnGetAllLogs, | 290 base::Bind(&DebugDaemonClientImpl::OnGetAllLogs, |
280 weak_ptr_factory_.GetWeakPtr(), | 291 weak_ptr_factory_.GetWeakPtr(), |
281 callback)); | 292 callback)); |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 } | 657 } |
647 virtual void GetNetworkInterfaces( | 658 virtual void GetNetworkInterfaces( |
648 const GetNetworkInterfacesCallback& callback) OVERRIDE { | 659 const GetNetworkInterfacesCallback& callback) OVERRIDE { |
649 base::MessageLoop::current()->PostTask(FROM_HERE, | 660 base::MessageLoop::current()->PostTask(FROM_HERE, |
650 base::Bind(callback, false, "")); | 661 base::Bind(callback, false, "")); |
651 } | 662 } |
652 virtual void GetPerfData(uint32_t duration, | 663 virtual void GetPerfData(uint32_t duration, |
653 const GetPerfDataCallback& callback) OVERRIDE { | 664 const GetPerfDataCallback& callback) OVERRIDE { |
654 std::vector<uint8> data; | 665 std::vector<uint8> data; |
655 base::MessageLoop::current()->PostTask(FROM_HERE, | 666 base::MessageLoop::current()->PostTask(FROM_HERE, |
656 base::Bind(callback, data)); | 667 base::Bind(callback, data)); |
| 668 } |
| 669 virtual void GetScrubbedLogs(const GetLogsCallback& callback) OVERRIDE { |
| 670 std::map<std::string, std::string> sample; |
| 671 sample["Sample Scrubbed Log"] = "Your email address is xxxxxxxx"; |
| 672 base::MessageLoop::current()->PostTask( |
| 673 FROM_HERE, base::Bind(callback, false, sample)); |
657 } | 674 } |
658 virtual void GetAllLogs(const GetLogsCallback& callback) OVERRIDE { | 675 virtual void GetAllLogs(const GetLogsCallback& callback) OVERRIDE { |
659 std::map<std::string, std::string> empty; | 676 std::map<std::string, std::string> sample; |
660 base::MessageLoop::current()->PostTask(FROM_HERE, | 677 sample["Sample Log"] = "Your email address is abc@abc.com"; |
661 base::Bind(callback, false, empty)); | 678 base::MessageLoop::current()->PostTask( |
| 679 FROM_HERE, base::Bind(callback, false, sample)); |
662 } | 680 } |
663 virtual void GetUserLogFiles(const GetLogsCallback& callback) OVERRIDE { | 681 virtual void GetUserLogFiles(const GetLogsCallback& callback) OVERRIDE { |
664 std::map<std::string, std::string> user_logs; | 682 std::map<std::string, std::string> user_logs; |
665 user_logs["preferences"] = "Preferences"; | 683 user_logs["preferences"] = "Preferences"; |
666 user_logs["invalid_file"] = "Invalid File"; | 684 user_logs["invalid_file"] = "Invalid File"; |
667 base::MessageLoop::current()->PostTask( | 685 base::MessageLoop::current()->PostTask( |
668 FROM_HERE, | 686 FROM_HERE, |
669 base::Bind(callback, true, user_logs)); | 687 base::Bind(callback, true, user_logs)); |
670 } | 688 } |
671 | 689 |
(...skipping 27 matching lines...) Expand all Loading... |
699 // static | 717 // static |
700 DebugDaemonClient* DebugDaemonClient::Create(DBusClientImplementationType type, | 718 DebugDaemonClient* DebugDaemonClient::Create(DBusClientImplementationType type, |
701 dbus::Bus* bus) { | 719 dbus::Bus* bus) { |
702 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 720 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
703 return new DebugDaemonClientImpl(bus); | 721 return new DebugDaemonClientImpl(bus); |
704 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 722 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
705 return new DebugDaemonClientStubImpl(); | 723 return new DebugDaemonClientStubImpl(); |
706 } | 724 } |
707 | 725 |
708 } // namespace chromeos | 726 } // namespace chromeos |
OLD | NEW |