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

Unified Diff: net/http/http_cache.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/BUILD.gn ('k') | net/http/http_network_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache.cc
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index bf423eccf48f79822767518d49828fc0e94c11e3..93d39cc9a936f391ba6cc06ec9c20a92ac5bbe14 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -38,6 +38,7 @@
#include "net/base/upload_data_stream.h"
#include "net/disk_cache/disk_cache.h"
#include "net/http/disk_cache_based_quic_server_info.h"
+#include "net/http/http_cache_lookup_manager.h"
#include "net/http/http_cache_transaction.h"
#include "net/http/http_network_layer.h"
#include "net/http/http_network_session.h"
@@ -343,14 +344,20 @@ HttpCache::HttpCache(std::unique_ptr<HttpTransactionFactory> network_layer,
// Session may be NULL in unittests.
// TODO(mmenke): Seems like tests could be changed to provide a session,
// rather than having logic only used in unit tests here.
- if (session) {
- net_log_ = session->net_log();
- if (is_main_cache &&
- !session->quic_stream_factory()->has_quic_server_info_factory()) {
- // QuicStreamFactory takes ownership of QuicServerInfoFactoryAdaptor.
- session->quic_stream_factory()->set_quic_server_info_factory(
- new QuicServerInfoFactoryAdaptor(this));
- }
+ if (!session)
+ return;
+
+ net_log_ = session->net_log();
+ if (!is_main_cache)
+ return;
+
+ session->SetServerPushDelegate(
+ base::MakeUnique<HttpCacheLookupManager>(this));
+
+ if (!session->quic_stream_factory()->has_quic_server_info_factory()) {
+ // QuicStreamFactory takes ownership of QuicServerInfoFactoryAdaptor.
+ session->quic_stream_factory()->set_quic_server_info_factory(
+ new QuicServerInfoFactoryAdaptor(this));
}
}
« no previous file with comments | « net/BUILD.gn ('k') | net/http/http_network_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698