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_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" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 base::PlatformFileError FileSystemTestOriginHelper::SameFileUtilMove( | 153 base::PlatformFileError FileSystemTestOriginHelper::SameFileUtilMove( |
154 FileSystemOperationContext* context, | 154 FileSystemOperationContext* context, |
155 const FileSystemPath& src, | 155 const FileSystemPath& src, |
156 const FileSystemPath& dest) const { | 156 const FileSystemPath& dest) const { |
157 return FileUtilHelper::Move(context, file_util(), file_util(), src, dest); | 157 return FileUtilHelper::Move(context, file_util(), file_util(), src, dest); |
158 } | 158 } |
159 | 159 |
160 int64 FileSystemTestOriginHelper::GetCachedOriginUsage() const { | 160 int64 FileSystemTestOriginHelper::GetCachedOriginUsage() const { |
161 return file_system_context_->GetQuotaUtil(type_)->GetOriginUsageOnFileThread( | 161 return file_system_context_->GetQuotaUtil(type_)->GetOriginUsageOnFileThread( |
162 origin_, type_); | 162 file_system_context_, origin_, type_); |
163 } | 163 } |
164 | 164 |
165 int64 FileSystemTestOriginHelper::ComputeCurrentOriginUsage() const { | 165 int64 FileSystemTestOriginHelper::ComputeCurrentOriginUsage() const { |
166 int64 size = file_util::ComputeDirectorySize(GetOriginRootPath()); | 166 int64 size = file_util::ComputeDirectorySize(GetOriginRootPath()); |
167 if (file_util::PathExists(GetUsageCachePath())) | 167 if (file_util::PathExists(GetUsageCachePath())) |
168 size -= FileSystemUsageCache::kUsageFileSize; | 168 size -= FileSystemUsageCache::kUsageFileSize; |
169 return size; | 169 return size; |
170 } | 170 } |
171 | 171 |
172 int64 FileSystemTestOriginHelper::ComputeCurrentDirectoryDatabaseUsage() const { | 172 int64 FileSystemTestOriginHelper::ComputeCurrentDirectoryDatabaseUsage() const { |
(...skipping 11 matching lines...) Expand all Loading... |
184 } | 184 } |
185 | 185 |
186 FileSystemOperationContext* FileSystemTestOriginHelper::NewOperationContext() { | 186 FileSystemOperationContext* FileSystemTestOriginHelper::NewOperationContext() { |
187 DCHECK(file_system_context_.get()); | 187 DCHECK(file_system_context_.get()); |
188 FileSystemOperationContext* context = | 188 FileSystemOperationContext* context = |
189 new FileSystemOperationContext(file_system_context_.get()); | 189 new FileSystemOperationContext(file_system_context_.get()); |
190 return context; | 190 return context; |
191 } | 191 } |
192 | 192 |
193 } // namespace fileapi | 193 } // namespace fileapi |
OLD | NEW |