| Index: net/http/http_cache.cc
|
| diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
|
| index 968cffa9f587378ead01e2a406dcfeb2c025f5ed..93d39cc9a936f391ba6cc06ec9c20a92ac5bbe14 100644
|
| --- a/net/http/http_cache.cc
|
| +++ b/net/http/http_cache.cc
|
| @@ -37,6 +37,7 @@
|
| #include "net/base/net_errors.h"
|
| #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"
|
| @@ -302,6 +303,24 @@
|
| }
|
|
|
| //-----------------------------------------------------------------------------
|
| +
|
| +class HttpCache::QuicServerInfoFactoryAdaptor : public QuicServerInfoFactory {
|
| + public:
|
| + explicit QuicServerInfoFactoryAdaptor(HttpCache* http_cache)
|
| + : http_cache_(http_cache) {
|
| + }
|
| +
|
| + std::unique_ptr<QuicServerInfo> GetForServer(
|
| + const QuicServerId& server_id) override {
|
| + return base::MakeUnique<DiskCacheBasedQuicServerInfo>(server_id,
|
| + http_cache_);
|
| + }
|
| +
|
| + private:
|
| + HttpCache* const http_cache_;
|
| +};
|
| +
|
| +//-----------------------------------------------------------------------------
|
| HttpCache::HttpCache(HttpNetworkSession* session,
|
| std::unique_ptr<BackendFactory> backend_factory,
|
| bool is_main_cache)
|
| @@ -334,6 +353,12 @@
|
|
|
| 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));
|
| + }
|
| }
|
|
|
| HttpCache::~HttpCache() {
|
|
|