OLD | NEW |
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_session.h" | 5 #include "net/quic/core/quic_session.h" |
6 | 6 |
7 #include <cstdint> | 7 #include <cstdint> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "net/quic/core/quic_connection.h" | 10 #include "net/quic/core/quic_connection.h" |
11 #include "net/quic/core/quic_flags.h" | 11 #include "net/quic/core/quic_flags.h" |
12 #include "net/quic/core/quic_flow_controller.h" | 12 #include "net/quic/core/quic_flow_controller.h" |
13 #include "net/quic/platform/api/quic_bug_tracker.h" | 13 #include "net/quic/platform/api/quic_bug_tracker.h" |
14 #include "net/quic/platform/api/quic_logging.h" | 14 #include "net/quic/platform/api/quic_logging.h" |
15 #include "net/quic/platform/api/quic_map_util.h" | 15 #include "net/quic/platform/api/quic_map_util.h" |
16 #include "net/quic/platform/api/quic_str_cat.h" | 16 #include "net/quic/platform/api/quic_str_cat.h" |
17 | 17 |
18 using base::StringPiece; | 18 using base::StringPiece; |
19 using std::string; | 19 using std::string; |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 | 22 |
23 #define ENDPOINT \ | 23 #define ENDPOINT \ |
24 (perspective() == Perspective::IS_SERVER ? "Server: " : "Client: ") | 24 (perspective() == Perspective::IS_SERVER ? "Server: " : "Client: ") |
25 | 25 |
26 QuicSession::QuicSession(QuicConnection* connection, | 26 QuicSession::QuicSession(QuicConnection* connection, |
27 Visitor* owner, | 27 Visitor* owner, |
28 const QuicConfig& config) | 28 const QuicConfig& config) |
29 : connection_(connection), | 29 : visitor_(owner), |
30 visitor_(owner), | 30 connection_(connection), |
31 config_(config), | 31 config_(config), |
32 max_open_outgoing_streams_(kDefaultMaxStreamsPerConnection), | 32 max_open_outgoing_streams_(kDefaultMaxStreamsPerConnection), |
33 max_open_incoming_streams_(config_.GetMaxIncomingDynamicStreamsToSend()), | 33 max_open_incoming_streams_(config_.GetMaxIncomingDynamicStreamsToSend()), |
34 next_outgoing_stream_id_(perspective() == Perspective::IS_SERVER ? 2 : 3), | 34 next_outgoing_stream_id_(perspective() == Perspective::IS_SERVER ? 2 : 3), |
35 largest_peer_created_stream_id_( | 35 largest_peer_created_stream_id_( |
36 perspective() == Perspective::IS_SERVER ? 1 : 0), | 36 perspective() == Perspective::IS_SERVER ? 1 : 0), |
37 num_dynamic_incoming_streams_(0), | 37 num_dynamic_incoming_streams_(0), |
38 num_draining_incoming_streams_(0), | 38 num_draining_incoming_streams_(0), |
39 num_locally_closed_incoming_streams_highest_offset_(0), | 39 num_locally_closed_incoming_streams_highest_offset_(0), |
40 error_(QUIC_NO_ERROR), | 40 error_(QUIC_NO_ERROR), |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 | 870 |
871 size_t QuicSession::MaxAvailableStreams() const { | 871 size_t QuicSession::MaxAvailableStreams() const { |
872 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; | 872 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; |
873 } | 873 } |
874 | 874 |
875 bool QuicSession::IsIncomingStream(QuicStreamId id) const { | 875 bool QuicSession::IsIncomingStream(QuicStreamId id) const { |
876 return id % 2 != next_outgoing_stream_id_ % 2; | 876 return id % 2 != next_outgoing_stream_id_ % 2; |
877 } | 877 } |
878 | 878 |
879 } // namespace net | 879 } // namespace net |
OLD | NEW |