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

Side by Side Diff: blimp/net/engine_authentication_handler.h

Issue 2281783002: Changes client_token to be client_auth_token. (Closed)
Patch Set: Created 4 years, 3 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 2015 The Chromium Authors. All rights reserved. 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 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 BLIMP_NET_ENGINE_AUTHENTICATION_HANDLER_H_ 5 #ifndef BLIMP_NET_ENGINE_AUTHENTICATION_HANDLER_H_
6 #define BLIMP_NET_ENGINE_AUTHENTICATION_HANDLER_H_ 6 #define BLIMP_NET_ENGINE_AUTHENTICATION_HANDLER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "blimp/net/blimp_net_export.h" 12 #include "blimp/net/blimp_net_export.h"
13 #include "blimp/net/connection_handler.h" 13 #include "blimp/net/connection_handler.h"
14 14
15 namespace blimp { 15 namespace blimp {
16 16
17 class BlimpConnection; 17 class BlimpConnection;
18 class BlimpMessage; 18 class BlimpMessage;
19 19
20 // Authenticates connections and passes successfully authenticated connections 20 // Authenticates connections and passes successfully authenticated connections
21 // to |connection_handler|. 21 // to |connection_handler|.
22 class BLIMP_NET_EXPORT EngineAuthenticationHandler : public ConnectionHandler { 22 class BLIMP_NET_EXPORT EngineAuthenticationHandler : public ConnectionHandler {
23 public: 23 public:
24 // |client_token|: used to authenticate incoming connection. 24 // |client_auth_token|: used to authenticate incoming connection.
25 // |connection_handler|: a new connection is passed on to it after the 25 // |connection_handler|: a new connection is passed on to it after the
26 // connection is authenticate this handler. 26 // connection is authenticate this handler.
27 EngineAuthenticationHandler(ConnectionHandler* connection_handler, 27 EngineAuthenticationHandler(ConnectionHandler* connection_handler,
28 const std::string& client_token); 28 const std::string& client_auth_token);
29 29
30 ~EngineAuthenticationHandler() override; 30 ~EngineAuthenticationHandler() override;
31 31
32 // ConnectionHandler implementation. 32 // ConnectionHandler implementation.
33 void HandleConnection(std::unique_ptr<BlimpConnection> connection) override; 33 void HandleConnection(std::unique_ptr<BlimpConnection> connection) override;
34 34
35 private: 35 private:
36 // Used to abandon pending authenticated connections if |this| is deleted. 36 // Used to abandon pending authenticated connections if |this| is deleted.
37 base::WeakPtrFactory<ConnectionHandler> connection_handler_weak_factory_; 37 base::WeakPtrFactory<ConnectionHandler> connection_handler_weak_factory_;
38 38
39 // Used to authenticate incoming connection. Engine is assigned to one client 39 // Used to authenticate incoming connection. Engine is assigned to one client
40 // only, and all connections from that client shall carry the same token. 40 // only, and all connections from that client shall carry the same token.
41 const std::string client_token_; 41 const std::string client_auth_token_;
42 42
43 DISALLOW_COPY_AND_ASSIGN(EngineAuthenticationHandler); 43 DISALLOW_COPY_AND_ASSIGN(EngineAuthenticationHandler);
44 }; 44 };
45 45
46 } // namespace blimp 46 } // namespace blimp
47 47
48 #endif // BLIMP_NET_ENGINE_AUTHENTICATION_HANDLER_H_ 48 #endif // BLIMP_NET_ENGINE_AUTHENTICATION_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698