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

Side by Side Diff: net/spdy/chromium/spdy_session_pool.h

Issue 2932513004: Throttle HttpStreamFactoryImpl::Job to HTTP/2-supported servers (Closed)
Patch Set: self 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 #ifndef NET_SPDY_CHROMIUM_SPDY_SESSION_POOL_H_ 5 #ifndef NET_SPDY_CHROMIUM_SPDY_SESSION_POOL_H_
6 #define NET_SPDY_CHROMIUM_SPDY_SESSION_POOL_H_ 6 #define NET_SPDY_CHROMIUM_SPDY_SESSION_POOL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // proxy. 172 // proxy.
173 void OnNewSpdySessionReady(const base::WeakPtr<SpdySession>& spdy_session, 173 void OnNewSpdySessionReady(const base::WeakPtr<SpdySession>& spdy_session,
174 bool direct, 174 bool direct,
175 const SSLConfig& used_ssl_config, 175 const SSLConfig& used_ssl_config,
176 const ProxyInfo& used_proxy_info, 176 const ProxyInfo& used_proxy_info,
177 bool was_alpn_negotiated, 177 bool was_alpn_negotiated,
178 NextProto negotiated_protocol, 178 NextProto negotiated_protocol,
179 bool using_spdy, 179 bool using_spdy,
180 NetLogSource source_dependency); 180 NetLogSource source_dependency);
181 181
182 // Called when a HttpStreamRequest is started with |spdy_session_key|.
183 // Returns true if the request should continue. Returns false if the request
184 // should wait until |callback| is invoked before continuing.
185 bool StartRequest(const SpdySessionKey& spdy_session_key,
Bence 2017/06/09 19:17:40 Optional: return OK instead of true and discard |c
xunjieli 2017/06/13 15:23:11 Acknowledged. But the callback is not a net::Compl
186 const base::Closure& callback);
187
188 // Resumes all pending requests with |spdy_session_key|.
189 void ResumeAllPendingRequests(const SpdySessionKey& spdy_session_key);
190 // Resumes the next pending request with |spdy_session_key|.
191 void ResumeNextPendingRequest(const SpdySessionKey& spdy_session_key);
Bence 2017/06/09 19:17:40 Do you think it is worth making this method privat
xunjieli 2017/06/13 15:23:11 Done.
192
182 // Adds |request| to |spdy_session_request_map_| under |spdy_session_key| Key. 193 // Adds |request| to |spdy_session_request_map_| under |spdy_session_key| Key.
183 // Sets |spdy_session_key| as |request|'s SpdySessionKey. 194 // Sets |spdy_session_key| as |request|'s SpdySessionKey.
184 void AddRequestToSpdySessionRequestMap( 195 void AddRequestToSpdySessionRequestMap(
185 const SpdySessionKey& spdy_session_key, 196 const SpdySessionKey& spdy_session_key,
186 HttpStreamFactoryImpl::Request* request); 197 HttpStreamFactoryImpl::Request* request);
187 198
188 // Removes |request| from |spdy_session_request_map_|. No-op if |request| does 199 // Removes |request| from |spdy_session_request_map_|. No-op if |request| does
189 // not have a SpdySessionKey. 200 // not have a SpdySessionKey.
190 void RemoveRequestFromSpdySessionRequestMap( 201 void RemoveRequestFromSpdySessionRequestMap(
191 HttpStreamFactoryImpl::Request* request); 202 HttpStreamFactoryImpl::Request* request);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 bool enable_ping_based_connection_checking_; 275 bool enable_ping_based_connection_checking_;
265 276
266 size_t session_max_recv_window_size_; 277 size_t session_max_recv_window_size_;
267 278
268 // Settings that are sent in the initial SETTINGS frame 279 // Settings that are sent in the initial SETTINGS frame
269 // (if |enable_sending_initial_data_| is true), 280 // (if |enable_sending_initial_data_| is true),
270 // and also control SpdySession parameters like initial receive window size 281 // and also control SpdySession parameters like initial receive window size
271 // and maximum HPACK dynamic table size. 282 // and maximum HPACK dynamic table size.
272 const SettingsMap initial_settings_; 283 const SettingsMap initial_settings_;
273 284
285 // TODO(xunjieli): Merge these two.
274 SpdySessionRequestMap spdy_session_request_map_; 286 SpdySessionRequestMap spdy_session_request_map_;
287 typedef std::map<SpdySessionKey, std::list<base::Closure>>
288 SpdySessionPendingRequestMap;
289 SpdySessionPendingRequestMap spdy_session_pending_request_map_;
275 290
276 TimeFunc time_func_; 291 TimeFunc time_func_;
277 ServerPushDelegate* push_delegate_; 292 ServerPushDelegate* push_delegate_;
278 293
279 // Determines if a proxy is a trusted SPDY proxy, which is allowed to push 294 // Determines if a proxy is a trusted SPDY proxy, which is allowed to push
280 // resources from origins that are different from those of their associated 295 // resources from origins that are different from those of their associated
281 // streams. May be nullptr. 296 // streams. May be nullptr.
282 ProxyDelegate* proxy_delegate_; 297 ProxyDelegate* proxy_delegate_;
283 298
284 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); 299 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool);
285 }; 300 };
286 301
287 } // namespace net 302 } // namespace net
288 303
289 #endif // NET_SPDY_CHROMIUM_SPDY_SESSION_POOL_H_ 304 #endif // NET_SPDY_CHROMIUM_SPDY_SESSION_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698