Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(607)

Side by Side Diff: remoting/protocol/third_party_authenticator_base.h

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef REMOTING_PROTOCOL_THIRD_PARTY_AUTHENTICATOR_BASE_H_ 5 #ifndef REMOTING_PROTOCOL_THIRD_PARTY_AUTHENTICATOR_BASE_H_
6 #define REMOTING_PROTOCOL_THIRD_PARTY_AUTHENTICATOR_BASE_H_ 6 #define REMOTING_PROTOCOL_THIRD_PARTY_AUTHENTICATOR_BASE_H_
7 7
8 #include <memory>
8 #include <string> 9 #include <string>
9 10
10 #include "base/callback.h" 11 #include "base/callback.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "remoting/protocol/authenticator.h" 13 #include "remoting/protocol/authenticator.h"
14 #include "third_party/webrtc/libjingle/xmllite/qname.h" 14 #include "third_party/webrtc/libjingle/xmllite/qname.h"
15 15
16 namespace buzz { 16 namespace buzz {
17 17
18 class XmlElement; 18 class XmlElement;
19 19
20 } // namespace buzz 20 } // namespace buzz
21 21
22 namespace remoting { 22 namespace remoting {
(...skipping 11 matching lines...) Expand all
34 class ThirdPartyAuthenticatorBase : public Authenticator { 34 class ThirdPartyAuthenticatorBase : public Authenticator {
35 public: 35 public:
36 ~ThirdPartyAuthenticatorBase() override; 36 ~ThirdPartyAuthenticatorBase() override;
37 37
38 // Authenticator interface. 38 // Authenticator interface.
39 State state() const override; 39 State state() const override;
40 bool started() const override; 40 bool started() const override;
41 RejectionReason rejection_reason() const override; 41 RejectionReason rejection_reason() const override;
42 void ProcessMessage(const buzz::XmlElement* message, 42 void ProcessMessage(const buzz::XmlElement* message,
43 const base::Closure& resume_callback) override; 43 const base::Closure& resume_callback) override;
44 scoped_ptr<buzz::XmlElement> GetNextMessage() override; 44 std::unique_ptr<buzz::XmlElement> GetNextMessage() override;
45 const std::string& GetAuthKey() const override; 45 const std::string& GetAuthKey() const override;
46 scoped_ptr<ChannelAuthenticator> CreateChannelAuthenticator() const override; 46 std::unique_ptr<ChannelAuthenticator> CreateChannelAuthenticator()
47 const override;
47 48
48 protected: 49 protected:
49 // XML tag names for third party authentication fields. 50 // XML tag names for third party authentication fields.
50 static const buzz::StaticQName kTokenUrlTag; 51 static const buzz::StaticQName kTokenUrlTag;
51 static const buzz::StaticQName kTokenScopeTag; 52 static const buzz::StaticQName kTokenScopeTag;
52 static const buzz::StaticQName kTokenTag; 53 static const buzz::StaticQName kTokenTag;
53 54
54 explicit ThirdPartyAuthenticatorBase(State initial_state); 55 explicit ThirdPartyAuthenticatorBase(State initial_state);
55 56
56 // Gives the message to the underlying authenticator for processing. 57 // Gives the message to the underlying authenticator for processing.
57 void ProcessUnderlyingMessage( 58 void ProcessUnderlyingMessage(
58 const buzz::XmlElement* message, 59 const buzz::XmlElement* message,
59 const base::Closure& resume_callback); 60 const base::Closure& resume_callback);
60 61
61 // Processes the token-related elements of the message. 62 // Processes the token-related elements of the message.
62 virtual void ProcessTokenMessage( 63 virtual void ProcessTokenMessage(
63 const buzz::XmlElement* message, 64 const buzz::XmlElement* message,
64 const base::Closure& resume_callback) = 0; 65 const base::Closure& resume_callback) = 0;
65 66
66 // Adds the token related XML elements to the message. 67 // Adds the token related XML elements to the message.
67 virtual void AddTokenElements(buzz::XmlElement* message) = 0; 68 virtual void AddTokenElements(buzz::XmlElement* message) = 0;
68 69
69 scoped_ptr<Authenticator> underlying_; 70 std::unique_ptr<Authenticator> underlying_;
70 State token_state_; 71 State token_state_;
71 bool started_; 72 bool started_;
72 RejectionReason rejection_reason_; 73 RejectionReason rejection_reason_;
73 74
74 private: 75 private:
75 DISALLOW_COPY_AND_ASSIGN(ThirdPartyAuthenticatorBase); 76 DISALLOW_COPY_AND_ASSIGN(ThirdPartyAuthenticatorBase);
76 }; 77 };
77 78
78 } // namespace protocol 79 } // namespace protocol
79 } // namespace remoting 80 } // namespace remoting
80 81
81 #endif // REMOTING_PROTOCOL_THIRD_PARTY_AUTHENTICATOR_BASE_H_ 82 #endif // REMOTING_PROTOCOL_THIRD_PARTY_AUTHENTICATOR_BASE_H_
OLDNEW
« no previous file with comments | « remoting/protocol/stream_message_pipe_adapter.cc ('k') | remoting/protocol/third_party_authenticator_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698