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

Unified Diff: net/http/http_cache.cc

Issue 182993003: Add the ability for DevTools to wrap network transactions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 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_cache.h ('k') | net/quic/quic_stream_factory.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 f114f19fe7d428fcd19cd4a9b22e6e977ddf0108..74ce8a37dd44db2265097adc9ad07bb5b8189fda 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -291,13 +291,9 @@ HttpCache::HttpCache(const net::HttpNetworkSession::Params& params,
backend_factory_(backend_factory),
building_backend_(false),
mode_(NORMAL),
- quic_server_info_factory_(params.enable_quic_persist_server_info ?
- new QuicServerInfoFactoryAdaptor(this) : NULL),
network_layer_(new HttpNetworkLayer(new HttpNetworkSession(params))),
weak_factory_(this) {
- HttpNetworkSession* session = network_layer_->GetSession();
- session->quic_stream_factory()->set_quic_server_info_factory(
- quic_server_info_factory_.get());
+ SetupQuicServerInfoFactory(network_layer_->GetSession());
}
@@ -322,6 +318,7 @@ HttpCache::HttpCache(HttpTransactionFactory* network_layer,
mode_(NORMAL),
network_layer_(network_layer),
weak_factory_(this) {
+ SetupQuicServerInfoFactory(network_layer_->GetSession());
}
HttpCache::~HttpCache() {
@@ -1007,6 +1004,16 @@ bool HttpCache::RemovePendingTransactionFromPendingOp(PendingOp* pending_op,
return false;
}
+void HttpCache::SetupQuicServerInfoFactory(HttpNetworkSession* session) {
+ if (session && session->params().enable_quic_persist_server_info &&
+ !session->quic_stream_factory()->has_quic_server_info_factory()) {
+ DCHECK(!quic_server_info_factory_);
+ quic_server_info_factory_.reset(new QuicServerInfoFactoryAdaptor(this));
+ session->quic_stream_factory()->set_quic_server_info_factory(
+ quic_server_info_factory_.get());
+ }
+}
+
void HttpCache::ProcessPendingQueue(ActiveEntry* entry) {
// Multiple readers may finish with an entry at once, so we want to batch up
// calls to OnProcessPendingQueue. This flag also tells us that we should
« no previous file with comments | « net/http/http_cache.h ('k') | net/quic/quic_stream_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698