OLD | NEW |
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_BROWSER_CONNECTION_HANDLER_H_ | 5 #ifndef BLIMP_NET_BROWSER_CONNECTION_HANDLER_H_ |
6 #define BLIMP_NET_BROWSER_CONNECTION_HANDLER_H_ | 6 #define BLIMP_NET_BROWSER_CONNECTION_HANDLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 virtual std::unique_ptr<BlimpMessageProcessor> RegisterFeature( | 45 virtual std::unique_ptr<BlimpMessageProcessor> RegisterFeature( |
46 BlimpMessage::FeatureCase feature_case, | 46 BlimpMessage::FeatureCase feature_case, |
47 BlimpMessageProcessor* incoming_processor); | 47 BlimpMessageProcessor* incoming_processor); |
48 | 48 |
49 // ConnectionHandler implementation. | 49 // ConnectionHandler implementation. |
50 void HandleConnection(std::unique_ptr<BlimpConnection> connection) override; | 50 void HandleConnection(std::unique_ptr<BlimpConnection> connection) override; |
51 | 51 |
52 // ConnectionErrorObserver implementation. | 52 // ConnectionErrorObserver implementation. |
53 void OnConnectionError(int error) override; | 53 void OnConnectionError(int error) override; |
54 | 54 |
55 private: | |
56 void DropCurrentConnection(); | 55 void DropCurrentConnection(); |
57 | 56 |
| 57 private: |
58 // Routes incoming messages to the relevant feature-specific handlers. | 58 // Routes incoming messages to the relevant feature-specific handlers. |
59 std::unique_ptr<BlimpMessageDemultiplexer> demultiplexer_; | 59 std::unique_ptr<BlimpMessageDemultiplexer> demultiplexer_; |
60 | 60 |
61 // Provides buffering of outgoing messages, for use in session-recovery. | 61 // Provides buffering of outgoing messages, for use in session-recovery. |
62 std::unique_ptr<BlimpMessageOutputBuffer> output_buffer_; | 62 std::unique_ptr<BlimpMessageOutputBuffer> output_buffer_; |
63 | 63 |
64 // Routes outgoing messages from feature-specific handlers to a single | 64 // Routes outgoing messages from feature-specific handlers to a single |
65 // message stream. | 65 // message stream. |
66 std::unique_ptr<BlimpMessageMultiplexer> multiplexer_; | 66 std::unique_ptr<BlimpMessageMultiplexer> multiplexer_; |
67 | 67 |
68 // Dispatches checkpoint/ACK messages to the outgoing processor, as the | 68 // Dispatches checkpoint/ACK messages to the outgoing processor, as the |
69 // incoming processor completes processing them. | 69 // incoming processor completes processing them. |
70 std::unique_ptr<BlimpMessageCheckpointer> checkpointer_; | 70 std::unique_ptr<BlimpMessageCheckpointer> checkpointer_; |
71 | 71 |
72 // Holds network resources while there is a Client connected. | 72 // Holds network resources while there is a Client connected. |
73 std::unique_ptr<BlimpConnection> connection_; | 73 std::unique_ptr<BlimpConnection> connection_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(BrowserConnectionHandler); | 75 DISALLOW_COPY_AND_ASSIGN(BrowserConnectionHandler); |
76 }; | 76 }; |
77 | 77 |
78 } // namespace blimp | 78 } // namespace blimp |
79 | 79 |
80 #endif // BLIMP_NET_BROWSER_CONNECTION_HANDLER_H_ | 80 #endif // BLIMP_NET_BROWSER_CONNECTION_HANDLER_H_ |
OLD | NEW |