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

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

Issue 1579213006: Remove unused SPDY/3 enum values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove trivial comparisons; change non-trivial ones. Created 4 years, 11 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 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 if (protocol_negotiated != kProtoUnknown) { 752 if (protocol_negotiated != kProtoUnknown) {
753 protocol_ = protocol_negotiated; 753 protocol_ = protocol_negotiated;
754 stream_initial_send_window_size_ = GetDefaultInitialWindowSize(protocol_); 754 stream_initial_send_window_size_ = GetDefaultInitialWindowSize(protocol_);
755 } 755 }
756 DCHECK_GE(protocol_, kProtoSPDYMinimumVersion); 756 DCHECK_GE(protocol_, kProtoSPDYMinimumVersion);
757 DCHECK_LE(protocol_, kProtoSPDYMaximumVersion); 757 DCHECK_LE(protocol_, kProtoSPDYMaximumVersion);
758 758
759 if (protocol_ == kProtoHTTP2) 759 if (protocol_ == kProtoHTTP2)
760 send_connection_header_prefix_ = true; 760 send_connection_header_prefix_ = true;
761 761
762 if (protocol_ >= kProtoSPDY31) { 762 flow_control_state_ = FLOW_CONTROL_STREAM_AND_SESSION;
763 flow_control_state_ = FLOW_CONTROL_STREAM_AND_SESSION; 763 session_send_window_size_ = GetDefaultInitialWindowSize(protocol_);
764 session_send_window_size_ = GetDefaultInitialWindowSize(protocol_); 764 session_recv_window_size_ = GetDefaultInitialWindowSize(protocol_);
765 session_recv_window_size_ = GetDefaultInitialWindowSize(protocol_);
766 } else {
767 flow_control_state_ = FLOW_CONTROL_STREAM;
768 }
769 765
770 buffered_spdy_framer_.reset( 766 buffered_spdy_framer_.reset(
771 new BufferedSpdyFramer(NextProtoToSpdyMajorVersion(protocol_), 767 new BufferedSpdyFramer(NextProtoToSpdyMajorVersion(protocol_),
772 enable_compression_)); 768 enable_compression_));
773 buffered_spdy_framer_->set_visitor(this); 769 buffered_spdy_framer_->set_visitor(this);
774 buffered_spdy_framer_->set_debug_visitor(this); 770 buffered_spdy_framer_->set_debug_visitor(this);
775 UMA_HISTOGRAM_ENUMERATION( 771 UMA_HISTOGRAM_ENUMERATION(
776 "Net.SpdyVersion2", 772 "Net.SpdyVersion2",
777 protocol_ - kProtoSPDYHistogramOffset, 773 protocol_ - kProtoSPDYHistogramOffset,
778 kProtoSPDYMaximumVersion - kProtoSPDYMinimumVersion + 1); 774 kProtoSPDYMaximumVersion - kProtoSPDYMinimumVersion + 1);
(...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after
2850 // This condition implies that |session_max_recv_window_size_| - 2846 // This condition implies that |session_max_recv_window_size_| -
2851 // |session_recv_window_size_| doesn't overflow. 2847 // |session_recv_window_size_| doesn't overflow.
2852 DCHECK_GE(session_max_recv_window_size_, session_recv_window_size_); 2848 DCHECK_GE(session_max_recv_window_size_, session_recv_window_size_);
2853 DCHECK_GE(session_recv_window_size_, 0); 2849 DCHECK_GE(session_recv_window_size_, 0);
2854 if (session_max_recv_window_size_ > session_recv_window_size_) { 2850 if (session_max_recv_window_size_ > session_recv_window_size_) {
2855 IncreaseRecvWindowSize(session_max_recv_window_size_ - 2851 IncreaseRecvWindowSize(session_max_recv_window_size_ -
2856 session_recv_window_size_); 2852 session_recv_window_size_);
2857 } 2853 }
2858 } 2854 }
2859 2855
2860 if (protocol_ <= kProtoSPDY31) { 2856 if (protocol_ == kProtoSPDY31) {
2861 // Finally, notify the server about the settings they have 2857 // Finally, notify the server about the settings they have
2862 // previously told us to use when communicating with them (after 2858 // previously told us to use when communicating with them (after
2863 // applying them). 2859 // applying them).
2864 const SettingsMap& server_settings_map = 2860 const SettingsMap& server_settings_map =
2865 http_server_properties_->GetSpdySettings(host_port_pair()); 2861 http_server_properties_->GetSpdySettings(host_port_pair());
2866 if (server_settings_map.empty()) 2862 if (server_settings_map.empty())
2867 return; 2863 return;
2868 2864
2869 SettingsMap::const_iterator it = 2865 SettingsMap::const_iterator it =
2870 server_settings_map.find(SETTINGS_CURRENT_CWND); 2866 server_settings_map.find(SETTINGS_CURRENT_CWND);
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
3322 if (!queue->empty()) { 3318 if (!queue->empty()) {
3323 SpdyStreamId stream_id = queue->front(); 3319 SpdyStreamId stream_id = queue->front();
3324 queue->pop_front(); 3320 queue->pop_front();
3325 return stream_id; 3321 return stream_id;
3326 } 3322 }
3327 } 3323 }
3328 return 0; 3324 return 0;
3329 } 3325 }
3330 3326
3331 } // namespace net 3327 } // 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