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

Unified Diff: remoting/host/gcd_rest_client.cc

Issue 1549493004: Use std::move() instead of .Pass() in remoting/host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass
Patch Set: include <utility> Created 5 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 | « remoting/host/gcd_rest_client.h ('k') | remoting/host/gcd_rest_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « remoting/host/gcd_rest_client.h ('k') | remoting/host/gcd_rest_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698