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

Unified Diff: net/base/file_stream_posix.cc

Issue 149182: Merge r17560.... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/branches/172/src/
Patch Set: Created 11 years, 6 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 | « no previous file | net/base/file_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/file_stream_posix.cc
===================================================================
--- net/base/file_stream_posix.cc (revision 19709)
+++ net/base/file_stream_posix.cc (working copy)
@@ -209,6 +209,8 @@
int result_;
CancelableCallbackTask* message_loop_task_;
+ bool is_closing_;
+
DISALLOW_COPY_AND_ASSIGN(AsyncContext);
};
@@ -218,9 +220,11 @@
background_io_completed_callback_(
this, &AsyncContext::OnBackgroundIOCompleted),
background_io_completed_(true, false),
- message_loop_task_(NULL) {}
+ message_loop_task_(NULL),
+ is_closing_(false) {}
FileStream::AsyncContext::~AsyncContext() {
+ is_closing_ = true;
if (callback_) {
// If |callback_| is non-NULL, that implies either the worker thread is
// still running the IO task, or the completion callback is queued up on the
@@ -280,6 +284,11 @@
message_loop_task_->Cancel();
message_loop_task_ = NULL;
+ if (is_closing_) {
+ callback_ = NULL;
+ return;
+ }
+
DCHECK(callback_);
CompletionCallback* temp = NULL;
std::swap(temp, callback_);
Property changes on: net\base\file_stream_posix.cc
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk/src/net/base/file_stream_posix.cc:r14162,15308,16015,16808,17560
« no previous file with comments | « no previous file | net/base/file_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698