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

Unified Diff: net/quic/quic_client_session.cc

Issue 12545035: Refactor QuicClientSession so that it owns the underlying socket (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test leak Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_client_session.h ('k') | net/quic/quic_connection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_client_session.cc
diff --git a/net/quic/quic_client_session.cc b/net/quic/quic_client_session.cc
index d562080e796f6ddce002809d22836051c49c413a..8a3b0eb2e9f9df203e5ecded9e26c17df51de840 100644
--- a/net/quic/quic_client_session.cc
+++ b/net/quic/quic_client_session.cc
@@ -17,15 +17,15 @@
namespace net {
QuicClientSession::QuicClientSession(QuicConnection* connection,
- QuicConnectionHelper* helper,
+ DatagramClientSocket* socket,
QuicStreamFactory* stream_factory,
const string& server_hostname,
NetLog* net_log)
: QuicSession(connection, false),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(crypto_stream_(this, server_hostname)),
- helper_(helper),
stream_factory_(stream_factory),
+ socket_(socket),
read_buffer_(new IOBufferWithSize(kMaxPacketSize)),
read_pending_(false),
num_total_streams_(0),
@@ -109,7 +109,7 @@ void QuicClientSession::StartReading() {
return;
}
read_pending_ = true;
- int rv = helper_->Read(read_buffer_, read_buffer_->size(),
+ int rv = socket_->Read(read_buffer_, read_buffer_->size(),
base::Bind(&QuicClientSession::OnReadComplete,
weak_factory_.GetWeakPtr()));
if (rv == ERR_IO_PENDING) {
@@ -158,8 +158,8 @@ void QuicClientSession::OnReadComplete(int result) {
QuicEncryptedPacket packet(buffer->data(), result);
IPEndPoint local_address;
IPEndPoint peer_address;
- helper_->GetLocalAddress(&local_address);
- helper_->GetPeerAddress(&peer_address);
+ socket_->GetLocalAddress(&local_address);
+ socket_->GetPeerAddress(&peer_address);
// ProcessUdpPacket might result in |this| being deleted, so we
// use a weak pointer to be safe.
connection()->ProcessUdpPacket(local_address, peer_address, packet);
« no previous file with comments | « net/quic/quic_client_session.h ('k') | net/quic/quic_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698