diff options
-rw-r--r-- | chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc | 15 | ||||
-rw-r--r-- | chrome/browser/chromeos/system_logs/debug_daemon_log_source.h | 1 | ||||
-rw-r--r-- | chromeos/dbus/debug_daemon_client.cc | 26 | ||||
-rw-r--r-- | chromeos/dbus/debug_daemon_client.h | 7 |
4 files changed, 49 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc b/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc index 60ba329..feb1d8f 100644 --- a/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc +++ b/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc @@ -23,6 +23,7 @@ const char kNotAvailable[] = "<not available>"; const char kRoutesKeyName[] = "routes"; const char kNetworkStatusKeyName[] = "network-status"; const char kModemStatusKeyName[] = "modem-status"; +const char kWiMaxStatusKeyName[] = "wimax-status"; const char kUserLogFileKeyName[] = "user_log_files"; namespace chromeos { @@ -53,6 +54,9 @@ void DebugDaemonLogSource::Fetch(const SysLogsSourceCallback& callback) { client->GetModemStatus(base::Bind(&DebugDaemonLogSource::OnGetModemStatus, weak_ptr_factory_.GetWeakPtr())); ++num_pending_requests_; + client->GetWiMaxStatus(base::Bind(&DebugDaemonLogSource::OnGetWiMaxStatus, + weak_ptr_factory_.GetWeakPtr())); + ++num_pending_requests_; client->GetAllLogs(base::Bind(&DebugDaemonLogSource::OnGetLogs, weak_ptr_factory_.GetWeakPtr())); ++num_pending_requests_; @@ -94,6 +98,17 @@ void DebugDaemonLogSource::OnGetModemStatus(bool succeeded, RequestCompleted(); } +void DebugDaemonLogSource::OnGetWiMaxStatus(bool succeeded, + const std::string& status) { + DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + + if (succeeded) + (*response_)[kWiMaxStatusKeyName] = status; + else + (*response_)[kWiMaxStatusKeyName] = kNotAvailable; + RequestCompleted(); +} + void DebugDaemonLogSource::OnGetLogs(bool /* succeeded */, const KeyValueMap& logs) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); diff --git a/chrome/browser/chromeos/system_logs/debug_daemon_log_source.h b/chrome/browser/chromeos/system_logs/debug_daemon_log_source.h index aea030f..8d1626c 100644 --- a/chrome/browser/chromeos/system_logs/debug_daemon_log_source.h +++ b/chrome/browser/chromeos/system_logs/debug_daemon_log_source.h @@ -33,6 +33,7 @@ class DebugDaemonLogSource : public SystemLogsSource { void OnGetRoutes(bool succeeded, const std::vector<std::string>& routes); void OnGetNetworkStatus(bool succeeded, const std::string& status); void OnGetModemStatus(bool succeeded, const std::string& status); + void OnGetWiMaxStatus(bool succeeded, const std::string& status); void OnGetLogs(bool succeeded, const KeyValueMap& logs); void OnGetUserLogFiles(bool succeeded, diff --git a/chromeos/dbus/debug_daemon_client.cc b/chromeos/dbus/debug_daemon_client.cc index e14abf8..50d5d4b 100644 --- a/chromeos/dbus/debug_daemon_client.cc +++ b/chromeos/dbus/debug_daemon_client.cc @@ -230,6 +230,18 @@ class DebugDaemonClientImpl : public DebugDaemonClient { callback)); } + virtual void GetWiMaxStatus(const GetWiMaxStatusCallback& callback) + OVERRIDE { + dbus::MethodCall method_call(debugd::kDebugdInterface, + debugd::kGetWiMaxStatus); + debugdaemon_proxy_->CallMethod( + &method_call, + dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, + base::Bind(&DebugDaemonClientImpl::OnGetWiMaxStatus, + weak_ptr_factory_.GetWeakPtr(), + callback)); + } + virtual void GetNetworkInterfaces( const GetNetworkInterfacesCallback& callback) OVERRIDE { dbus::MethodCall method_call(debugd::kDebugdInterface, @@ -459,6 +471,15 @@ class DebugDaemonClientImpl : public DebugDaemonClient { callback.Run(false, ""); } + void OnGetWiMaxStatus(const GetWiMaxStatusCallback& callback, + dbus::Response* response) { + std::string status; + if (response && dbus::MessageReader(response).PopString(&status)) + callback.Run(true, status); + else + callback.Run(false, ""); + } + void OnGetNetworkInterfaces(const GetNetworkInterfacesCallback& callback, dbus::Response* response) { std::string status; @@ -618,6 +639,11 @@ class DebugDaemonClientStubImpl : public DebugDaemonClient { 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, diff --git a/chromeos/dbus/debug_daemon_client.h b/chromeos/dbus/debug_daemon_client.h index af332d5..92652e3 100644 --- a/chromeos/dbus/debug_daemon_client.h +++ b/chromeos/dbus/debug_daemon_client.h @@ -68,6 +68,13 @@ class CHROMEOS_EXPORT DebugDaemonClient { // Gets information about modem status as json. virtual void GetModemStatus(const GetModemStatusCallback& callback) = 0; + // Called once GetWiMaxStatus() is complete. + typedef base::Callback<void(bool succeeded, const std::string& status)> + GetWiMaxStatusCallback; + + // Gets information about WiMAX status as json. + virtual void GetWiMaxStatus(const GetWiMaxStatusCallback& callback) = 0; + // Called once GetNetworkInterfaces() is complete. Takes two parameters: // - succeeded: information was obtained successfully. // - status: network interfaces information in json. For details, please refer |