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

Unified Diff: storage/browser/fileapi/file_writer_delegate.cc

Issue 1523433002: Remove support for a URLRequest having a NULL Delegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix iOS Created 5 years 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/url_request/url_request.h ('K') | « net/url_request/url_request_job.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/fileapi/file_writer_delegate.cc
diff --git a/storage/browser/fileapi/file_writer_delegate.cc b/storage/browser/fileapi/file_writer_delegate.cc
index ab264d3b517fc1919a362e6750557c3b52dde6ec..469a7023f7e1dcc02b293ccec796d6e49be4cd1a 100644
--- a/storage/browser/fileapi/file_writer_delegate.cc
+++ b/storage/browser/fileapi/file_writer_delegate.cc
@@ -45,9 +45,8 @@ void FileWriterDelegate::Start(scoped_ptr<net::URLRequest> request,
void FileWriterDelegate::Cancel() {
if (request_) {
- // This halts any callbacks on this delegate.
- request_->set_delegate(NULL);
- request_->Cancel();
+ // Destroy the request to prevent it from invoking any callbacks.
+ request_.reset();
}
const int status = file_stream_writer_->Cancel(
@@ -173,8 +172,8 @@ FileWriterDelegate::GetCompletionStatusOnError() const {
void FileWriterDelegate::OnError(base::File::Error error) {
if (request_) {
- request_->set_delegate(NULL);
- request_->Cancel();
+ // Destroy the request to prevent it from invoking any callbacks.
+ request_.reset();
}
if (writing_started_)
« net/url_request/url_request.h ('K') | « net/url_request/url_request_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698