| Index: extensions/browser/api/diagnostics/diagnostics_api_chromeos.cc
|
| diff --git a/chrome/browser/extensions/api/diagnostics/diagnostics_api_chromeos.cc b/extensions/browser/api/diagnostics/diagnostics_api_chromeos.cc
|
| similarity index 79%
|
| rename from chrome/browser/extensions/api/diagnostics/diagnostics_api_chromeos.cc
|
| rename to extensions/browser/api/diagnostics/diagnostics_api_chromeos.cc
|
| index 9ae0f18e5b3551e43dd61be3e8211dca6536866c..f14b8fb0cbe60a03643b44a350f01ca8d65a3b01 100644
|
| --- a/chrome/browser/extensions/api/diagnostics/diagnostics_api_chromeos.cc
|
| +++ b/extensions/browser/api/diagnostics/diagnostics_api_chromeos.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "chrome/browser/extensions/api/diagnostics/diagnostics_api.h"
|
| +#include "extensions/browser/api/diagnostics/diagnostics_api.h"
|
|
|
| #include "base/bind.h"
|
| #include "base/callback.h"
|
| @@ -25,12 +25,9 @@ const char kSize[] = "size";
|
| typedef base::Callback<void(
|
| DiagnosticsSendPacketFunction::SendPacketResultCode result_code,
|
| const std::string& ip,
|
| - double latency)>
|
| - SendPacketCallback;
|
| + double latency)> SendPacketCallback;
|
|
|
| -bool ParseResult(const std::string& status,
|
| - std::string* ip,
|
| - double* latency) {
|
| +bool ParseResult(const std::string& status, std::string* ip, double* latency) {
|
| // Parses the result and returns IP and latency.
|
| scoped_ptr<base::Value> parsed_value(base::JSONReader::Read(status));
|
| if (!parsed_value)
|
| @@ -54,18 +51,15 @@ bool ParseResult(const std::string& status,
|
| return true;
|
| }
|
|
|
| -void OnTestICMPCompleted(
|
| - const SendPacketCallback& callback,
|
| - bool succeeded,
|
| - const std::string& status) {
|
| +void OnTestICMPCompleted(const SendPacketCallback& callback,
|
| + bool succeeded,
|
| + const std::string& status) {
|
| std::string ip;
|
| double latency;
|
| if (!succeeded || !ParseResult(status, &ip, &latency)) {
|
| callback.Run(DiagnosticsSendPacketFunction::SEND_PACKET_FAILED, "", 0.0);
|
| } else {
|
| - callback.Run(DiagnosticsSendPacketFunction::SEND_PACKET_OK,
|
| - ip,
|
| - latency);
|
| + callback.Run(DiagnosticsSendPacketFunction::SEND_PACKET_OK, ip, latency);
|
| }
|
| }
|
|
|
| @@ -81,8 +75,9 @@ void DiagnosticsSendPacketFunction::AsyncWorkStart() {
|
| if (parameters_->options.size)
|
| config[kSize] = base::IntToString(*parameters_->options.size);
|
|
|
| - chromeos::DBusThreadManager::Get()->GetDebugDaemonClient()->
|
| - TestICMPWithOptions(
|
| + chromeos::DBusThreadManager::Get()
|
| + ->GetDebugDaemonClient()
|
| + ->TestICMPWithOptions(
|
| parameters_->options.ip, config,
|
| base::Bind(
|
| OnTestICMPCompleted,
|
|
|