| 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/chromium/spdy_session.h" | 5 #include "net/spdy/chromium/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 27 matching lines...) Expand all Loading... |
| 38 #include "net/http/http_util.h" | 38 #include "net/http/http_util.h" |
| 39 #include "net/http/transport_security_state.h" | 39 #include "net/http/transport_security_state.h" |
| 40 #include "net/log/net_log.h" | 40 #include "net/log/net_log.h" |
| 41 #include "net/log/net_log_capture_mode.h" | 41 #include "net/log/net_log_capture_mode.h" |
| 42 #include "net/log/net_log_event_type.h" | 42 #include "net/log/net_log_event_type.h" |
| 43 #include "net/log/net_log_source_type.h" | 43 #include "net/log/net_log_source_type.h" |
| 44 #include "net/log/net_log_with_source.h" | 44 #include "net/log/net_log_with_source.h" |
| 45 #include "net/proxy/proxy_server.h" | 45 #include "net/proxy/proxy_server.h" |
| 46 #include "net/socket/socket.h" | 46 #include "net/socket/socket.h" |
| 47 #include "net/socket/ssl_client_socket.h" | 47 #include "net/socket/ssl_client_socket.h" |
| 48 #include "net/spdy/chromium/header_coalescer.h" |
| 48 #include "net/spdy/chromium/spdy_buffer_producer.h" | 49 #include "net/spdy/chromium/spdy_buffer_producer.h" |
| 49 #include "net/spdy/chromium/spdy_http_utils.h" | 50 #include "net/spdy/chromium/spdy_http_utils.h" |
| 50 #include "net/spdy/chromium/spdy_log_util.h" | 51 #include "net/spdy/chromium/spdy_log_util.h" |
| 51 #include "net/spdy/chromium/spdy_session_pool.h" | 52 #include "net/spdy/chromium/spdy_session_pool.h" |
| 52 #include "net/spdy/chromium/spdy_stream.h" | 53 #include "net/spdy/chromium/spdy_stream.h" |
| 53 #include "net/spdy/core/spdy_frame_builder.h" | 54 #include "net/spdy/core/spdy_frame_builder.h" |
| 54 #include "net/spdy/core/spdy_protocol.h" | 55 #include "net/spdy/core/spdy_protocol.h" |
| 55 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h" | 56 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h" |
| 56 #include "net/spdy/platform/api/spdy_string_utils.h" | 57 #include "net/spdy/platform/api/spdy_string_utils.h" |
| 57 #include "net/ssl/channel_id_service.h" | 58 #include "net/ssl/channel_id_service.h" |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 | 888 |
| 888 connection_ = std::move(connection); | 889 connection_ = std::move(connection); |
| 889 | 890 |
| 890 session_send_window_size_ = kDefaultInitialWindowSize; | 891 session_send_window_size_ = kDefaultInitialWindowSize; |
| 891 session_recv_window_size_ = kDefaultInitialWindowSize; | 892 session_recv_window_size_ = kDefaultInitialWindowSize; |
| 892 | 893 |
| 893 buffered_spdy_framer_ = base::MakeUnique<BufferedSpdyFramer>(net_log_); | 894 buffered_spdy_framer_ = base::MakeUnique<BufferedSpdyFramer>(net_log_); |
| 894 buffered_spdy_framer_->set_visitor(this); | 895 buffered_spdy_framer_->set_visitor(this); |
| 895 buffered_spdy_framer_->set_debug_visitor(this); | 896 buffered_spdy_framer_->set_debug_visitor(this); |
| 896 buffered_spdy_framer_->UpdateHeaderDecoderTableSize(max_header_table_size_); | 897 buffered_spdy_framer_->UpdateHeaderDecoderTableSize(max_header_table_size_); |
| 898 // Do not bother decoding response headers more than a factor over the limit. |
| 899 buffered_spdy_framer_->set_max_decode_buffer_size_bytes(2 * |
| 900 kMaxHeaderListSize); |
| 897 | 901 |
| 898 net_log_.AddEvent(NetLogEventType::HTTP2_SESSION_INITIALIZED, | 902 net_log_.AddEvent(NetLogEventType::HTTP2_SESSION_INITIALIZED, |
| 899 base::Bind(&NetLogSpdyInitializedCallback, | 903 base::Bind(&NetLogSpdyInitializedCallback, |
| 900 connection_->socket()->NetLog().source())); | 904 connection_->socket()->NetLog().source())); |
| 901 | 905 |
| 902 DCHECK_EQ(availability_state_, STATE_AVAILABLE); | 906 DCHECK_EQ(availability_state_, STATE_AVAILABLE); |
| 903 connection_->AddHigherLayeredPool(this); | 907 connection_->AddHigherLayeredPool(this); |
| 904 if (enable_sending_initial_data_) | 908 if (enable_sending_initial_data_) |
| 905 SendInitialData(); | 909 SendInitialData(); |
| 906 pool_ = pool; | 910 pool_ = pool; |
| (...skipping 2336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3243 if (!queue->empty()) { | 3247 if (!queue->empty()) { |
| 3244 SpdyStreamId stream_id = queue->front(); | 3248 SpdyStreamId stream_id = queue->front(); |
| 3245 queue->pop_front(); | 3249 queue->pop_front(); |
| 3246 return stream_id; | 3250 return stream_id; |
| 3247 } | 3251 } |
| 3248 } | 3252 } |
| 3249 return 0; | 3253 return 0; |
| 3250 } | 3254 } |
| 3251 | 3255 |
| 3252 } // namespace net | 3256 } // namespace net |
| OLD | NEW |