Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: chromeos/dbus/debug_daemon_client.cc

Issue 91373004: Move DBusClient stub implementations into separate files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/debug_daemon_client.h ('k') | chromeos/dbus/fake_cros_disks_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/debug_daemon_client.cc
diff --git a/chromeos/dbus/debug_daemon_client.cc b/chromeos/dbus/debug_daemon_client.cc
index c9b760fafd90d5465dd6b4ce51833170c3c7390f..8c11a97a36d3dcd9d0ddc87d88a395e8263569e0 100644
--- a/chromeos/dbus/debug_daemon_client.cc
+++ b/chromeos/dbus/debug_daemon_client.cc
@@ -2,13 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chromeos/dbus/debug_daemon_client.h"
+
#include <fcntl.h>
#include <unistd.h>
-
-#include "chromeos/dbus/debug_daemon_client.h"
+#include <string>
+#include <vector>
#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/callback.h"
+#include "base/location.h"
#include "base/memory/ref_counted_memory.h"
#include "base/message_loop/message_loop.h"
#include "base/platform_file.h"
@@ -616,94 +620,6 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
DISALLOW_COPY_AND_ASSIGN(DebugDaemonClientImpl);
};
-// The DebugDaemonClient implementation used on Linux desktop,
-// which does nothing.
-class DebugDaemonClientStubImpl : public DebugDaemonClient {
- // DebugDaemonClient overrides.
- virtual void Init(dbus::Bus* bus) OVERRIDE {}
- virtual void GetDebugLogs(base::PlatformFile file,
- const GetDebugLogsCallback& callback) OVERRIDE {
- callback.Run(false);
- }
- virtual void SetDebugMode(const std::string& subsystem,
- const SetDebugModeCallback& callback) OVERRIDE {
- callback.Run(false);
- }
- virtual void StartSystemTracing() OVERRIDE {}
- virtual bool RequestStopSystemTracing(const StopSystemTracingCallback&
- callback) OVERRIDE {
- std::string no_data;
- callback.Run(base::RefCountedString::TakeString(&no_data));
- return true;
- }
- virtual void GetRoutes(bool numeric, bool ipv6,
- const GetRoutesCallback& callback) OVERRIDE {
- std::vector<std::string> empty;
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, false, empty));
- }
- virtual void GetNetworkStatus(const GetNetworkStatusCallback& callback)
- OVERRIDE {
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, false, ""));
- }
- virtual void GetModemStatus(const GetModemStatusCallback& callback)
- OVERRIDE {
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, false, ""));
- }
- virtual void GetWiMaxStatus(const GetWiMaxStatusCallback& callback)
- OVERRIDE {
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, false, ""));
- }
- virtual void GetNetworkInterfaces(
- const GetNetworkInterfacesCallback& callback) OVERRIDE {
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, false, ""));
- }
- virtual void GetPerfData(uint32_t duration,
- const GetPerfDataCallback& callback) OVERRIDE {
- std::vector<uint8> data;
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, data));
- }
- virtual void GetScrubbedLogs(const GetLogsCallback& callback) OVERRIDE {
- std::map<std::string, std::string> sample;
- sample["Sample Scrubbed Log"] = "Your email address is xxxxxxxx";
- base::MessageLoop::current()->PostTask(
- FROM_HERE, base::Bind(callback, false, sample));
- }
- virtual void GetAllLogs(const GetLogsCallback& callback) OVERRIDE {
- std::map<std::string, std::string> sample;
- sample["Sample Log"] = "Your email address is abc@abc.com";
- base::MessageLoop::current()->PostTask(
- FROM_HERE, base::Bind(callback, false, sample));
- }
- virtual void GetUserLogFiles(const GetLogsCallback& callback) OVERRIDE {
- std::map<std::string, std::string> user_logs;
- user_logs["preferences"] = "Preferences";
- user_logs["invalid_file"] = "Invalid File";
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(callback, true, user_logs));
- }
-
- virtual void TestICMP(const std::string& ip_address,
- const TestICMPCallback& callback) OVERRIDE {
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, false, ""));
- }
-
- virtual void TestICMPWithOptions(
- const std::string& ip_address,
- const std::map<std::string, std::string>& options,
- const TestICMPCallback& callback) OVERRIDE {
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, false, ""));
- }
-};
-
DebugDaemonClient::DebugDaemonClient() {
}
@@ -717,12 +633,8 @@ DebugDaemonClient::EmptyStopSystemTracingCallback() {
}
// static
-DebugDaemonClient* DebugDaemonClient::Create(
- DBusClientImplementationType type) {
- if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
- return new DebugDaemonClientImpl();
- DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type);
- return new DebugDaemonClientStubImpl();
+DebugDaemonClient* DebugDaemonClient::Create() {
+ return new DebugDaemonClientImpl();
}
} // namespace chromeos
« no previous file with comments | « chromeos/dbus/debug_daemon_client.h ('k') | chromeos/dbus/fake_cros_disks_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698