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

Unified Diff: webkit/fileapi/local_file_system_operation.cc

Issue 14341004: FileAPI code should not rely on or assume specific MountPointProvider types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « webkit/fileapi/local_file_system_operation.h ('k') | webkit/fileapi/media/device_media_async_file_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/local_file_system_operation.cc
diff --git a/webkit/fileapi/local_file_system_operation.cc b/webkit/fileapi/local_file_system_operation.cc
index 1d7de18603f4fcecfa360a653600dda7d5e03dbf..1bd0e521ad7e0d225328cfff44e74122a8cbaa1d 100644
--- a/webkit/fileapi/local_file_system_operation.cc
+++ b/webkit/fileapi/local_file_system_operation.cc
@@ -32,7 +32,23 @@ using webkit_blob::ShareableFileReference;
namespace fileapi {
+LocalFileSystemOperation::LocalFileSystemOperation(
+ FileSystemContext* file_system_context,
+ scoped_ptr<FileSystemOperationContext> operation_context)
+ : file_system_context_(file_system_context),
+ operation_context_(operation_context.Pass()),
+ async_file_util_(NULL),
+ peer_handle_(base::kNullProcessHandle),
+ pending_operation_(kOperationNone),
+ weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
+ DCHECK(operation_context_.get());
+ operation_context_->DetachUserDataThread();
+}
+
LocalFileSystemOperation::~LocalFileSystemOperation() {
+ if (!operation_context())
+ return;
+ operation_context()->DetachUserDataThread();
if (write_target_url_.is_valid()) {
operation_context()->update_observers()->Notify(
&FileUpdateObserver::OnEndUpdate, MakeTuple(write_target_url_));
@@ -430,7 +446,7 @@ LocalFileSystemOperation* LocalFileSystemOperation::CreateNestedOperation() {
LocalFileSystemOperation* operation = new LocalFileSystemOperation(
file_system_context(),
make_scoped_ptr(new FileSystemOperationContext(file_system_context())));
- operation->parent_operation_ = this;
+ operation->parent_operation_ = weak_factory_.GetWeakPtr();
return operation;
}
@@ -535,19 +551,6 @@ void LocalFileSystemOperation::MoveFileLocal(
base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED));
}
-LocalFileSystemOperation::LocalFileSystemOperation(
- FileSystemContext* file_system_context,
- scoped_ptr<FileSystemOperationContext> operation_context)
- : file_system_context_(file_system_context),
- operation_context_(operation_context.Pass()),
- async_file_util_(NULL),
- parent_operation_(NULL),
- peer_handle_(base::kNullProcessHandle),
- pending_operation_(kOperationNone),
- weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
- DCHECK(operation_context_.get());
-}
-
void LocalFileSystemOperation::GetUsageAndQuotaThenRunTask(
const FileSystemURL& url,
const base::Closure& task,
« no previous file with comments | « webkit/fileapi/local_file_system_operation.h ('k') | webkit/fileapi/media/device_media_async_file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698