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

Unified Diff: net/http/http_cache.cc

Issue 2692813002: Server push cancellation: add a finch trial parameter (Closed)
Patch Set: sync with internal code Created 3 years, 10 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
Index: net/http/http_cache.cc
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index ccded67606f609db8bce433b09614b4766c130fb..b78d12cf678ae3a027dd1f1669b72cc1515046ba 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -35,6 +35,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"
@@ -318,14 +319,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));
}
}

Powered by Google App Engine
This is Rietveld 408576698