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

Unified Diff: remoting/protocol/negotiating_authenticator_base.cc

Issue 1755273003: Simplify AuthenticationMethod type and PIN hash handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: remoting/protocol/negotiating_authenticator_base.cc
diff --git a/remoting/protocol/negotiating_authenticator_base.cc b/remoting/protocol/negotiating_authenticator_base.cc
index 12e1d8b5bf12a87f88133daf0b5e7b6c83721856..1d2546649d9f522d219afac8d40b892a77b58408 100644
--- a/remoting/protocol/negotiating_authenticator_base.cc
+++ b/remoting/protocol/negotiating_authenticator_base.cc
@@ -28,13 +28,9 @@ const char NegotiatingAuthenticatorBase::kSupportedMethodsSeparator = ',';
NegotiatingAuthenticatorBase::NegotiatingAuthenticatorBase(
Authenticator::State initial_state)
- : current_method_(AuthenticationMethod::Invalid()),
- state_(initial_state),
- rejection_reason_(INVALID_CREDENTIALS) {
-}
+ : state_(initial_state) {}
-NegotiatingAuthenticatorBase::~NegotiatingAuthenticatorBase() {
-}
+NegotiatingAuthenticatorBase::~NegotiatingAuthenticatorBase() {}
Authenticator::State NegotiatingAuthenticatorBase::state() const {
return state_;
@@ -83,7 +79,7 @@ void NegotiatingAuthenticatorBase::UpdateState(
scoped_ptr<buzz::XmlElement>
NegotiatingAuthenticatorBase::GetNextMessageInternal() {
DCHECK_EQ(state(), MESSAGE_READY);
- DCHECK(current_method_.is_valid());
+ DCHECK(current_method_ != AuthenticationMethod::INVALID);
scoped_ptr<buzz::XmlElement> result;
if (current_authenticator_->state() == MESSAGE_READY) {
@@ -93,13 +89,13 @@ NegotiatingAuthenticatorBase::GetNextMessageInternal() {
}
state_ = current_authenticator_->state();
DCHECK(state_ == ACCEPTED || state_ == WAITING_MESSAGE);
- result->AddAttr(kMethodAttributeQName, current_method_.ToString());
+ result->AddAttr(kMethodAttributeQName,
+ AuthenticationMethodToString(current_method_));
return result;
}
-void NegotiatingAuthenticatorBase::AddMethod(
- const AuthenticationMethod& method) {
- DCHECK(method.is_valid());
+void NegotiatingAuthenticatorBase::AddMethod(AuthenticationMethod method) {
+ DCHECK(method != AuthenticationMethod::INVALID);
methods_.push_back(method);
}

Powered by Google App Engine
This is Rietveld 408576698