| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/sandboxed_file_system_context.h" | 5 #include "webkit/fileapi/sandboxed_file_system_context.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
| 9 #include "webkit/fileapi/file_system_path_manager.h" | 9 #include "webkit/fileapi/file_system_path_manager.h" |
| 10 #include "webkit/fileapi/file_system_quota_manager.h" | 10 #include "webkit/fileapi/file_system_quota_manager.h" |
| 11 #include "webkit/fileapi/file_system_usage_tracker.h" |
| 11 | 12 |
| 12 namespace fileapi { | 13 namespace fileapi { |
| 13 | 14 |
| 14 SandboxedFileSystemContext::SandboxedFileSystemContext( | 15 SandboxedFileSystemContext::SandboxedFileSystemContext( |
| 15 scoped_refptr<base::MessageLoopProxy> file_message_loop, | 16 scoped_refptr<base::MessageLoopProxy> file_message_loop, |
| 16 scoped_refptr<base::MessageLoopProxy> io_message_loop, | 17 scoped_refptr<base::MessageLoopProxy> io_message_loop, |
| 17 const FilePath& profile_path, | 18 const FilePath& profile_path, |
| 18 bool is_incognito, | 19 bool is_incognito, |
| 19 bool allow_file_access, | 20 bool allow_file_access, |
| 20 bool unlimited_quota) | 21 bool unlimited_quota) |
| 21 : file_message_loop_(file_message_loop), | 22 : file_message_loop_(file_message_loop), |
| 22 io_message_loop_(io_message_loop), | 23 io_message_loop_(io_message_loop), |
| 23 path_manager_(new FileSystemPathManager( | 24 path_manager_(new FileSystemPathManager( |
| 24 file_message_loop, profile_path, is_incognito, allow_file_access)), | 25 file_message_loop, profile_path, is_incognito, allow_file_access)), |
| 25 quota_manager_(new FileSystemQuotaManager( | 26 quota_manager_(new FileSystemQuotaManager( |
| 26 allow_file_access, unlimited_quota)) { | 27 allow_file_access, unlimited_quota)), |
| 28 usage_tracker_(new FileSystemUsageTracker( |
| 29 file_message_loop, profile_path, is_incognito)) { |
| 27 } | 30 } |
| 28 | 31 |
| 29 SandboxedFileSystemContext::~SandboxedFileSystemContext() { | 32 SandboxedFileSystemContext::~SandboxedFileSystemContext() { |
| 30 } | 33 } |
| 31 | 34 |
| 32 void SandboxedFileSystemContext::Shutdown() { | 35 void SandboxedFileSystemContext::Shutdown() { |
| 33 DCHECK(io_message_loop_->BelongsToCurrentThread()); | 36 DCHECK(io_message_loop_->BelongsToCurrentThread()); |
| 34 path_manager_.reset(); | 37 path_manager_.reset(); |
| 35 quota_manager_.reset(); | 38 quota_manager_.reset(); |
| 36 } | 39 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 60 | 63 |
| 61 void SandboxedFileSystemContext::DeleteOnCorrectThread() const { | 64 void SandboxedFileSystemContext::DeleteOnCorrectThread() const { |
| 62 if (!io_message_loop_->BelongsToCurrentThread()) { | 65 if (!io_message_loop_->BelongsToCurrentThread()) { |
| 63 io_message_loop_->DeleteSoon(FROM_HERE, this); | 66 io_message_loop_->DeleteSoon(FROM_HERE, this); |
| 64 return; | 67 return; |
| 65 } | 68 } |
| 66 delete this; | 69 delete this; |
| 67 } | 70 } |
| 68 | 71 |
| 69 } // namespace fileapi | 72 } // namespace fileapi |
| OLD | NEW |