| 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 #ifndef BLIMP_NET_ENGINE_CONNECTION_MANAGER_H_ |
| 6 #define BLIMP_NET_ENGINE_CONNECTION_MANAGER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "blimp/net/blimp_connection.h" |
| 10 #include "blimp/net/connection_handler.h" |
| 11 |
| 12 namespace blimp { |
| 13 |
| 14 // Coordinates the channel creation and authentication workflows for |
| 15 // incoming (Engine) network connections. |
| 16 // |
| 17 // TODO(kmarshall): Add rate limiting and abuse handling logic. |
| 18 class EngineConnectionManager : public ConnectionHandler, |
| 19 public BlimpConnection::DisconnectObserver { |
| 20 public: |
| 21 // Caller is responsible for ensuring that |connection_handler| outlives |
| 22 // |this|. |
| 23 explicit EngineConnectionManager(ConnectionHandler* connection_handler); |
| 24 |
| 25 ~EngineConnectionManager() override; |
| 26 |
| 27 // Accepts new BlimpConnections from |transport_| as fast as they arrive. |
| 28 void StartListening(); |
| 29 |
| 30 // ConnectionHandler implementation. |
| 31 // Handles a new connection, authenticates it, and passes it on to the |
| 32 // underlying ConnectionHandler. |
| 33 void HandleConnection(scoped_ptr<BlimpConnection> connection) override; |
| 34 |
| 35 private: |
| 36 DISALLOW_COPY_AND_ASSIGN(EngineConnectionManager); |
| 37 }; |
| 38 |
| 39 } // namespace blimp |
| 40 |
| 41 #endif // BLIMP_NET_ENGINE_CONNECTION_MANAGER_H_ |
| OLD | NEW |