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

Unified Diff: net/http/http_network_session.cc

Issue 2692813002: Server push cancellation: add a finch trial parameter (Closed)
Patch Set: Spin the message loop to ensure the client receives the response Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_network_session.h ('k') | net/quic/core/quic_server_session_base_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_session.cc
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc
index 4b7bcd3fe3c08033a21de65091c800b755d9087a..361156b3cf36df48009dde5ed554bb91007440ba 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -105,6 +105,7 @@ HttpNetworkSession::Params::Params()
: client_socket_factory(nullptr),
host_resolver(nullptr),
cert_verifier(nullptr),
+ enable_server_push_cancellation(false),
channel_id_service(nullptr),
transport_security_state(nullptr),
cert_transparency_verifier(nullptr),
@@ -396,7 +397,9 @@ bool HttpNetworkSession::IsProtocolEnabled(NextProto protocol) const {
void HttpNetworkSession::SetServerPushDelegate(
std::unique_ptr<ServerPushDelegate> push_delegate) {
- DCHECK(!push_delegate_ && push_delegate);
+ DCHECK(push_delegate);
+ if (!params_.enable_server_push_cancellation || push_delegate_)
+ return;
push_delegate_ = std::move(push_delegate);
spdy_session_pool_.set_server_push_delegate(push_delegate_.get());
« no previous file with comments | « net/http/http_network_session.h ('k') | net/quic/core/quic_server_session_base_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698