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

Side by Side Diff: remoting/protocol/negotiating_authenticator_base.cc

Issue 1534193004: Use std::move() instead of scoped_ptr<>::Pass(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/protocol/negotiating_authenticator_base.h" 5 #include "remoting/protocol/negotiating_authenticator_base.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 scoped_ptr<buzz::XmlElement> result; 88 scoped_ptr<buzz::XmlElement> result;
89 if (current_authenticator_->state() == MESSAGE_READY) { 89 if (current_authenticator_->state() == MESSAGE_READY) {
90 result = current_authenticator_->GetNextMessage(); 90 result = current_authenticator_->GetNextMessage();
91 } else { 91 } else {
92 result = CreateEmptyAuthenticatorMessage(); 92 result = CreateEmptyAuthenticatorMessage();
93 } 93 }
94 state_ = current_authenticator_->state(); 94 state_ = current_authenticator_->state();
95 DCHECK(state_ == ACCEPTED || state_ == WAITING_MESSAGE); 95 DCHECK(state_ == ACCEPTED || state_ == WAITING_MESSAGE);
96 result->AddAttr(kMethodAttributeQName, current_method_.ToString()); 96 result->AddAttr(kMethodAttributeQName, current_method_.ToString());
97 return result.Pass(); 97 return result;
98 } 98 }
99 99
100 void NegotiatingAuthenticatorBase::AddMethod( 100 void NegotiatingAuthenticatorBase::AddMethod(
101 const AuthenticationMethod& method) { 101 const AuthenticationMethod& method) {
102 DCHECK(method.is_valid()); 102 DCHECK(method.is_valid());
103 methods_.push_back(method); 103 methods_.push_back(method);
104 } 104 }
105 105
106 const std::string& NegotiatingAuthenticatorBase::GetAuthKey() const { 106 const std::string& NegotiatingAuthenticatorBase::GetAuthKey() const {
107 DCHECK_EQ(state(), ACCEPTED); 107 DCHECK_EQ(state(), ACCEPTED);
108 return current_authenticator_->GetAuthKey(); 108 return current_authenticator_->GetAuthKey();
109 } 109 }
110 110
111 scoped_ptr<ChannelAuthenticator> 111 scoped_ptr<ChannelAuthenticator>
112 NegotiatingAuthenticatorBase::CreateChannelAuthenticator() const { 112 NegotiatingAuthenticatorBase::CreateChannelAuthenticator() const {
113 DCHECK_EQ(state(), ACCEPTED); 113 DCHECK_EQ(state(), ACCEPTED);
114 return current_authenticator_->CreateChannelAuthenticator(); 114 return current_authenticator_->CreateChannelAuthenticator();
115 } 115 }
116 116
117 } // namespace protocol 117 } // namespace protocol
118 } // namespace remoting 118 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698