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

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

Issue 12545035: Refactor QuicClientSession so that it owns the underlying socket (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 115 }
116 116
117 bool QuicConnectionHelper::IsSendAlarmSet() { 117 bool QuicConnectionHelper::IsSendAlarmSet() {
118 return send_alarm_registered_; 118 return send_alarm_registered_;
119 } 119 }
120 120
121 void QuicConnectionHelper::UnregisterSendAlarmIfRegistered() { 121 void QuicConnectionHelper::UnregisterSendAlarmIfRegistered() {
122 send_alarm_registered_ = false; 122 send_alarm_registered_ = false;
123 } 123 }
124 124
125 int QuicConnectionHelper::Read(IOBuffer* buf, int buf_len,
126 const CompletionCallback& callback) {
127 return socket_->Read(buf, buf_len, callback);
128 }
129
130 void QuicConnectionHelper::GetLocalAddress(IPEndPoint* local_address) {
131 socket_->GetLocalAddress(local_address);
132 }
133
134 void QuicConnectionHelper::GetPeerAddress(IPEndPoint* peer_address) {
135 socket_->GetPeerAddress(peer_address);
136 }
137
138 void QuicConnectionHelper::OnRetransmissionAlarm() { 125 void QuicConnectionHelper::OnRetransmissionAlarm() {
139 QuicTime when = connection_->OnRetransmissionTimeout(); 126 QuicTime when = connection_->OnRetransmissionTimeout();
140 if (!when.IsInitialized()) { 127 if (!when.IsInitialized()) {
141 SetRetransmissionAlarm(clock_->Now().Subtract(when)); 128 SetRetransmissionAlarm(clock_->Now().Subtract(when));
142 } 129 }
143 } 130 }
144 131
145 void QuicConnectionHelper::OnSendAlarm() { 132 void QuicConnectionHelper::OnSendAlarm() {
146 if (send_alarm_registered_) { 133 if (send_alarm_registered_) {
147 send_alarm_registered_ = false; 134 send_alarm_registered_ = false;
(...skipping 22 matching lines...) Expand all
170 ack_alarm_time_ = QuicTime::Zero(); 157 ack_alarm_time_ = QuicTime::Zero();
171 connection_->SendAck(); 158 connection_->SendAck();
172 } 159 }
173 160
174 void QuicConnectionHelper::OnWriteComplete(int result) { 161 void QuicConnectionHelper::OnWriteComplete(int result) {
175 // TODO(rch): Inform the connection about the result. 162 // TODO(rch): Inform the connection about the result.
176 connection_->OnCanWrite(); 163 connection_->OnCanWrite();
177 } 164 }
178 165
179 } // namespace net 166 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698