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

Unified Diff: net/http/http_cache_transaction.cc

Issue 122453002: Allows deferral of a URLRequest just before talking to the network, at (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Potential fix of a memory leak due to a reference cycle. Created 6 years, 11 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_transaction.cc
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 68ea7883504fc45070aabdceb059fdbb134ec117..c6d4033202f79fcf1fb4b99be90c0018eca0d7f9 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -544,6 +544,18 @@ void HttpCache::Transaction::SetWebSocketHandshakeStreamCreateHelper(
network_trans_->SetWebSocketHandshakeStreamCreateHelper(create_helper);
}
+void HttpCache::Transaction::SetBeforeNetworkStartCallback(
+ const BeforeNetworkStartCallback& callback) {
+ DCHECK(!network_trans_);
+ before_network_start_callback_ = callback;
+}
+
+int HttpCache::Transaction::ResumeNetworkStart() {
+ if (network_trans_)
+ return network_trans_->ResumeNetworkStart();
+ return ERR_UNEXPECTED;
+}
+
//-----------------------------------------------------------------------------
void HttpCache::Transaction::DoCallback(int rv) {
@@ -865,6 +877,7 @@ int HttpCache::Transaction::DoSendRequest() {
&network_trans_);
if (rv != OK)
return rv;
+ network_trans_->SetBeforeNetworkStartCallback(before_network_start_callback_);
// Old load timing information, if any, is now obsolete.
old_network_trans_load_timing_.reset();

Powered by Google App Engine
This is Rietveld 408576698