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_BLIMP_CONNECTION_H_ | 5 #ifndef BLIMP_NET_BLIMP_CONNECTION_H_ |
6 #define BLIMP_NET_BLIMP_CONNECTION_H_ | 6 #define BLIMP_NET_BLIMP_CONNECTION_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
12 #include "blimp/net/blimp_net_export.h" | 12 #include "blimp/net/blimp_net_export.h" |
13 #include "blimp/net/connection_error_observer.h" | 13 #include "blimp/net/connection_error_observer.h" |
14 | 14 |
15 namespace blimp { | 15 namespace blimp { |
16 | 16 |
17 class BlimpMessageProcessor; | 17 class BlimpMessageProcessor; |
18 class BlimpMessagePump; | 18 class BlimpMessagePump; |
| 19 class BlimpMessageSender; |
19 class PacketReader; | 20 class PacketReader; |
20 class PacketWriter; | 21 class PacketWriter; |
21 | 22 |
22 // Encapsulates the state and logic used to exchange BlimpMessages over | 23 // Encapsulates the state and logic used to exchange BlimpMessages over |
23 // a network connection. | 24 // a network connection. |
24 class BLIMP_NET_EXPORT BlimpConnection : public ConnectionErrorObserver { | 25 class BLIMP_NET_EXPORT BlimpConnection : public ConnectionErrorObserver { |
25 public: | 26 public: |
26 BlimpConnection(std::unique_ptr<PacketReader> reader, | 27 BlimpConnection(std::unique_ptr<PacketReader> reader, |
27 std::unique_ptr<PacketWriter> writer); | 28 std::unique_ptr<PacketWriter> writer); |
28 | 29 |
(...skipping 16 matching lines...) Expand all Loading... |
45 protected: | 46 protected: |
46 BlimpConnection(); | 47 BlimpConnection(); |
47 | 48 |
48 // ConnectionErrorObserver implementation. | 49 // ConnectionErrorObserver implementation. |
49 void OnConnectionError(int error) override; | 50 void OnConnectionError(int error) override; |
50 | 51 |
51 private: | 52 private: |
52 std::unique_ptr<PacketReader> reader_; | 53 std::unique_ptr<PacketReader> reader_; |
53 std::unique_ptr<BlimpMessagePump> message_pump_; | 54 std::unique_ptr<BlimpMessagePump> message_pump_; |
54 std::unique_ptr<PacketWriter> writer_; | 55 std::unique_ptr<PacketWriter> writer_; |
55 std::unique_ptr<BlimpMessageProcessor> outgoing_msg_processor_; | 56 std::unique_ptr<BlimpMessageSender> outgoing_msg_processor_; |
56 base::ObserverList<ConnectionErrorObserver> error_observers_; | 57 base::ObserverList<ConnectionErrorObserver> error_observers_; |
57 | 58 |
58 DISALLOW_COPY_AND_ASSIGN(BlimpConnection); | 59 DISALLOW_COPY_AND_ASSIGN(BlimpConnection); |
59 }; | 60 }; |
60 | 61 |
61 } // namespace blimp | 62 } // namespace blimp |
62 | 63 |
63 #endif // BLIMP_NET_BLIMP_CONNECTION_H_ | 64 #endif // BLIMP_NET_BLIMP_CONNECTION_H_ |
OLD | NEW |