OLD | NEW |
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 22 matching lines...) Expand all Loading... |
33 rejection_reason_(INVALID_CREDENTIALS) { | 33 rejection_reason_(INVALID_CREDENTIALS) { |
34 } | 34 } |
35 | 35 |
36 NegotiatingAuthenticatorBase::~NegotiatingAuthenticatorBase() { | 36 NegotiatingAuthenticatorBase::~NegotiatingAuthenticatorBase() { |
37 } | 37 } |
38 | 38 |
39 Authenticator::State NegotiatingAuthenticatorBase::state() const { | 39 Authenticator::State NegotiatingAuthenticatorBase::state() const { |
40 return state_; | 40 return state_; |
41 } | 41 } |
42 | 42 |
| 43 bool NegotiatingAuthenticatorBase::started() const { |
| 44 if (!current_authenticator_) { |
| 45 return false; |
| 46 } |
| 47 return current_authenticator_->started(); |
| 48 } |
| 49 |
43 Authenticator::RejectionReason | 50 Authenticator::RejectionReason |
44 NegotiatingAuthenticatorBase::rejection_reason() const { | 51 NegotiatingAuthenticatorBase::rejection_reason() const { |
45 return rejection_reason_; | 52 return rejection_reason_; |
46 } | 53 } |
47 | 54 |
48 void NegotiatingAuthenticatorBase::ProcessMessageInternal( | 55 void NegotiatingAuthenticatorBase::ProcessMessageInternal( |
49 const buzz::XmlElement* message, | 56 const buzz::XmlElement* message, |
50 const base::Closure& resume_callback) { | 57 const base::Closure& resume_callback) { |
51 if (current_authenticator_->state() == WAITING_MESSAGE) { | 58 if (current_authenticator_->state() == WAITING_MESSAGE) { |
52 // If the message was not discarded and the authenticator is waiting for it, | 59 // If the message was not discarded and the authenticator is waiting for it, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 } | 104 } |
98 | 105 |
99 scoped_ptr<ChannelAuthenticator> | 106 scoped_ptr<ChannelAuthenticator> |
100 NegotiatingAuthenticatorBase::CreateChannelAuthenticator() const { | 107 NegotiatingAuthenticatorBase::CreateChannelAuthenticator() const { |
101 DCHECK_EQ(state(), ACCEPTED); | 108 DCHECK_EQ(state(), ACCEPTED); |
102 return current_authenticator_->CreateChannelAuthenticator(); | 109 return current_authenticator_->CreateChannelAuthenticator(); |
103 } | 110 } |
104 | 111 |
105 } // namespace protocol | 112 } // namespace protocol |
106 } // namespace remoting | 113 } // namespace remoting |
OLD | NEW |