| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_util_proxy.h" | 7 #include "base/file_util_proxy.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 const base::PlatformFileInfo& /* file_info */ | 25 const base::PlatformFileInfo& /* file_info */ |
| 26 >::Type InitializeTaskCallback; | 26 >::Type InitializeTaskCallback; |
| 27 | 27 |
| 28 class InitializeTask : public base::RefCountedThreadSafe<InitializeTask> { | 28 class InitializeTask : public base::RefCountedThreadSafe<InitializeTask> { |
| 29 public: | 29 public: |
| 30 InitializeTask( | 30 InitializeTask( |
| 31 base::PlatformFile file, | 31 base::PlatformFile file, |
| 32 FileSystemOperationContext* context, | 32 FileSystemOperationContext* context, |
| 33 InitializeTaskCallback* callback) | 33 InitializeTaskCallback* callback) |
| 34 : origin_message_loop_proxy_( | 34 : origin_message_loop_proxy_( |
| 35 base::MessageLoopProxy::CreateForCurrentThread()), | 35 base::MessageLoopProxy::current()), |
| 36 error_code_(base::PLATFORM_FILE_OK), | 36 error_code_(base::PLATFORM_FILE_OK), |
| 37 file_(file), | 37 file_(file), |
| 38 context_(*context), | 38 context_(*context), |
| 39 callback_(callback) { | 39 callback_(callback) { |
| 40 DCHECK(callback); | 40 DCHECK(callback); |
| 41 } | 41 } |
| 42 | 42 |
| 43 bool Start(scoped_refptr<base::MessageLoopProxy> message_loop_proxy, | 43 bool Start(scoped_refptr<base::MessageLoopProxy> message_loop_proxy, |
| 44 const tracked_objects::Location& from_here) { | 44 const tracked_objects::Location& from_here) { |
| 45 return message_loop_proxy->PostTask(from_here, NewRunnableMethod(this, | 45 return message_loop_proxy->PostTask(from_here, NewRunnableMethod(this, |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 320 |
| 321 FileSystemQuotaUtil* FileWriterDelegate::quota_util() const { | 321 FileSystemQuotaUtil* FileWriterDelegate::quota_util() const { |
| 322 DCHECK(file_system_operation_); | 322 DCHECK(file_system_operation_); |
| 323 DCHECK(file_system_operation_->file_system_context()); | 323 DCHECK(file_system_operation_->file_system_context()); |
| 324 DCHECK(file_system_operation_->file_system_operation_context()); | 324 DCHECK(file_system_operation_->file_system_operation_context()); |
| 325 return file_system_operation_->file_system_context()->GetQuotaUtil( | 325 return file_system_operation_->file_system_context()->GetQuotaUtil( |
| 326 file_system_operation_context()->src_type()); | 326 file_system_operation_context()->src_type()); |
| 327 } | 327 } |
| 328 | 328 |
| 329 } // namespace fileapi | 329 } // namespace fileapi |
| OLD | NEW |