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/file_writer_delegate.h" | 5 #include "webkit/fileapi/file_writer_delegate.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/file_util_proxy.h" | 9 #include "base/file_util_proxy.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 bool Start(scoped_refptr<base::MessageLoopProxy> message_loop_proxy, | 46 bool Start(scoped_refptr<base::MessageLoopProxy> message_loop_proxy, |
47 const tracked_objects::Location& from_here) { | 47 const tracked_objects::Location& from_here) { |
48 return message_loop_proxy->PostTask( | 48 return message_loop_proxy->PostTask( |
49 from_here, | 49 from_here, |
50 base::Bind(&InitializeTask::ProcessOnTargetThread, this)); | 50 base::Bind(&InitializeTask::ProcessOnTargetThread, this)); |
51 } | 51 } |
52 | 52 |
53 private: | 53 private: |
54 friend class base::RefCountedThreadSafe<InitializeTask>; | 54 friend class base::RefCountedThreadSafe<InitializeTask>; |
| 55 ~InitializeTask() {} |
55 | 56 |
56 void RunCallback() { | 57 void RunCallback() { |
57 callback_.Run(error_code_, file_info_); | 58 callback_.Run(error_code_, file_info_); |
58 } | 59 } |
59 | 60 |
60 void ProcessOnTargetThread() { | 61 void ProcessOnTargetThread() { |
61 DCHECK(context_.file_system_context()); | 62 DCHECK(context_.file_system_context()); |
62 FileSystemQuotaUtil* quota_util = context_.file_system_context()-> | 63 FileSystemQuotaUtil* quota_util = context_.file_system_context()-> |
63 GetQuotaUtil(path_.type()); | 64 GetQuotaUtil(path_.type()); |
64 if (quota_util) { | 65 if (quota_util) { |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 320 |
320 FileSystemQuotaUtil* FileWriterDelegate::quota_util() const { | 321 FileSystemQuotaUtil* FileWriterDelegate::quota_util() const { |
321 DCHECK(file_system_operation_); | 322 DCHECK(file_system_operation_); |
322 DCHECK(file_system_operation_->file_system_context()); | 323 DCHECK(file_system_operation_->file_system_context()); |
323 DCHECK(file_system_operation_->file_system_operation_context()); | 324 DCHECK(file_system_operation_->file_system_operation_context()); |
324 return file_system_operation_->file_system_context()->GetQuotaUtil( | 325 return file_system_operation_->file_system_context()->GetQuotaUtil( |
325 path_.type()); | 326 path_.type()); |
326 } | 327 } |
327 | 328 |
328 } // namespace fileapi | 329 } // namespace fileapi |
OLD | NEW |