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

Side by Side Diff: remoting/host/gcd_rest_client.h

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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_HOST_GCD_REST_CLIENT_H_ 5 #ifndef REMOTING_HOST_GCD_REST_CLIENT_H_
6 #define REMOTING_HOST_GCD_REST_CLIENT_H_ 6 #define REMOTING_HOST_GCD_REST_CLIENT_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // Tests whether is object is currently running a request. Only one 46 // Tests whether is object is currently running a request. Only one
47 // request at a time may be pending. 47 // request at a time may be pending.
48 bool HasPendingRequest() { return url_fetcher_; } 48 bool HasPendingRequest() { return url_fetcher_; }
49 49
50 // Sends a 'patchState' request to the GCD API. Constructs and 50 // Sends a 'patchState' request to the GCD API. Constructs and
51 // sends an appropriate JSON message M where |patch_details| becomes 51 // sends an appropriate JSON message M where |patch_details| becomes
52 // the value of M.patches[0].patch. 52 // the value of M.patches[0].patch.
53 void PatchState(scoped_ptr<base::DictionaryValue> patch_details, 53 void PatchState(scoped_ptr<base::DictionaryValue> patch_details,
54 const GcdRestClient::ResultCallback& callback); 54 const GcdRestClient::ResultCallback& callback);
55 55
56 void SetClockForTest(scoped_ptr<base::Clock> clock) { clock_ = clock.Pass(); } 56 void SetClockForTest(scoped_ptr<base::Clock> clock) {
57 clock_ = std::move(clock);
58 }
57 59
58 private: 60 private:
59 void OnTokenReceived(OAuthTokenGetter::Status status, 61 void OnTokenReceived(OAuthTokenGetter::Status status,
60 const std::string& user_email, 62 const std::string& user_email,
61 const std::string& access_token); 63 const std::string& access_token);
62 void FinishCurrentRequest(Result result); 64 void FinishCurrentRequest(Result result);
63 65
64 // URLFetcherDelegate interface. 66 // URLFetcherDelegate interface.
65 void OnURLFetchComplete(const net::URLFetcher* source) override; 67 void OnURLFetchComplete(const net::URLFetcher* source) override;
66 68
67 std::string gcd_base_url_; 69 std::string gcd_base_url_;
68 std::string gcd_device_id_; 70 std::string gcd_device_id_;
69 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; 71 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
70 OAuthTokenGetter* token_getter_; 72 OAuthTokenGetter* token_getter_;
71 scoped_ptr<base::Clock> clock_; 73 scoped_ptr<base::Clock> clock_;
72 scoped_ptr<net::URLFetcher> url_fetcher_; 74 scoped_ptr<net::URLFetcher> url_fetcher_;
73 ResultCallback callback_; 75 ResultCallback callback_;
74 76
75 DISALLOW_COPY_AND_ASSIGN(GcdRestClient); 77 DISALLOW_COPY_AND_ASSIGN(GcdRestClient);
76 }; 78 };
77 79
78 } // namespace remoting 80 } // namespace remoting
79 81
80 #endif // REMOTING_HOST_GCD_REST_CLIENT_H_ 82 #endif // REMOTING_HOST_GCD_REST_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698