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

Side by Side Diff: net/quic/quic_client_session.cc

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « net/proxy/proxy_service.cc ('k') | net/quic/quic_connection_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_client_session.h" 5 #include "net/quic/quic_client_session.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 base::ResetAndReturn(&callback_).Run(ERR_QUIC_PROTOCOL_ERROR); 125 base::ResetAndReturn(&callback_).Run(ERR_QUIC_PROTOCOL_ERROR);
126 } 126 }
127 QuicSession::ConnectionClose(error, from_peer); 127 QuicSession::ConnectionClose(error, from_peer);
128 } 128 }
129 129
130 void QuicClientSession::StartReading() { 130 void QuicClientSession::StartReading() {
131 if (read_pending_) { 131 if (read_pending_) {
132 return; 132 return;
133 } 133 }
134 read_pending_ = true; 134 read_pending_ = true;
135 int rv = socket_->Read(read_buffer_, read_buffer_->size(), 135 int rv = socket_->Read(read_buffer_.get(),
136 read_buffer_->size(),
136 base::Bind(&QuicClientSession::OnReadComplete, 137 base::Bind(&QuicClientSession::OnReadComplete,
137 weak_factory_.GetWeakPtr())); 138 weak_factory_.GetWeakPtr()));
138 if (rv == ERR_IO_PENDING) { 139 if (rv == ERR_IO_PENDING) {
139 return; 140 return;
140 } 141 }
141 142
142 // Data was read, process it. 143 // Data was read, process it.
143 // Schedule the work through the message loop to avoid recursive 144 // Schedule the work through the message loop to avoid recursive
144 // callbacks. 145 // callbacks.
145 base::MessageLoop::current()->PostTask( 146 base::MessageLoop::current()->PostTask(
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // use a weak pointer to be safe. 198 // use a weak pointer to be safe.
198 connection()->ProcessUdpPacket(local_address, peer_address, packet); 199 connection()->ProcessUdpPacket(local_address, peer_address, packet);
199 if (!connection()->connected()) { 200 if (!connection()->connected()) {
200 stream_factory_->OnSessionClose(this); 201 stream_factory_->OnSessionClose(this);
201 return; 202 return;
202 } 203 }
203 StartReading(); 204 StartReading();
204 } 205 }
205 206
206 } // namespace net 207 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_service.cc ('k') | net/quic/quic_connection_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698