Chromium Code Reviews| 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 <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1293 | 1293 |
| 1294 scoped_refptr<SpdyStream> stream = active_streams_[stream_id]; | 1294 scoped_refptr<SpdyStream> stream = active_streams_[stream_id]; |
| 1295 stream->OnDataReceived(data, len); | 1295 stream->OnDataReceived(data, len); |
| 1296 } | 1296 } |
| 1297 | 1297 |
| 1298 void SpdySession::OnSetting(spdy::SpdySettingsIds id, | 1298 void SpdySession::OnSetting(spdy::SpdySettingsIds id, |
| 1299 uint8 flags, | 1299 uint8 flags, |
| 1300 uint32 value) { | 1300 uint32 value) { |
| 1301 HandleSetting(id, value); | 1301 HandleSetting(id, value); |
| 1302 spdy::SettingsFlagsAndId flags_and_id(flags, id); | 1302 spdy::SettingsFlagsAndId flags_and_id(flags, id); |
| 1303 http_server_properties_->SetSpdySetting( | 1303 // TODO(rtenneti): persist SpdySetting. |
|
willchan no longer on Chromium
2012/03/15 03:13:54
Wait, why do we have to change this? We can still
ramant (doing other things)
2012/03/15 03:46:30
SetSpdySetting is doing the copy of memory. It is
| |
| 1304 host_port_pair(), std::make_pair(flags_and_id, value)); | 1304 // http_server_properties_->SetSpdySetting( |
| 1305 // host_port_pair(), std::make_pair(flags_and_id, value)); | |
| 1305 | 1306 |
| 1306 received_settings_ = true; | 1307 received_settings_ = true; |
| 1307 | 1308 |
| 1308 // Log the settings. | 1309 // Log the settings. |
| 1309 spdy::SpdySettings settings; | 1310 spdy::SpdySettings settings; |
| 1310 settings.insert(settings.end(), std::make_pair(flags_and_id, value)); | 1311 settings.insert(settings.end(), std::make_pair(flags_and_id, value)); |
| 1311 net_log_.AddEvent( | 1312 net_log_.AddEvent( |
| 1312 NetLog::TYPE_SPDY_SESSION_RECV_SETTINGS, | 1313 NetLog::TYPE_SPDY_SESSION_RECV_SETTINGS, |
| 1313 make_scoped_refptr(new NetLogSpdySettingsParameter(settings))); | 1314 make_scoped_refptr(new NetLogSpdySettingsParameter(settings))); |
| 1314 } | 1315 } |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1666 cwnd = ApplyCwndFieldTrialPolicy(val); | 1667 cwnd = ApplyCwndFieldTrialPolicy(val); |
| 1667 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsCwndSent", | 1668 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsCwndSent", |
| 1668 cwnd, | 1669 cwnd, |
| 1669 1, 200, 100); | 1670 1, 200, 100); |
| 1670 if (cwnd != val) { | 1671 if (cwnd != val) { |
| 1671 spdy::SettingsFlagsAndId new_id(spdy::SETTINGS_FLAG_PLEASE_PERSIST, | 1672 spdy::SettingsFlagsAndId new_id(spdy::SETTINGS_FLAG_PLEASE_PERSIST, |
| 1672 id); | 1673 id); |
| 1673 i->second = cwnd; | 1674 i->second = cwnd; |
| 1674 i->first = new_id; | 1675 i->first = new_id; |
| 1675 spdy::SpdySetting setting(new_id, val); | 1676 spdy::SpdySetting setting(new_id, val); |
| 1676 http_server_properties_->SetSpdySetting(host_port_pair(), setting); | 1677 // TODO(rtenneti): Persist SpdySetting. |
|
willchan no longer on Chromium
2012/03/15 03:13:54
Do we need to change this too?
ramant (doing other things)
2012/03/15 03:46:30
This is where the bug was. In the previous version
| |
| 1678 // http_server_properties_->SetSpdySetting(host_port_pair(), setting); | |
| 1677 unique_settings[id] = setting; | 1679 unique_settings[id] = setting; |
| 1678 continue; | 1680 continue; |
| 1679 } | 1681 } |
| 1680 } | 1682 } |
| 1681 unique_settings[id] = *i; | 1683 unique_settings[id] = *i; |
| 1682 } | 1684 } |
| 1683 | 1685 |
| 1684 HandleSettings(settings); | 1686 HandleSettings(settings); |
| 1685 | 1687 |
| 1686 net_log_.AddEvent( | 1688 net_log_.AddEvent( |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1934 SSLClientSocket* SpdySession::GetSSLClientSocket() const { | 1936 SSLClientSocket* SpdySession::GetSSLClientSocket() const { |
| 1935 if (!is_secure_) | 1937 if (!is_secure_) |
| 1936 return NULL; | 1938 return NULL; |
| 1937 SSLClientSocket* ssl_socket = | 1939 SSLClientSocket* ssl_socket = |
| 1938 reinterpret_cast<SSLClientSocket*>(connection_->socket()); | 1940 reinterpret_cast<SSLClientSocket*>(connection_->socket()); |
| 1939 DCHECK(ssl_socket); | 1941 DCHECK(ssl_socket); |
| 1940 return ssl_socket; | 1942 return ssl_socket; |
| 1941 } | 1943 } |
| 1942 | 1944 |
| 1943 } // namespace net | 1945 } // namespace net |
| OLD | NEW |