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