Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: blimp/net/message_port.h

Issue 2236093002: Decouple Blimp transport output from BlimpConnections using MessagePort. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@statistics-singleton
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698