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

Unified Diff: net/http/http_network_layer.cc

Issue 182993003: Add the ability for DevTools to wrap network transactions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« net/http/http_network_layer.h ('K') | « net/http/http_network_layer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_layer.cc
diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc
index 0704de420de32d29349e8e6d50f311387a362db3..dc49691514d4e360723b8d19a87724621fa74188 100644
--- a/net/http/http_network_layer.cc
+++ b/net/http/http_network_layer.cc
@@ -19,6 +19,8 @@
namespace net {
+HttpNetworkLayer::TransactionFactory* g_network_transaction_factory_ = NULL;
+
//-----------------------------------------------------------------------------
HttpNetworkLayer::HttpNetworkLayer(HttpNetworkSession* session)
: session_(session),
@@ -57,6 +59,12 @@ void HttpNetworkLayer::ForceAlternateProtocol() {
HttpServerPropertiesImpl::ForceAlternateProtocol(pair);
}
+// static
+void HttpNetworkLayer::SetTransactionFactory(
+ HttpNetworkLayer::TransactionFactory* factory) {
+ g_network_transaction_factory_ = factory;
+}
+
//-----------------------------------------------------------------------------
int HttpNetworkLayer::CreateTransaction(RequestPriority priority,
@@ -64,6 +72,10 @@ int HttpNetworkLayer::CreateTransaction(RequestPriority priority,
if (suspended_)
return ERR_NETWORK_IO_SUSPENDED;
+ if (g_network_transaction_factory_)
+ return g_network_transaction_factory_->CreateTransaction(
+ priority, GetSession(), trans);
+
trans->reset(new HttpNetworkTransaction(priority, GetSession()));
return OK;
}
« net/http/http_network_layer.h ('K') | « net/http/http_network_layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698