| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "webkit/fileapi/local_file_system_operation.h" | 5 #include "webkit/fileapi/local_file_system_operation.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 namespace fileapi { | 34 namespace fileapi { |
| 35 | 35 |
| 36 LocalFileSystemOperation::LocalFileSystemOperation( | 36 LocalFileSystemOperation::LocalFileSystemOperation( |
| 37 FileSystemContext* file_system_context, | 37 FileSystemContext* file_system_context, |
| 38 scoped_ptr<FileSystemOperationContext> operation_context) | 38 scoped_ptr<FileSystemOperationContext> operation_context) |
| 39 : file_system_context_(file_system_context), | 39 : file_system_context_(file_system_context), |
| 40 operation_context_(operation_context.Pass()), | 40 operation_context_(operation_context.Pass()), |
| 41 async_file_util_(NULL), | 41 async_file_util_(NULL), |
| 42 peer_handle_(base::kNullProcessHandle), | 42 peer_handle_(base::kNullProcessHandle), |
| 43 pending_operation_(kOperationNone), | 43 pending_operation_(kOperationNone), |
| 44 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 44 weak_factory_(this) { |
| 45 DCHECK(operation_context_.get()); | 45 DCHECK(operation_context_.get()); |
| 46 operation_context_->DetachUserDataThread(); | 46 operation_context_->DetachUserDataThread(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 LocalFileSystemOperation::~LocalFileSystemOperation() { | 49 LocalFileSystemOperation::~LocalFileSystemOperation() { |
| 50 if (!operation_context()) | 50 if (!operation_context()) |
| 51 return; | 51 return; |
| 52 operation_context()->DetachUserDataThread(); | 52 operation_context()->DetachUserDataThread(); |
| 53 if (write_target_url_.is_valid()) { | 53 if (write_target_url_.is_valid()) { |
| 54 operation_context()->update_observers()->Notify( | 54 operation_context()->update_observers()->Notify( |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 } | 868 } |
| 869 | 869 |
| 870 bool LocalFileSystemOperation::SetPendingOperationType(OperationType type) { | 870 bool LocalFileSystemOperation::SetPendingOperationType(OperationType type) { |
| 871 if (pending_operation_ != kOperationNone) | 871 if (pending_operation_ != kOperationNone) |
| 872 return false; | 872 return false; |
| 873 pending_operation_ = type; | 873 pending_operation_ = type; |
| 874 return true; | 874 return true; |
| 875 } | 875 } |
| 876 | 876 |
| 877 } // namespace fileapi | 877 } // namespace fileapi |
| OLD | NEW |