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 "remoting/protocol/channel_authenticator.h" |
| 8 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" |
| 9 |
| 10 namespace remoting { |
| 11 namespace protocol { |
| 12 |
| 13 RejectingAuthenticator::RejectingAuthenticator(RejectionReason rejection_reason) |
| 14 : rejection_reason_(rejection_reason) { |
| 15 } |
| 16 |
| 17 RejectingAuthenticator::~RejectingAuthenticator() = default; |
| 18 |
| 19 Authenticator::State RejectingAuthenticator::state() const { |
| 20 return state_; |
| 21 } |
| 22 bool RejectingAuthenticator::started() const { |
| 23 return true; |
| 24 } |
| 25 |
| 26 Authenticator::RejectionReason |
| 27 RejectingAuthenticator::rejection_reason() const { |
| 28 DCHECK_EQ(state_, REJECTED); |
| 29 return rejection_reason_; |
| 30 } |
| 31 |
| 32 void RejectingAuthenticator::ProcessMessage( |
| 33 const buzz::XmlElement* message, |
| 34 const base::Closure& resume_callback) { |
| 35 DCHECK_EQ(state_, WAITING_MESSAGE); |
| 36 state_ = REJECTED; |
| 37 resume_callback.Run(); |
| 38 } |
| 39 |
| 40 scoped_ptr<buzz::XmlElement> RejectingAuthenticator::GetNextMessage() { |
| 41 NOTREACHED(); |
| 42 return nullptr; |
| 43 } |
| 44 |
| 45 const std::string& RejectingAuthenticator::GetAuthKey() const { |
| 46 NOTREACHED(); |
| 47 return auth_key_; |
| 48 }; |
| 49 |
| 50 scoped_ptr<ChannelAuthenticator> |
| 51 RejectingAuthenticator::CreateChannelAuthenticator() const { |
| 52 NOTREACHED(); |
| 53 return nullptr; |
| 54 } |
| 55 |
| 56 } // namespace protocol |
| 57 } // namespace remoting |
OLD | NEW |