Chromium Code Reviews| Index: remoting/protocol/rejecting_authenticator.h |
| diff --git a/remoting/protocol/rejecting_authenticator.h b/remoting/protocol/rejecting_authenticator.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c40e86f4c5e4ad5654da15027dc228ce9a9644e8 |
| --- /dev/null |
| +++ b/remoting/protocol/rejecting_authenticator.h |
| @@ -0,0 +1,42 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
|
Sergey Ulanov
2016/01/29 21:12:13
2016
Jamie
2016/01/29 23:29:09
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef REMOTING_PROTOCOL_REJECTING_AUTHENTICATOR_FACTORY_H_ |
| +#define REMOTING_PROTOCOL_REJECTING_AUTHENTICATOR_FACTORY_H_ |
| + |
| +#include "remoting/protocol/authenticator.h" |
| + |
| +#include <string> |
|
Sergey Ulanov
2016/01/29 21:12:13
nit: move this above authenticator.h
Jamie
2016/01/29 23:29:09
Done.
|
| + |
| +namespace remoting { |
| +namespace protocol { |
| + |
| +// Authenticator that accepts one message and rejects connection after that. |
| +class RejectingAuthenticator : public Authenticator { |
| + public: |
| + RejectingAuthenticator(RejectionReason rejection_reason); |
| + ~RejectingAuthenticator() override; |
| + |
| + // Authenticator interface |
| + State state() const override; |
| + bool started() const override; |
| + RejectionReason rejection_reason() const override; |
| + void ProcessMessage(const buzz::XmlElement* message, |
| + const base::Closure& resume_callback) override; |
| + scoped_ptr<buzz::XmlElement> GetNextMessage() override; |
| + const std::string& GetAuthKey() const override; |
| + scoped_ptr<ChannelAuthenticator> CreateChannelAuthenticator() const override; |
| + |
| + private: |
| + RejectionReason rejection_reason_; |
| + State state_ = WAITING_MESSAGE; |
| + std::string auth_key_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(RejectingAuthenticator); |
| +}; |
| + |
| +} // namespace protocol |
| +} // namespace remoting |
| + |
| +#endif |
|
Sergey Ulanov
2016/01/29 21:12:13
// REMOTING_PROTOCOL_REJECTING_AUTHENTICATOR_FACTO
Jamie
2016/01/29 23:29:09
Done.
|