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

Unified Diff: net/url_request/url_request_job.cc

Issue 67019: URLRequest::Interceptor enhancements... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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_job.h ('k') | net/url_request/url_request_job_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_job.cc
===================================================================
--- net/url_request/url_request_job.cc (revision 13871)
+++ net/url_request/url_request_job.cc (working copy)
@@ -337,9 +337,9 @@
// Toggle this flag to true so the consumer can access response headers.
// Then toggle it back if we choose to follow the redirect.
has_handled_response_ = true;
- request_->delegate()->OnReceivedRedirect(request_, new_location);
+ request_->ReceivedRedirect(new_location);
- // Ensure that the request wasn't destroyed in OnReceivedRedirect
+ // Ensure that the request wasn't detached or destroyed in ReceivedRedirect
if (!request_ || !request_->delegate())
return;
@@ -372,7 +372,7 @@
expected_content_size_ = StringToInt64(content_length);
}
- request_->delegate()->OnResponseStarted(request_);
+ request_->ResponseStarted();
}
void URLRequestJob::NotifyStartError(const URLRequestStatus &status) {
@@ -380,8 +380,7 @@
has_handled_response_ = true;
if (request_) {
request_->set_status(status);
- if (request_->delegate())
- request_->delegate()->OnResponseStarted(request_);
+ request_->ResponseStarted();
}
}
@@ -482,7 +481,7 @@
request_->delegate()->OnReadCompleted(request_, -1);
} else {
has_handled_response_ = true;
- request_->delegate()->OnResponseStarted(request_);
+ request_->ResponseStarted();
}
}
}
@@ -494,6 +493,12 @@
}
}
+void URLRequestJob::NotifyRestartRequired() {
+ DCHECK(!has_handled_response_);
+ if (GetStatus().status() != URLRequestStatus::CANCELED)
+ request_->Restart();
+}
+
bool URLRequestJob::FilterHasData() {
return filter_.get() && filter_->stream_data_len();
}
« no previous file with comments | « net/url_request/url_request_job.h ('k') | net/url_request/url_request_job_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698