OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "remoting/protocol/rejecting_authenticator.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "remoting/protocol/channel_authenticator.h" |
| 9 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" |
| 10 |
| 11 namespace remoting { |
| 12 namespace protocol { |
| 13 |
| 14 RejectingAuthenticator::RejectingAuthenticator(RejectionReason rejection_reason) |
| 15 : rejection_reason_(rejection_reason) { |
| 16 } |
| 17 |
| 18 RejectingAuthenticator::~RejectingAuthenticator() = default; |
| 19 |
| 20 Authenticator::State RejectingAuthenticator::state() const { |
| 21 return state_; |
| 22 } |
| 23 bool RejectingAuthenticator::started() const { |
| 24 return true; |
| 25 } |
| 26 |
| 27 Authenticator::RejectionReason |
| 28 RejectingAuthenticator::rejection_reason() const { |
| 29 DCHECK_EQ(state_, REJECTED); |
| 30 return rejection_reason_; |
| 31 } |
| 32 |
| 33 void RejectingAuthenticator::ProcessMessage( |
| 34 const buzz::XmlElement* message, |
| 35 const base::Closure& resume_callback) { |
| 36 DCHECK_EQ(state_, WAITING_MESSAGE); |
| 37 state_ = REJECTED; |
| 38 resume_callback.Run(); |
| 39 } |
| 40 |
| 41 scoped_ptr<buzz::XmlElement> RejectingAuthenticator::GetNextMessage() { |
| 42 NOTREACHED(); |
| 43 return nullptr; |
| 44 } |
| 45 |
| 46 const std::string& RejectingAuthenticator::GetAuthKey() const { |
| 47 NOTREACHED(); |
| 48 return auth_key_; |
| 49 }; |
| 50 |
| 51 scoped_ptr<ChannelAuthenticator> |
| 52 RejectingAuthenticator::CreateChannelAuthenticator() const { |
| 53 NOTREACHED(); |
| 54 return nullptr; |
| 55 } |
| 56 |
| 57 } // namespace protocol |
| 58 } // namespace remoting |
OLD | NEW |