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/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 connection_ = std::move(connection); | 724 connection_ = std::move(connection); |
725 is_secure_ = is_secure; | 725 is_secure_ = is_secure; |
726 certificate_error_code_ = certificate_error_code; | 726 certificate_error_code_ = certificate_error_code; |
727 | 727 |
728 session_send_window_size_ = kDefaultInitialWindowSize; | 728 session_send_window_size_ = kDefaultInitialWindowSize; |
729 session_recv_window_size_ = kDefaultInitialWindowSize; | 729 session_recv_window_size_ = kDefaultInitialWindowSize; |
730 | 730 |
731 buffered_spdy_framer_.reset(new BufferedSpdyFramer()); | 731 buffered_spdy_framer_.reset(new BufferedSpdyFramer()); |
732 buffered_spdy_framer_->set_visitor(this); | 732 buffered_spdy_framer_->set_visitor(this); |
733 buffered_spdy_framer_->set_debug_visitor(this); | 733 buffered_spdy_framer_->set_debug_visitor(this); |
734 buffered_spdy_framer_->UpdateHeaderDecoderTableSize(kMaxHeaderTableSize); | |
735 | 734 |
736 net_log_.AddEvent(NetLog::TYPE_HTTP2_SESSION_INITIALIZED, | 735 net_log_.AddEvent(NetLog::TYPE_HTTP2_SESSION_INITIALIZED, |
737 base::Bind(&NetLogSpdyInitializedCallback, | 736 base::Bind(&NetLogSpdyInitializedCallback, |
738 connection_->socket()->NetLog().source())); | 737 connection_->socket()->NetLog().source())); |
739 | 738 |
740 DCHECK_EQ(availability_state_, STATE_AVAILABLE); | 739 DCHECK_EQ(availability_state_, STATE_AVAILABLE); |
741 connection_->AddHigherLayeredPool(this); | 740 connection_->AddHigherLayeredPool(this); |
742 if (enable_sending_initial_data_) | 741 if (enable_sending_initial_data_) |
743 SendInitialData(); | 742 SendInitialData(); |
744 pool_ = pool; | 743 pool_ = pool; |
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2702 new SpdySerializedFrame(const_cast<char*>(kHttp2ConnectionHeaderPrefix), | 2701 new SpdySerializedFrame(const_cast<char*>(kHttp2ConnectionHeaderPrefix), |
2703 kHttp2ConnectionHeaderPrefixSize, | 2702 kHttp2ConnectionHeaderPrefixSize, |
2704 false /* take_ownership */)); | 2703 false /* take_ownership */)); |
2705 // Count the prefix as part of the subsequent SETTINGS frame. | 2704 // Count the prefix as part of the subsequent SETTINGS frame. |
2706 EnqueueSessionWrite(HIGHEST, SETTINGS, | 2705 EnqueueSessionWrite(HIGHEST, SETTINGS, |
2707 std::move(connection_header_prefix_frame)); | 2706 std::move(connection_header_prefix_frame)); |
2708 | 2707 |
2709 // First, notify the server about the settings they should use when | 2708 // First, notify the server about the settings they should use when |
2710 // communicating with us. | 2709 // communicating with us. |
2711 SettingsMap settings_map; | 2710 SettingsMap settings_map; |
2712 settings_map[SETTINGS_HEADER_TABLE_SIZE] = | 2711 // Create a new settings frame notifying the server of our |
2713 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, kMaxHeaderTableSize); | 2712 // max concurrent streams and initial window size. |
2714 settings_map[SETTINGS_MAX_CONCURRENT_STREAMS] = | 2713 settings_map[SETTINGS_MAX_CONCURRENT_STREAMS] = |
2715 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, kMaxConcurrentPushedStreams); | 2714 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, kMaxConcurrentPushedStreams); |
2716 if (stream_max_recv_window_size_ != kDefaultInitialWindowSize) { | 2715 if (stream_max_recv_window_size_ != kDefaultInitialWindowSize) { |
2717 settings_map[SETTINGS_INITIAL_WINDOW_SIZE] = | 2716 settings_map[SETTINGS_INITIAL_WINDOW_SIZE] = |
2718 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, stream_max_recv_window_size_); | 2717 SettingsFlagsAndValue(SETTINGS_FLAG_NONE, stream_max_recv_window_size_); |
2719 } | 2718 } |
2720 SendSettings(settings_map); | 2719 SendSettings(settings_map); |
2721 | 2720 |
2722 // Next, notify the server about our initial recv window size. | 2721 // Next, notify the server about our initial recv window size. |
2723 // Bump up the receive window size to the real initial value. This | 2722 // Bump up the receive window size to the real initial value. This |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3143 if (!queue->empty()) { | 3142 if (!queue->empty()) { |
3144 SpdyStreamId stream_id = queue->front(); | 3143 SpdyStreamId stream_id = queue->front(); |
3145 queue->pop_front(); | 3144 queue->pop_front(); |
3146 return stream_id; | 3145 return stream_id; |
3147 } | 3146 } |
3148 } | 3147 } |
3149 return 0; | 3148 return 0; |
3150 } | 3149 } |
3151 | 3150 |
3152 } // namespace net | 3151 } // namespace net |
OLD | NEW |