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

Unified Diff: net/quic/quic_per_connection_packet_writer.cc

Issue 475113005: Refactoring: Create per-connection packet writers in QuicDispatcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add new files to net/BUILD.gn Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_per_connection_packet_writer.h ('k') | net/quic/quic_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_per_connection_packet_writer.cc
diff --git a/net/quic/quic_per_connection_packet_writer.cc b/net/quic/quic_per_connection_packet_writer.cc
index 6347bc201df632e68de7aac05a19a63584179edf..efb4feccd7edc418335e56bba172e6360db80c55 100644
--- a/net/quic/quic_per_connection_packet_writer.cc
+++ b/net/quic/quic_per_connection_packet_writer.cc
@@ -5,24 +5,30 @@
#include "net/quic/quic_per_connection_packet_writer.h"
#include "net/quic/quic_server_packet_writer.h"
-#include "net/quic/quic_types.h"
namespace net {
QuicPerConnectionPacketWriter::QuicPerConnectionPacketWriter(
- QuicServerPacketWriter* writer)
- : weak_factory_(this), writer_(writer) {
+ QuicServerPacketWriter* shared_writer,
+ QuicConnection* connection)
+ : weak_factory_(this),
+ shared_writer_(shared_writer),
+ connection_(connection) {
}
QuicPerConnectionPacketWriter::~QuicPerConnectionPacketWriter() {
}
+QuicPacketWriter* QuicPerConnectionPacketWriter::shared_writer() const {
+ return shared_writer_;
+}
+
WriteResult QuicPerConnectionPacketWriter::WritePacket(
const char* buffer,
size_t buf_len,
const IPAddressNumber& self_address,
const IPEndPoint& peer_address) {
- return writer_->WritePacketWithCallback(
+ return shared_writer_->WritePacketWithCallback(
buffer,
buf_len,
self_address,
@@ -32,15 +38,15 @@ WriteResult QuicPerConnectionPacketWriter::WritePacket(
}
bool QuicPerConnectionPacketWriter::IsWriteBlockedDataBuffered() const {
- return writer_->IsWriteBlockedDataBuffered();
+ return shared_writer_->IsWriteBlockedDataBuffered();
}
bool QuicPerConnectionPacketWriter::IsWriteBlocked() const {
- return writer_->IsWriteBlocked();
+ return shared_writer_->IsWriteBlocked();
}
void QuicPerConnectionPacketWriter::SetWritable() {
- writer_->SetWritable();
+ shared_writer_->SetWritable();
}
void QuicPerConnectionPacketWriter::OnWriteComplete(WriteResult result) {
« no previous file with comments | « net/quic/quic_per_connection_packet_writer.h ('k') | net/quic/quic_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698