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

Side by Side Diff: net/tools/quic/quic_simple_per_connection_packet_writer.cc

Issue 1036023002: Move remaining QUIC server files from net/quic/ to net/tools/quic/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: correctly fix cronet Created 5 years, 9 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "net/quic/quic_per_connection_packet_writer.h" 5 #include "net/tools/quic/quic_simple_per_connection_packet_writer.h"
6 6
7 #include "net/quic/quic_server_packet_writer.h" 7 #include "net/tools/quic/quic_simple_server_packet_writer.h"
8 8
9 namespace net { 9 namespace net {
10 namespace tools {
10 11
11 QuicPerConnectionPacketWriter::QuicPerConnectionPacketWriter( 12 QuicSimplePerConnectionPacketWriter::QuicSimplePerConnectionPacketWriter(
12 QuicServerPacketWriter* shared_writer, 13 QuicSimpleServerPacketWriter* shared_writer,
13 QuicConnection* connection) 14 QuicConnection* connection)
14 : shared_writer_(shared_writer), 15 : shared_writer_(shared_writer),
15 connection_(connection), 16 connection_(connection),
16 weak_factory_(this){ 17 weak_factory_(this){
17 } 18 }
18 19
19 QuicPerConnectionPacketWriter::~QuicPerConnectionPacketWriter() { 20 QuicSimplePerConnectionPacketWriter::~QuicSimplePerConnectionPacketWriter() {
20 } 21 }
21 22
22 QuicPacketWriter* QuicPerConnectionPacketWriter::shared_writer() const { 23 QuicPacketWriter* QuicSimplePerConnectionPacketWriter::shared_writer() const {
23 return shared_writer_; 24 return shared_writer_;
24 } 25 }
25 26
26 WriteResult QuicPerConnectionPacketWriter::WritePacket( 27 WriteResult QuicSimplePerConnectionPacketWriter::WritePacket(
27 const char* buffer, 28 const char* buffer,
28 size_t buf_len, 29 size_t buf_len,
29 const IPAddressNumber& self_address, 30 const IPAddressNumber& self_address,
30 const IPEndPoint& peer_address) { 31 const IPEndPoint& peer_address) {
31 return shared_writer_->WritePacketWithCallback( 32 return shared_writer_->WritePacketWithCallback(
32 buffer, 33 buffer,
33 buf_len, 34 buf_len,
34 self_address, 35 self_address,
35 peer_address, 36 peer_address,
36 base::Bind(&QuicPerConnectionPacketWriter::OnWriteComplete, 37 base::Bind(&QuicSimplePerConnectionPacketWriter::OnWriteComplete,
37 weak_factory_.GetWeakPtr())); 38 weak_factory_.GetWeakPtr()));
38 } 39 }
39 40
40 bool QuicPerConnectionPacketWriter::IsWriteBlockedDataBuffered() const { 41 bool QuicSimplePerConnectionPacketWriter::IsWriteBlockedDataBuffered() const {
41 return shared_writer_->IsWriteBlockedDataBuffered(); 42 return shared_writer_->IsWriteBlockedDataBuffered();
42 } 43 }
43 44
44 bool QuicPerConnectionPacketWriter::IsWriteBlocked() const { 45 bool QuicSimplePerConnectionPacketWriter::IsWriteBlocked() const {
45 return shared_writer_->IsWriteBlocked(); 46 return shared_writer_->IsWriteBlocked();
46 } 47 }
47 48
48 void QuicPerConnectionPacketWriter::SetWritable() { 49 void QuicSimplePerConnectionPacketWriter::SetWritable() {
49 shared_writer_->SetWritable(); 50 shared_writer_->SetWritable();
50 } 51 }
51 52
52 void QuicPerConnectionPacketWriter::OnWriteComplete(WriteResult result) { 53 void QuicSimplePerConnectionPacketWriter::OnWriteComplete(WriteResult result) {
53 if (result.status == WRITE_STATUS_ERROR) { 54 if (result.status == WRITE_STATUS_ERROR) {
54 connection_->OnWriteError(result.error_code); 55 connection_->OnWriteError(result.error_code);
55 } 56 }
56 } 57 }
57 58
59 } // namespace tools
58 } // namespace net 60 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_simple_per_connection_packet_writer.h ('k') | net/tools/quic/quic_simple_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698