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

Unified Diff: net/url_request/url_request_http_job.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: Updated content-length in test to actual length 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
« no previous file with comments | « net/url_request/url_request_http_job.h ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_http_job.cc
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index c0e2dd1e14027ee06e4bdfaaf332b414a0283534..e77a03b1c5347986c7e1189ae8ca12316617c3be 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -414,6 +414,9 @@ void URLRequestHttpJob::StartTransactionInternal() {
rv = request_->context()->http_transaction_factory()->CreateTransaction(
priority_, &transaction_);
+ transaction_->SetBeforeNetworkStartCallback(base::Bind(
+ &URLRequestHttpJob::NotifyBeforeNetworkStart, base::Unretained(this)));
+
if (rv == OK && request_info_.url.SchemeIsWSOrWSS()) {
// TODO(ricea): Implement WebSocket throttling semantics as defined in
// RFC6455 Section 4.1.
@@ -1167,6 +1170,11 @@ void URLRequestHttpJob::ContinueDespiteLastError() {
weak_factory_.GetWeakPtr(), rv));
}
+void URLRequestHttpJob::ResumeNetworkStart() {
+ DCHECK(transaction_.get());
+ transaction_->ResumeNetworkStart();
+}
+
bool URLRequestHttpJob::ShouldFixMismatchedContentLength(int rv) const {
// Some servers send the body compressed, but specify the content length as
// the uncompressed size. Although this violates the HTTP spec we want to
« no previous file with comments | « net/url_request/url_request_http_job.h ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698