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

Side by Side Diff: net/spdy/spdy_session.cc

Issue 1858093002: Alt-Svc 8: Change Supports SPDY list using SHP as the key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@alt_svc_7
Patch Set: server pref changes Created 4 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
« no previous file with comments | « net/spdy/spdy_network_transaction_unittest.cc ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2174 } 2174 }
2175 2175
2176 void SpdySession::OnHeaderFrameEnd(SpdyStreamId stream_id, bool end_headers) { 2176 void SpdySession::OnHeaderFrameEnd(SpdyStreamId stream_id, bool end_headers) {
2177 LOG(FATAL); 2177 LOG(FATAL);
2178 } 2178 }
2179 2179
2180 void SpdySession::OnSettings(bool clear_persisted) { 2180 void SpdySession::OnSettings(bool clear_persisted) {
2181 CHECK(in_io_loop_); 2181 CHECK(in_io_loop_);
2182 2182
2183 if (clear_persisted) 2183 if (clear_persisted)
2184 http_server_properties_->ClearSpdySettings(host_port_pair()); 2184 http_server_properties_->ClearSpdySettings(url::SchemeHostPort());
2185 2185
2186 if (net_log_.IsCapturing()) { 2186 if (net_log_.IsCapturing()) {
2187 net_log_.AddEvent(NetLog::TYPE_HTTP2_SESSION_RECV_SETTINGS, 2187 net_log_.AddEvent(NetLog::TYPE_HTTP2_SESSION_RECV_SETTINGS,
2188 base::Bind(&NetLogSpdySettingsCallback, host_port_pair(), 2188 base::Bind(&NetLogSpdySettingsCallback, host_port_pair(),
2189 clear_persisted)); 2189 clear_persisted));
2190 } 2190 }
2191 2191
2192 if (GetProtocolVersion() >= HTTP2) { 2192 if (GetProtocolVersion() >= HTTP2) {
2193 // Send an acknowledgment of the setting. 2193 // Send an acknowledgment of the setting.
2194 SpdySettingsIR settings_ir; 2194 SpdySettingsIR settings_ir;
2195 settings_ir.set_is_ack(true); 2195 settings_ir.set_is_ack(true);
2196 EnqueueSessionWrite( 2196 EnqueueSessionWrite(
2197 HIGHEST, 2197 HIGHEST,
2198 SETTINGS, 2198 SETTINGS,
2199 scoped_ptr<SpdyFrame>( 2199 scoped_ptr<SpdyFrame>(
2200 buffered_spdy_framer_->SerializeFrame(settings_ir))); 2200 buffered_spdy_framer_->SerializeFrame(settings_ir)));
2201 } 2201 }
2202 } 2202 }
2203 2203
2204 void SpdySession::OnSetting(SpdySettingsIds id, uint8_t flags, uint32_t value) { 2204 void SpdySession::OnSetting(SpdySettingsIds id, uint8_t flags, uint32_t value) {
2205 CHECK(in_io_loop_); 2205 CHECK(in_io_loop_);
2206 2206
2207 HandleSetting(id, value); 2207 HandleSetting(id, value);
2208 http_server_properties_->SetSpdySetting( 2208 http_server_properties_->SetSpdySetting(
2209 host_port_pair(), 2209 url::SchemeHostPort(), id, static_cast<SpdySettingsFlags>(flags), value);
2210 id,
2211 static_cast<SpdySettingsFlags>(flags),
2212 value);
2213 received_settings_ = true; 2210 received_settings_ = true;
2214 2211
2215 // Log the setting. 2212 // Log the setting.
2216 const SpdyMajorVersion protocol_version = GetProtocolVersion(); 2213 const SpdyMajorVersion protocol_version = GetProtocolVersion();
2217 net_log_.AddEvent(NetLog::TYPE_HTTP2_SESSION_RECV_SETTING, 2214 net_log_.AddEvent(NetLog::TYPE_HTTP2_SESSION_RECV_SETTING,
2218 base::Bind(&NetLogSpdySettingCallback, id, protocol_version, 2215 base::Bind(&NetLogSpdySettingCallback, id, protocol_version,
2219 static_cast<SpdySettingsFlags>(flags), value)); 2216 static_cast<SpdySettingsFlags>(flags), value));
2220 } 2217 }
2221 2218
2222 void SpdySession::OnSendCompressedFrame( 2219 void SpdySession::OnSendCompressedFrame(
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
2865 if (session_max_recv_window_size_ > session_recv_window_size_) { 2862 if (session_max_recv_window_size_ > session_recv_window_size_) {
2866 IncreaseRecvWindowSize(session_max_recv_window_size_ - 2863 IncreaseRecvWindowSize(session_max_recv_window_size_ -
2867 session_recv_window_size_); 2864 session_recv_window_size_);
2868 } 2865 }
2869 2866
2870 if (protocol_ == kProtoSPDY31) { 2867 if (protocol_ == kProtoSPDY31) {
2871 // Finally, notify the server about the settings they have 2868 // Finally, notify the server about the settings they have
2872 // previously told us to use when communicating with them (after 2869 // previously told us to use when communicating with them (after
2873 // applying them). 2870 // applying them).
2874 const SettingsMap& server_settings_map = 2871 const SettingsMap& server_settings_map =
2875 http_server_properties_->GetSpdySettings(host_port_pair()); 2872 http_server_properties_->GetSpdySettings(url::SchemeHostPort());
2876 if (server_settings_map.empty()) 2873 if (server_settings_map.empty())
2877 return; 2874 return;
2878 2875
2879 SettingsMap::const_iterator it = 2876 SettingsMap::const_iterator it =
2880 server_settings_map.find(SETTINGS_CURRENT_CWND); 2877 server_settings_map.find(SETTINGS_CURRENT_CWND);
2881 uint32_t cwnd = (it != server_settings_map.end()) ? it->second.second : 0; 2878 uint32_t cwnd = (it != server_settings_map.end()) ? it->second.second : 0;
2882 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsCwndSent", cwnd, 1, 200, 100); 2879 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsCwndSent", cwnd, 1, 200, 100);
2883 2880
2884 for (SettingsMap::const_iterator it = server_settings_map.begin(); 2881 for (SettingsMap::const_iterator it = server_settings_map.begin();
2885 it != server_settings_map.end(); ++it) { 2882 it != server_settings_map.end(); ++it) {
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
3072 received_settings_ ? 1 : 0, 2); 3069 received_settings_ ? 1 : 0, 2);
3073 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdyStreamStallsPerSession", 3070 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdyStreamStallsPerSession",
3074 stalled_streams_, 3071 stalled_streams_,
3075 0, 300, 50); 3072 0, 300, 50);
3076 UMA_HISTOGRAM_ENUMERATION("Net.SpdySessionsWithStalls", 3073 UMA_HISTOGRAM_ENUMERATION("Net.SpdySessionsWithStalls",
3077 stalled_streams_ > 0 ? 1 : 0, 2); 3074 stalled_streams_ > 0 ? 1 : 0, 2);
3078 3075
3079 if (received_settings_) { 3076 if (received_settings_) {
3080 // Enumerate the saved settings, and set histograms for it. 3077 // Enumerate the saved settings, and set histograms for it.
3081 const SettingsMap& settings_map = 3078 const SettingsMap& settings_map =
3082 http_server_properties_->GetSpdySettings(host_port_pair()); 3079 http_server_properties_->GetSpdySettings(url::SchemeHostPort());
3083 3080
3084 SettingsMap::const_iterator it; 3081 SettingsMap::const_iterator it;
3085 for (it = settings_map.begin(); it != settings_map.end(); ++it) { 3082 for (it = settings_map.begin(); it != settings_map.end(); ++it) {
3086 const SpdySettingsIds id = it->first; 3083 const SpdySettingsIds id = it->first;
3087 const uint32_t val = it->second.second; 3084 const uint32_t val = it->second.second;
3088 switch (id) { 3085 switch (id) {
3089 case SETTINGS_CURRENT_CWND: 3086 case SETTINGS_CURRENT_CWND:
3090 // Record several different histograms to see if cwnd converges 3087 // Record several different histograms to see if cwnd converges
3091 // for larger volumes of data being sent. 3088 // for larger volumes of data being sent.
3092 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsCwnd", 3089 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsCwnd",
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
3310 if (!queue->empty()) { 3307 if (!queue->empty()) {
3311 SpdyStreamId stream_id = queue->front(); 3308 SpdyStreamId stream_id = queue->front();
3312 queue->pop_front(); 3309 queue->pop_front();
3313 return stream_id; 3310 return stream_id;
3314 } 3311 }
3315 } 3312 }
3316 return 0; 3313 return 0;
3317 } 3314 }
3318 3315
3319 } // namespace net 3316 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_network_transaction_unittest.cc ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698