| 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" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // Sets the processor which will take incoming messages for this connection. | 38 // Sets the processor which will take incoming messages for this connection. |
| 39 // Can be set multiple times, but previously set processors are discarded. | 39 // Can be set multiple times, but previously set processors are discarded. |
| 40 // Caller retains the ownership of |processor|. | 40 // Caller retains the ownership of |processor|. |
| 41 virtual void SetIncomingMessageProcessor(BlimpMessageProcessor* processor); | 41 virtual void SetIncomingMessageProcessor(BlimpMessageProcessor* processor); |
| 42 | 42 |
| 43 // Gets a processor for BrowserSession->BlimpConnection message routing. | 43 // Gets a processor for BrowserSession->BlimpConnection message routing. |
| 44 virtual BlimpMessageProcessor* GetOutgoingMessageProcessor(); | 44 virtual BlimpMessageProcessor* GetOutgoingMessageProcessor(); |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 class EndConnectionFilter; |
| 48 friend class EndConnectionFilter; |
| 49 |
| 47 BlimpConnection(); | 50 BlimpConnection(); |
| 48 | 51 |
| 49 // ConnectionErrorObserver implementation. | 52 // ConnectionErrorObserver implementation. |
| 50 void OnConnectionError(int error) override; | 53 void OnConnectionError(int error) override; |
| 51 | 54 |
| 52 private: | 55 private: |
| 53 std::unique_ptr<PacketReader> reader_; | 56 std::unique_ptr<PacketReader> reader_; |
| 54 std::unique_ptr<BlimpMessagePump> message_pump_; | 57 std::unique_ptr<BlimpMessagePump> message_pump_; |
| 55 std::unique_ptr<PacketWriter> writer_; | 58 std::unique_ptr<PacketWriter> writer_; |
| 56 std::unique_ptr<BlimpMessageSender> outgoing_msg_processor_; | 59 std::unique_ptr<BlimpMessageSender> outgoing_msg_processor_; |
| 57 base::ObserverList<ConnectionErrorObserver> error_observers_; | 60 base::ObserverList<ConnectionErrorObserver> error_observers_; |
| 61 std::unique_ptr<EndConnectionFilter> end_connection_filter_; |
| 58 | 62 |
| 59 DISALLOW_COPY_AND_ASSIGN(BlimpConnection); | 63 DISALLOW_COPY_AND_ASSIGN(BlimpConnection); |
| 60 }; | 64 }; |
| 61 | 65 |
| 62 } // namespace blimp | 66 } // namespace blimp |
| 63 | 67 |
| 64 #endif // BLIMP_NET_BLIMP_CONNECTION_H_ | 68 #endif // BLIMP_NET_BLIMP_CONNECTION_H_ |
| OLD | NEW |