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

Side by Side Diff: net/quic/quic_connection_helper.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/quic/quic_client_session.cc ('k') | net/quic/quic_http_stream.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_connection_helper.h" 5 #include "net/quic/quic_connection_helper.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/task_runner.h" 9 #include "base/task_runner.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 int* error) { 51 int* error) {
52 if (connection_->ShouldSimulateLostPacket()) { 52 if (connection_->ShouldSimulateLostPacket()) {
53 DLOG(INFO) << "Dropping packet due to fake packet loss."; 53 DLOG(INFO) << "Dropping packet due to fake packet loss.";
54 *error = 0; 54 *error = 0;
55 return packet.length(); 55 return packet.length();
56 } 56 }
57 57
58 scoped_refptr<StringIOBuffer> buf( 58 scoped_refptr<StringIOBuffer> buf(
59 new StringIOBuffer(std::string(packet.data(), 59 new StringIOBuffer(std::string(packet.data(),
60 packet.length()))); 60 packet.length())));
61 int rv = socket_->Write(buf, packet.length(), 61 int rv = socket_->Write(buf.get(),
62 packet.length(),
62 base::Bind(&QuicConnectionHelper::OnWriteComplete, 63 base::Bind(&QuicConnectionHelper::OnWriteComplete,
63 weak_factory_.GetWeakPtr())); 64 weak_factory_.GetWeakPtr()));
64 if (rv >= 0) { 65 if (rv >= 0) {
65 *error = 0; 66 *error = 0;
66 } else { 67 } else {
67 *error = rv; 68 *error = rv;
68 rv = -1; 69 rv = -1;
69 } 70 }
70 return rv; 71 return rv;
71 } 72 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 ack_alarm_time_ = QuicTime::Zero(); 173 ack_alarm_time_ = QuicTime::Zero();
173 connection_->SendAck(); 174 connection_->SendAck();
174 } 175 }
175 176
176 void QuicConnectionHelper::OnWriteComplete(int result) { 177 void QuicConnectionHelper::OnWriteComplete(int result) {
177 // TODO(rch): Inform the connection about the result. 178 // TODO(rch): Inform the connection about the result.
178 connection_->OnCanWrite(); 179 connection_->OnCanWrite();
179 } 180 }
180 181
181 } // namespace net 182 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_client_session.cc ('k') | net/quic/quic_http_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698