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

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

Issue 2632803002: Remove all blimp network code. (Closed)
Patch Set: merge from origin/master for good measure Created 3 years, 11 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
« no previous file with comments | « blimp/net/message_port.h ('k') | blimp/net/null_blimp_message_processor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "blimp/net/message_port.h"
6
7 #include <utility>
8
9 #include "base/memory/ptr_util.h"
10 #include "blimp/net/compressed_packet_reader.h"
11 #include "blimp/net/compressed_packet_writer.h"
12 #include "blimp/net/packet_reader.h"
13 #include "blimp/net/packet_writer.h"
14 #include "blimp/net/stream_packet_reader.h"
15 #include "blimp/net/stream_packet_writer.h"
16 #include "net/socket/stream_socket.h"
17
18 namespace blimp {
19 namespace {
20
21 class CompressedStreamSocketMessagePort : public MessagePort {
22 public:
23 explicit CompressedStreamSocketMessagePort(
24 std::unique_ptr<net::StreamSocket> socket);
25 ~CompressedStreamSocketMessagePort() override {}
26
27 private:
28 std::unique_ptr<net::StreamSocket> socket_;
29
30 DISALLOW_COPY_AND_ASSIGN(CompressedStreamSocketMessagePort);
31 };
32
33 CompressedStreamSocketMessagePort::CompressedStreamSocketMessagePort(
34 std::unique_ptr<net::StreamSocket> socket)
35 : MessagePort(base::MakeUnique<CompressedPacketReader>(
36 base::MakeUnique<StreamPacketReader>(socket.get())),
37 base::MakeUnique<CompressedPacketWriter>(
38 base::MakeUnique<StreamPacketWriter>(socket.get()))),
39 socket_(std::move(socket)) {}
40
41 } // namespace
42
43 // static
44 std::unique_ptr<MessagePort> MessagePort::CreateForStreamSocketWithCompression(
45 std::unique_ptr<net::StreamSocket> socket) {
46 return base::MakeUnique<CompressedStreamSocketMessagePort>(std::move(socket));
47 }
48
49 MessagePort::MessagePort(std::unique_ptr<PacketReader> reader,
50 std::unique_ptr<PacketWriter> writer)
51 : reader_(std::move(reader)), writer_(std::move(writer)) {}
52
53 MessagePort::~MessagePort() {}
54
55 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/net/message_port.h ('k') | blimp/net/null_blimp_message_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698