| 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_system_test_helper.h" | 5 #include "webkit/fileapi/file_system_test_helper.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| 11 #include "webkit/fileapi/file_system_context.h" | 11 #include "webkit/fileapi/file_system_context.h" |
| 12 #include "webkit/fileapi/file_system_operation.h" | 12 #include "webkit/fileapi/file_system_operation.h" |
| 13 #include "webkit/fileapi/file_system_operation_context.h" | 13 #include "webkit/fileapi/file_system_operation_context.h" |
| 14 #include "webkit/fileapi/file_system_usage_cache.h" | 14 #include "webkit/fileapi/file_system_usage_cache.h" |
| 15 #include "webkit/fileapi/file_system_util.h" | 15 #include "webkit/fileapi/file_system_util.h" |
| 16 #include "webkit/fileapi/local_file_system_file_util.h" | |
| 17 #include "webkit/fileapi/quota_file_util.h" | |
| 18 #include "webkit/fileapi/sandbox_mount_point_provider.h" | 16 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
| 19 #include "webkit/quota/special_storage_policy.h" | 17 #include "webkit/quota/special_storage_policy.h" |
| 20 | 18 |
| 21 namespace fileapi { | 19 namespace fileapi { |
| 22 namespace { | 20 namespace { |
| 23 | 21 |
| 24 class TestSpecialStoragePolicy : public quota::SpecialStoragePolicy { | 22 class TestSpecialStoragePolicy : public quota::SpecialStoragePolicy { |
| 25 public: | 23 public: |
| 26 explicit TestSpecialStoragePolicy(bool unlimited_quota) | 24 explicit TestSpecialStoragePolicy(bool unlimited_quota) |
| 27 : unlimited_quota_(unlimited_quota) {} | 25 : unlimited_quota_(unlimited_quota) {} |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 ->sandbox_provider()->GetUsageCachePathForOriginAndType(origin_, type_); | 84 ->sandbox_provider()->GetUsageCachePathForOriginAndType(origin_, type_); |
| 87 FileSystemUsageCache::UpdateUsage(usage_cache_path, 0); | 85 FileSystemUsageCache::UpdateUsage(usage_cache_path, 0); |
| 88 } | 86 } |
| 89 | 87 |
| 90 void FileSystemTestOriginHelper::SetUp( | 88 void FileSystemTestOriginHelper::SetUp( |
| 91 const FilePath& base_dir, | 89 const FilePath& base_dir, |
| 92 bool incognito_mode, | 90 bool incognito_mode, |
| 93 bool unlimited_quota, | 91 bool unlimited_quota, |
| 94 quota::QuotaManagerProxy* quota_manager_proxy, | 92 quota::QuotaManagerProxy* quota_manager_proxy, |
| 95 FileSystemFileUtil* file_util) { | 93 FileSystemFileUtil* file_util) { |
| 96 file_util_ = file_util ? file_util : LocalFileSystemFileUtil::GetInstance(); | 94 file_util_ = file_util; |
| 97 DCHECK(file_util_); | 95 DCHECK(file_util_); |
| 98 file_system_context_ = new FileSystemContext( | 96 file_system_context_ = new FileSystemContext( |
| 99 base::MessageLoopProxy::CreateForCurrentThread(), | 97 base::MessageLoopProxy::CreateForCurrentThread(), |
| 100 base::MessageLoopProxy::CreateForCurrentThread(), | 98 base::MessageLoopProxy::CreateForCurrentThread(), |
| 101 new TestSpecialStoragePolicy(unlimited_quota), | 99 new TestSpecialStoragePolicy(unlimited_quota), |
| 102 quota_manager_proxy, | 100 quota_manager_proxy, |
| 103 base_dir, | 101 base_dir, |
| 104 incognito_mode, | 102 incognito_mode, |
| 105 true /* allow_file_access_from_files */, | 103 true /* allow_file_access_from_files */, |
| 106 unlimited_quota, | 104 unlimited_quota, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 void FileSystemTestOriginHelper::InitializeOperationContext( | 198 void FileSystemTestOriginHelper::InitializeOperationContext( |
| 201 FileSystemOperationContext* context) { | 199 FileSystemOperationContext* context) { |
| 202 DCHECK(context); | 200 DCHECK(context); |
| 203 context->set_src_origin_url(origin_); | 201 context->set_src_origin_url(origin_); |
| 204 context->set_src_type(type_); | 202 context->set_src_type(type_); |
| 205 context->set_dest_origin_url(origin_); | 203 context->set_dest_origin_url(origin_); |
| 206 context->set_dest_type(type_); | 204 context->set_dest_type(type_); |
| 207 } | 205 } |
| 208 | 206 |
| 209 } // namespace fileapi | 207 } // namespace fileapi |
| OLD | NEW |