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

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

Issue 2901093004: Add and persist a new field in AlternativeServiceInfo to list QUIC verisons advertised (Closed)
Patch Set: fix cronet/grpc Created 3 years, 6 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
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/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 2990 matching lines...) Expand 10 before | Expand all | Expand 10 after
3001 const base::Time now(base::Time::Now()); 3001 const base::Time now(base::Time::Now());
3002 for (const SpdyAltSvcWireFormat::AlternativeService& altsvc : altsvc_vector) { 3002 for (const SpdyAltSvcWireFormat::AlternativeService& altsvc : altsvc_vector) {
3003 const NextProto protocol = NextProtoFromString(altsvc.protocol_id); 3003 const NextProto protocol = NextProtoFromString(altsvc.protocol_id);
3004 if (protocol == kProtoUnknown) 3004 if (protocol == kProtoUnknown)
3005 continue; 3005 continue;
3006 const AlternativeService alternative_service(protocol, altsvc.host, 3006 const AlternativeService alternative_service(protocol, altsvc.host,
3007 altsvc.port); 3007 altsvc.port);
3008 const base::Time expiration = 3008 const base::Time expiration =
3009 now + base::TimeDelta::FromSeconds(altsvc.max_age); 3009 now + base::TimeDelta::FromSeconds(altsvc.max_age);
3010 alternative_service_info_vector.push_back( 3010 alternative_service_info_vector.push_back(
3011 AlternativeServiceInfo(alternative_service, expiration)); 3011 AlternativeServiceInfo::CreateHttp2AlternativeServiceInfo(
3012 alternative_service, expiration));
3012 } 3013 }
3013 http_server_properties_->SetAlternativeServices( 3014 http_server_properties_->SetAlternativeServices(
3014 scheme_host_port, alternative_service_info_vector); 3015 scheme_host_port, alternative_service_info_vector);
3015 } 3016 }
3016 3017
3017 bool SpdySession::OnUnknownFrame(SpdyStreamId stream_id, uint8_t frame_type) { 3018 bool SpdySession::OnUnknownFrame(SpdyStreamId stream_id, uint8_t frame_type) {
3018 // Validate stream id. 3019 // Validate stream id.
3019 // Was the frame sent on a stream id that has not been used in this session? 3020 // Was the frame sent on a stream id that has not been used in this session?
3020 if (stream_id % 2 == 1 && stream_id > stream_hi_water_mark_) 3021 if (stream_id % 2 == 1 && stream_id > stream_hi_water_mark_)
3021 return false; 3022 return false;
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
3217 if (!queue->empty()) { 3218 if (!queue->empty()) {
3218 SpdyStreamId stream_id = queue->front(); 3219 SpdyStreamId stream_id = queue->front();
3219 queue->pop_front(); 3220 queue->pop_front();
3220 return stream_id; 3221 return stream_id;
3221 } 3222 }
3222 } 3223 }
3223 return 0; 3224 return 0;
3224 } 3225 }
3225 3226
3226 } // namespace net 3227 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698