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

Side by Side Diff: remoting/host/token_validator_factory_impl.cc

Issue 810133003: replace NULL->nullptr in src/remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months 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
« no previous file with comments | « remoting/host/token_validator_base.cc ('k') | remoting/host/username.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 void TokenValidatorImpl::StartValidateRequest(const std::string& token) { 75 void TokenValidatorImpl::StartValidateRequest(const std::string& token) {
76 post_body_ = "code=" + net::EscapeUrlEncodedData(token, true) + 76 post_body_ = "code=" + net::EscapeUrlEncodedData(token, true) +
77 "&client_id=" + net::EscapeUrlEncodedData( 77 "&client_id=" + net::EscapeUrlEncodedData(
78 key_pair_->GetPublicKey(), true) + 78 key_pair_->GetPublicKey(), true) +
79 "&client_secret=" + net::EscapeUrlEncodedData( 79 "&client_secret=" + net::EscapeUrlEncodedData(
80 key_pair_->SignMessage(token), true) + 80 key_pair_->SignMessage(token), true) +
81 "&grant_type=authorization_code"; 81 "&grant_type=authorization_code";
82 82
83 request_ = request_context_getter_->GetURLRequestContext()->CreateRequest( 83 request_ = request_context_getter_->GetURLRequestContext()->CreateRequest(
84 third_party_auth_config_.token_validation_url, net::DEFAULT_PRIORITY, 84 third_party_auth_config_.token_validation_url, net::DEFAULT_PRIORITY,
85 this, NULL); 85 this, nullptr);
86 request_->SetExtraRequestHeaderByName( 86 request_->SetExtraRequestHeaderByName(
87 net::HttpRequestHeaders::kContentType, 87 net::HttpRequestHeaders::kContentType,
88 "application/x-www-form-urlencoded", true); 88 "application/x-www-form-urlencoded", true);
89 request_->set_method("POST"); 89 request_->set_method("POST");
90 scoped_ptr<net::UploadElementReader> reader( 90 scoped_ptr<net::UploadElementReader> reader(
91 new net::UploadBytesElementReader( 91 new net::UploadBytesElementReader(
92 post_body_.data(), post_body_.size())); 92 post_body_.data(), post_body_.size()));
93 request_->set_upload( 93 request_->set_upload(
94 net::ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0)); 94 net::ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0));
95 request_->Start(); 95 request_->Start();
(...skipping 25 matching lines...) Expand all
121 TokenValidatorFactoryImpl::CreateTokenValidator( 121 TokenValidatorFactoryImpl::CreateTokenValidator(
122 const std::string& local_jid, 122 const std::string& local_jid,
123 const std::string& remote_jid) { 123 const std::string& remote_jid) {
124 return make_scoped_ptr( 124 return make_scoped_ptr(
125 new TokenValidatorImpl(third_party_auth_config_, 125 new TokenValidatorImpl(third_party_auth_config_,
126 key_pair_, local_jid, remote_jid, 126 key_pair_, local_jid, remote_jid,
127 request_context_getter_)); 127 request_context_getter_));
128 } 128 }
129 129
130 } // namespace remoting 130 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/token_validator_base.cc ('k') | remoting/host/username.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698