Index: remoting/host/gcd_rest_client.cc |
diff --git a/remoting/host/gcd_rest_client.cc b/remoting/host/gcd_rest_client.cc |
index a6dfbd4ceeb6fb02f0130b75c6071f0427cc6b19..d98553856b9d46cec0aa65dcc0bf20dc8ab61c2a 100644 |
--- a/remoting/host/gcd_rest_client.cc |
+++ b/remoting/host/gcd_rest_client.cc |
@@ -6,6 +6,8 @@ |
#include <stdint.h> |
+#include <utility> |
+ |
#include "base/bind.h" |
#include "base/callback_helpers.h" |
#include "base/json/json_writer.h" |
@@ -27,11 +29,9 @@ GcdRestClient::GcdRestClient(const std::string& gcd_base_url, |
gcd_device_id_(gcd_device_id), |
url_request_context_getter_(url_request_context_getter), |
token_getter_(token_getter), |
- clock_(new base::DefaultClock) { |
-} |
+ clock_(new base::DefaultClock) {} |
-GcdRestClient::~GcdRestClient() { |
-} |
+GcdRestClient::~GcdRestClient() {} |
void GcdRestClient::PatchState( |
scoped_ptr<base::DictionaryValue> patch_details, |
@@ -59,9 +59,9 @@ void GcdRestClient::PatchState( |
scoped_ptr<base::ListValue> patch_list(new base::ListValue); |
base::DictionaryValue* patch_item = new base::DictionaryValue; |
patch_list->Append(patch_item); |
- patch_item->Set("patch", patch_details.Pass()); |
+ patch_item->Set("patch", std::move(patch_details)); |
patch_item->SetDouble("timeMs", now); |
- patch_dict->Set("patches", patch_list.Pass()); |
+ patch_dict->Set("patches", std::move(patch_list)); |
// Stringify the message. |
std::string patch_string; |
@@ -88,6 +88,10 @@ void GcdRestClient::PatchState( |
base::Bind(&GcdRestClient::OnTokenReceived, base::Unretained(this))); |
} |
+void GcdRestClient::SetClockForTest(scoped_ptr<base::Clock> clock) { |
+ clock_ = std::move(clock); |
+} |
+ |
void GcdRestClient::OnTokenReceived(OAuthTokenGetter::Status status, |
const std::string& user_email, |
const std::string& access_token) { |