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

Side by Side Diff: remoting/host/token_validator_factory_impl.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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "remoting/host/token_validator_factory_impl.h" 5 #include "remoting/host/token_validator_factory_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility>
10
9 #include "base/base64.h" 11 #include "base/base64.h"
10 #include "base/bind.h" 12 #include "base/bind.h"
11 #include "base/callback.h" 13 #include "base/callback.h"
12 #include "base/json/json_reader.h" 14 #include "base/json/json_reader.h"
13 #include "base/logging.h" 15 #include "base/logging.h"
14 #include "base/macros.h" 16 #include "base/macros.h"
15 #include "base/single_thread_task_runner.h" 17 #include "base/single_thread_task_runner.h"
16 #include "base/strings/string_util.h" 18 #include "base/strings/string_util.h"
17 #include "base/values.h" 19 #include "base/values.h"
18 #include "crypto/random.h" 20 #include "crypto/random.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 third_party_auth_config_.token_validation_url, net::DEFAULT_PRIORITY, 89 third_party_auth_config_.token_validation_url, net::DEFAULT_PRIORITY,
88 this); 90 this);
89 request_->SetExtraRequestHeaderByName( 91 request_->SetExtraRequestHeaderByName(
90 net::HttpRequestHeaders::kContentType, 92 net::HttpRequestHeaders::kContentType,
91 "application/x-www-form-urlencoded", true); 93 "application/x-www-form-urlencoded", true);
92 request_->set_method("POST"); 94 request_->set_method("POST");
93 scoped_ptr<net::UploadElementReader> reader( 95 scoped_ptr<net::UploadElementReader> reader(
94 new net::UploadBytesElementReader( 96 new net::UploadBytesElementReader(
95 post_body_.data(), post_body_.size())); 97 post_body_.data(), post_body_.size()));
96 request_->set_upload( 98 request_->set_upload(
97 net::ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0)); 99 net::ElementsUploadDataStream::CreateWithReader(std::move(reader), 0));
98 request_->Start(); 100 request_->Start();
99 } 101 }
100 102
101 std::string TokenValidatorImpl::CreateScope( 103 std::string TokenValidatorImpl::CreateScope(
102 const std::string& local_jid, 104 const std::string& local_jid,
103 const std::string& remote_jid) { 105 const std::string& remote_jid) {
104 std::string nonce_bytes; 106 std::string nonce_bytes;
105 crypto::RandBytes(base::WriteInto(&nonce_bytes, kNonceLength + 1), 107 crypto::RandBytes(base::WriteInto(&nonce_bytes, kNonceLength + 1),
106 kNonceLength); 108 kNonceLength);
107 std::string nonce; 109 std::string nonce;
(...skipping 17 matching lines...) Expand all
125 TokenValidatorFactoryImpl::CreateTokenValidator( 127 TokenValidatorFactoryImpl::CreateTokenValidator(
126 const std::string& local_jid, 128 const std::string& local_jid,
127 const std::string& remote_jid) { 129 const std::string& remote_jid) {
128 return make_scoped_ptr( 130 return make_scoped_ptr(
129 new TokenValidatorImpl(third_party_auth_config_, 131 new TokenValidatorImpl(third_party_auth_config_,
130 key_pair_, local_jid, remote_jid, 132 key_pair_, local_jid, remote_jid,
131 request_context_getter_)); 133 request_context_getter_));
132 } 134 }
133 135
134 } // namespace remoting 136 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/single_window_input_injector_mac.cc ('k') | remoting/host/token_validator_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698