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

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

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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
« no previous file with comments | « net/quic/quic_flow_controller.h ('k') | net/quic/quic_flow_controller_test.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_flow_controller.h" 5 #include "net/quic/quic_flow_controller.h"
6 6
7 #include "base/basictypes.h"
8 #include "net/quic/quic_connection.h" 7 #include "net/quic/quic_connection.h"
9 #include "net/quic/quic_flags.h" 8 #include "net/quic/quic_flags.h"
10 #include "net/quic/quic_protocol.h" 9 #include "net/quic/quic_protocol.h"
11 10
12 namespace net { 11 namespace net {
13 12
14 #define ENDPOINT \ 13 #define ENDPOINT \
15 (perspective_ == Perspective::IS_SERVER ? "Server: " : "Client: ") 14 (perspective_ == Perspective::IS_SERVER ? "Server: " : "Client: ")
16 15
17 QuicFlowController::QuicFlowController(QuicConnection* connection, 16 QuicFlowController::QuicFlowController(QuicConnection* connection,
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 220
222 const bool blocked = IsBlocked(); 221 const bool blocked = IsBlocked();
223 send_window_offset_ = new_send_window_offset; 222 send_window_offset_ = new_send_window_offset;
224 return blocked; 223 return blocked;
225 } 224 }
226 225
227 bool QuicFlowController::IsBlocked() const { 226 bool QuicFlowController::IsBlocked() const {
228 return SendWindowSize() == 0; 227 return SendWindowSize() == 0;
229 } 228 }
230 229
231 uint64 QuicFlowController::SendWindowSize() const { 230 uint64_t QuicFlowController::SendWindowSize() const {
232 if (bytes_sent_ > send_window_offset_) { 231 if (bytes_sent_ > send_window_offset_) {
233 return 0; 232 return 0;
234 } 233 }
235 return send_window_offset_ - bytes_sent_; 234 return send_window_offset_ - bytes_sent_;
236 } 235 }
237 236
238 void QuicFlowController::UpdateReceiveWindowSize(QuicStreamOffset size) { 237 void QuicFlowController::UpdateReceiveWindowSize(QuicStreamOffset size) {
239 DVLOG(1) << ENDPOINT << "UpdateReceiveWindowSize for stream " << id_ << ": " 238 DVLOG(1) << ENDPOINT << "UpdateReceiveWindowSize for stream " << id_ << ": "
240 << size; 239 << size;
241 if (receive_window_size_ != receive_window_offset_) { 240 if (receive_window_size_ != receive_window_offset_) {
242 LOG(DFATAL) << "receive_window_size_:" << receive_window_size_ 241 LOG(DFATAL) << "receive_window_size_:" << receive_window_size_
243 << " != receive_window_offset:" << receive_window_offset_; 242 << " != receive_window_offset:" << receive_window_offset_;
244 return; 243 return;
245 } 244 }
246 receive_window_size_ = size; 245 receive_window_size_ = size;
247 receive_window_offset_ = size; 246 receive_window_offset_ = size;
248 } 247 }
249 248
250 } // namespace net 249 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_flow_controller.h ('k') | net/quic/quic_flow_controller_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698