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