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

Unified Diff: net/url_request/url_request_redirect_job.cc

Issue 1232113002: Prevent URLRequestRedirectJob from doing async execution (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Override Kill() Created 5 years, 5 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_redirect_job.h ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_redirect_job.cc
diff --git a/net/url_request/url_request_redirect_job.cc b/net/url_request/url_request_redirect_job.cc
index b127220552e2975126e72b366cba95f49d42d33b..1dfb56dc083cece2c6bc3b79289fa6b08f2cfd6b 100644
--- a/net/url_request/url_request_redirect_job.cc
+++ b/net/url_request/url_request_redirect_job.cc
@@ -65,6 +65,11 @@ void URLRequestRedirectJob::Start() {
weak_factory_.GetWeakPtr()));
}
+void URLRequestRedirectJob::Kill() {
+ weak_factory_.InvalidateWeakPtrs();
+ URLRequestJob::Kill();
+}
+
bool URLRequestRedirectJob::CopyFragmentOnRedirect(const GURL& location) const {
// The instantiators have full control over the desired redirection target,
// including the reference fragment part of the URL.
@@ -81,6 +86,9 @@ int URLRequestRedirectJob::GetResponseCode() const {
URLRequestRedirectJob::~URLRequestRedirectJob() {}
void URLRequestRedirectJob::StartAsync() {
+ DCHECK(request_);
+ DCHECK(request_->status().is_success());
+
receive_headers_end_ = base::TimeTicks::Now();
response_time_ = base::Time::Now();
« no previous file with comments | « net/url_request/url_request_redirect_job.h ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698