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

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

Issue 1779733003: Fix bug in net::RequestPriority -> HTTP/2 dependency conversion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 #ifndef NET_SPDY_SPDY_SESSION_H_ 5 #ifndef NET_SPDY_SPDY_SESSION_H_
6 #define NET_SPDY_SPDY_SESSION_H_ 6 #define NET_SPDY_SPDY_SESSION_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 13 matching lines...) Expand all
24 #include "net/base/load_states.h" 24 #include "net/base/load_states.h"
25 #include "net/base/net_errors.h" 25 #include "net/base/net_errors.h"
26 #include "net/base/net_export.h" 26 #include "net/base/net_export.h"
27 #include "net/base/request_priority.h" 27 #include "net/base/request_priority.h"
28 #include "net/socket/client_socket_handle.h" 28 #include "net/socket/client_socket_handle.h"
29 #include "net/socket/client_socket_pool.h" 29 #include "net/socket/client_socket_pool.h"
30 #include "net/socket/next_proto.h" 30 #include "net/socket/next_proto.h"
31 #include "net/socket/ssl_client_socket.h" 31 #include "net/socket/ssl_client_socket.h"
32 #include "net/socket/stream_socket.h" 32 #include "net/socket/stream_socket.h"
33 #include "net/spdy/buffered_spdy_framer.h" 33 #include "net/spdy/buffered_spdy_framer.h"
34 #include "net/spdy/http2_priority_dependencies.h"
34 #include "net/spdy/spdy_buffer.h" 35 #include "net/spdy/spdy_buffer.h"
35 #include "net/spdy/spdy_framer.h" 36 #include "net/spdy/spdy_framer.h"
36 #include "net/spdy/spdy_header_block.h" 37 #include "net/spdy/spdy_header_block.h"
37 #include "net/spdy/spdy_protocol.h" 38 #include "net/spdy/spdy_protocol.h"
38 #include "net/spdy/spdy_session_pool.h" 39 #include "net/spdy/spdy_session_pool.h"
39 #include "net/spdy/spdy_stream.h" 40 #include "net/spdy/spdy_stream.h"
40 #include "net/spdy/spdy_write_queue.h" 41 #include "net/spdy/spdy_write_queue.h"
41 #include "net/ssl/ssl_config_service.h" 42 #include "net/ssl/ssl_config_service.h"
42 #include "url/gurl.h" 43 #include "url/gurl.h"
43 44
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 } 953 }
953 954
954 int64_t pings_in_flight() const { return pings_in_flight_; } 955 int64_t pings_in_flight() const { return pings_in_flight_; }
955 956
956 SpdyPingId next_ping_id() const { return next_ping_id_; } 957 SpdyPingId next_ping_id() const { return next_ping_id_; }
957 958
958 base::TimeTicks last_activity_time() const { return last_activity_time_; } 959 base::TimeTicks last_activity_time() const { return last_activity_time_; }
959 960
960 bool check_ping_status_pending() const { return check_ping_status_pending_; } 961 bool check_ping_status_pending() const { return check_ping_status_pending_; }
961 962
962 // Set whether priority->dependency conversion is enabled
963 // by default for all future SpdySessions.
964 static void SetPriorityDependencyDefaultForTesting(bool enable);
965
966 // Whether Do{Read,Write}Loop() is in the call stack. Useful for 963 // Whether Do{Read,Write}Loop() is in the call stack. Useful for
967 // making sure we don't destroy ourselves prematurely in that case. 964 // making sure we don't destroy ourselves prematurely in that case.
968 bool in_io_loop_; 965 bool in_io_loop_;
969 966
970 // The key used to identify this session. 967 // The key used to identify this session.
971 const SpdySessionKey spdy_session_key_; 968 const SpdySessionKey spdy_session_key_;
972 969
973 // Set set of SpdySessionKeys for which this session has serviced 970 // Set set of SpdySessionKeys for which this session has serviced
974 // requests. 971 // requests.
975 std::set<SpdySessionKey> pooled_aliases_; 972 std::set<SpdySessionKey> pooled_aliases_;
(...skipping 26 matching lines...) Expand all
1002 // the server to start pushing the stream]) or there are still network events 999 // the server to start pushing the stream]) or there are still network events
1003 // incoming even though the consumer has already gone away (cancellation). 1000 // incoming even though the consumer has already gone away (cancellation).
1004 // 1001 //
1005 // |active_streams_| owns all its SpdyStream objects. 1002 // |active_streams_| owns all its SpdyStream objects.
1006 // 1003 //
1007 // TODO(willchan): Perhaps we should separate out cancelled streams and move 1004 // TODO(willchan): Perhaps we should separate out cancelled streams and move
1008 // them into a separate ActiveStreamMap, and not deliver network events to 1005 // them into a separate ActiveStreamMap, and not deliver network events to
1009 // them? 1006 // them?
1010 ActiveStreamMap active_streams_; 1007 ActiveStreamMap active_streams_;
1011 1008
1012 // Per-priority map from stream id to all active streams. This map will
1013 // contain the same set of streams as |active_streams_|. It is used for
1014 // setting dependencies to match incoming requests RequestPriority.
1015 //
1016 // |active_streams_by_priority_| does *not* own its SpdyStream objects.
1017 std::map<SpdyStreamId, SpdyStream*>
1018 active_streams_by_priority_[NUM_PRIORITIES];
1019
1020 // (Bijective) map from the URL to the ID of the streams that have 1009 // (Bijective) map from the URL to the ID of the streams that have
1021 // already started to be pushed by the server, but do not have 1010 // already started to be pushed by the server, but do not have
1022 // consumers yet. Contains a subset of |active_streams_|. 1011 // consumers yet. Contains a subset of |active_streams_|.
1023 PushedStreamMap unclaimed_pushed_streams_; 1012 PushedStreamMap unclaimed_pushed_streams_;
1024 1013
1025 // Set of all created streams but that have not yet sent any frames. 1014 // Set of all created streams but that have not yet sent any frames.
1026 // 1015 //
1027 // |created_streams_| owns all its SpdyStream objects. 1016 // |created_streams_| owns all its SpdyStream objects.
1028 CreatedStreamSet created_streams_; 1017 CreatedStreamSet created_streams_;
1029 1018
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 // get a PING response (http://crbug.com/127812). 1174 // get a PING response (http://crbug.com/127812).
1186 base::TimeDelta hung_interval_; 1175 base::TimeDelta hung_interval_;
1187 1176
1188 // The |proxy_delegate_| verifies that a given proxy is a trusted SPDY proxy, 1177 // The |proxy_delegate_| verifies that a given proxy is a trusted SPDY proxy,
1189 // which is allowed to push resources from origins that are different from 1178 // which is allowed to push resources from origins that are different from
1190 // those of their associated streams. May be nullptr. 1179 // those of their associated streams. May be nullptr.
1191 ProxyDelegate* proxy_delegate_; 1180 ProxyDelegate* proxy_delegate_;
1192 1181
1193 TimeFunc time_func_; 1182 TimeFunc time_func_;
1194 1183
1195 // Should priority-based dependency information be sent in stream header 1184 Http2PriorityDependencies priority_dependency_state_;
1196 // frames.
1197 bool send_priority_dependency_;
1198 1185
1199 // Used for posting asynchronous IO tasks. We use this even though 1186 // Used for posting asynchronous IO tasks. We use this even though
1200 // SpdySession is refcounted because we don't need to keep the SpdySession 1187 // SpdySession is refcounted because we don't need to keep the SpdySession
1201 // alive if the last reference is within a RunnableMethod. Just revoke the 1188 // alive if the last reference is within a RunnableMethod. Just revoke the
1202 // method. 1189 // method.
1203 base::WeakPtrFactory<SpdySession> weak_factory_; 1190 base::WeakPtrFactory<SpdySession> weak_factory_;
1204 }; 1191 };
1205 1192
1206 } // namespace net 1193 } // namespace net
1207 1194
1208 #endif // NET_SPDY_SPDY_SESSION_H_ 1195 #endif // NET_SPDY_SPDY_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698