OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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_MESSAGE_PORT_H_ |
| 6 #define BLIMP_NET_MESSAGE_PORT_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/supports_user_data.h" |
| 12 #include "blimp/net/blimp_net_export.h" |
| 13 |
| 14 namespace blimp { |
| 15 |
| 16 class PacketReader; |
| 17 class PacketWriter; |
| 18 |
| 19 // A duplexed pair of a framed reader and writer. |
| 20 class BLIMP_NET_EXPORT MessagePort : public base::SupportsUserData { |
| 21 public: |
| 22 MessagePort(std::unique_ptr<PacketReader> reader, |
| 23 std::unique_ptr<PacketWriter> writer); |
| 24 ~MessagePort() override; |
| 25 |
| 26 PacketReader* reader() const { return reader_.get(); } |
| 27 PacketWriter* writer() const { return writer_.get(); } |
| 28 |
| 29 private: |
| 30 std::unique_ptr<PacketReader> reader_; |
| 31 std::unique_ptr<PacketWriter> writer_; |
| 32 |
| 33 DISALLOW_COPY_AND_ASSIGN(MessagePort); |
| 34 }; |
| 35 |
| 36 } // namespace blimp |
| 37 |
| 38 #endif // BLIMP_NET_MESSAGE_PORT_H_ |
OLD | NEW |