| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/third_party_authenticator_base.h" | 5 #include "remoting/protocol/third_party_authenticator_base.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 DCHECK_EQ(underlying_->state(), WAITING_MESSAGE); | 67 DCHECK_EQ(underlying_->state(), WAITING_MESSAGE); |
| 68 underlying_->ProcessMessage(message, resume_callback); | 68 underlying_->ProcessMessage(message, resume_callback); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 scoped_ptr<buzz::XmlElement> ThirdPartyAuthenticatorBase::GetNextMessage() { | 72 scoped_ptr<buzz::XmlElement> ThirdPartyAuthenticatorBase::GetNextMessage() { |
| 73 DCHECK_EQ(state(), MESSAGE_READY); | 73 DCHECK_EQ(state(), MESSAGE_READY); |
| 74 | 74 |
| 75 scoped_ptr<buzz::XmlElement> message; | 75 scoped_ptr<buzz::XmlElement> message; |
| 76 if (underlying_ && underlying_->state() == MESSAGE_READY) { | 76 if (underlying_ && underlying_->state() == MESSAGE_READY) { |
| 77 message = underlying_->GetNextMessage().Pass(); | 77 message = underlying_->GetNextMessage(); |
| 78 } else { | 78 } else { |
| 79 message = CreateEmptyAuthenticatorMessage(); | 79 message = CreateEmptyAuthenticatorMessage(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 if (token_state_ == MESSAGE_READY) { | 82 if (token_state_ == MESSAGE_READY) { |
| 83 AddTokenElements(message.get()); | 83 AddTokenElements(message.get()); |
| 84 started_ = true; | 84 started_ = true; |
| 85 } | 85 } |
| 86 return message.Pass(); | 86 return message; |
| 87 } | 87 } |
| 88 | 88 |
| 89 const std::string& ThirdPartyAuthenticatorBase::GetAuthKey() const { | 89 const std::string& ThirdPartyAuthenticatorBase::GetAuthKey() const { |
| 90 DCHECK_EQ(state(), ACCEPTED); | 90 DCHECK_EQ(state(), ACCEPTED); |
| 91 | 91 |
| 92 return underlying_->GetAuthKey(); | 92 return underlying_->GetAuthKey(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 scoped_ptr<ChannelAuthenticator> | 95 scoped_ptr<ChannelAuthenticator> |
| 96 ThirdPartyAuthenticatorBase::CreateChannelAuthenticator() const { | 96 ThirdPartyAuthenticatorBase::CreateChannelAuthenticator() const { |
| 97 DCHECK_EQ(state(), ACCEPTED); | 97 DCHECK_EQ(state(), ACCEPTED); |
| 98 | 98 |
| 99 return underlying_->CreateChannelAuthenticator(); | 99 return underlying_->CreateChannelAuthenticator(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace protocol | 102 } // namespace protocol |
| 103 } // namespace remoting | 103 } // namespace remoting |
| OLD | NEW |