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

Side by Side Diff: net/quic/core/quic_server_session_base.cc

Issue 2825083003: Landing Recent QUIC changes until Mon Apr 17 2017 (Closed)
Patch Set: Format Created 3 years, 8 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
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/core/quic_server_session_base.h" 5 #include "net/quic/core/quic_server_session_base.h"
6 6
7 #include "net/quic/core/proto/cached_network_parameters.pb.h" 7 #include "net/quic/core/proto/cached_network_parameters.pb.h"
8 #include "net/quic/core/quic_connection.h" 8 #include "net/quic/core/quic_connection.h"
9 #include "net/quic/core/quic_flags.h"
10 #include "net/quic/core/quic_stream.h" 9 #include "net/quic/core/quic_stream.h"
11 #include "net/quic/platform/api/quic_bug_tracker.h" 10 #include "net/quic/platform/api/quic_bug_tracker.h"
11 #include "net/quic/platform/api/quic_flags.h"
12 #include "net/quic/platform/api/quic_logging.h" 12 #include "net/quic/platform/api/quic_logging.h"
13 #include "net/quic/platform/api/quic_string_piece.h" 13 #include "net/quic/platform/api/quic_string_piece.h"
14 14
15 using std::string; 15 using std::string;
16 16
17 namespace net { 17 namespace net {
18 18
19 QuicServerSessionBase::QuicServerSessionBase( 19 QuicServerSessionBase::QuicServerSessionBase(
20 const QuicConfig& config, 20 const QuicConfig& config,
21 QuicConnection* connection, 21 QuicConnection* connection,
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 return false; 220 return false;
221 } 221 }
222 if (GetNumOpenOutgoingStreams() >= max_open_outgoing_streams()) { 222 if (GetNumOpenOutgoingStreams() >= max_open_outgoing_streams()) {
223 VLOG(1) << "No more streams should be created. " 223 VLOG(1) << "No more streams should be created. "
224 << "Already " << GetNumOpenOutgoingStreams() << " open."; 224 << "Already " << GetNumOpenOutgoingStreams() << " open.";
225 return false; 225 return false;
226 } 226 }
227 return true; 227 return true;
228 } 228 }
229 229
230 QuicCryptoServerStreamBase* QuicServerSessionBase::GetCryptoStream() { 230 QuicCryptoServerStreamBase* QuicServerSessionBase::GetMutableCryptoStream() {
231 return crypto_stream_.get(); 231 return crypto_stream_.get();
232 } 232 }
233 233
234 const QuicCryptoServerStreamBase* QuicServerSessionBase::GetCryptoStream()
235 const {
236 return crypto_stream_.get();
237 }
238
234 int32_t QuicServerSessionBase::BandwidthToCachedParameterBytesPerSecond( 239 int32_t QuicServerSessionBase::BandwidthToCachedParameterBytesPerSecond(
235 const QuicBandwidth& bandwidth) { 240 const QuicBandwidth& bandwidth) {
236 int64_t bytes_per_second = bandwidth.ToBytesPerSecond(); 241 int64_t bytes_per_second = bandwidth.ToBytesPerSecond();
237 return (bytes_per_second > static_cast<int64_t>(INT32_MAX) 242 return (bytes_per_second > static_cast<int64_t>(INT32_MAX)
238 ? INT32_MAX 243 ? INT32_MAX
239 : static_cast<int32_t>(bytes_per_second)); 244 : static_cast<int32_t>(bytes_per_second));
240 } 245 }
241 246
242 } // namespace net 247 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_server_session_base.h ('k') | net/quic/core/quic_server_session_base_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698