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/browser/fileapi/obfuscated_file_util.h" | 5 #include "webkit/browser/fileapi/obfuscated_file_util.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 PlatformFileError ObfuscatedFileUtil::CreateOrOpen( | 262 PlatformFileError ObfuscatedFileUtil::CreateOrOpen( |
263 FileSystemOperationContext* context, | 263 FileSystemOperationContext* context, |
264 const FileSystemURL& url, int file_flags, | 264 const FileSystemURL& url, int file_flags, |
265 PlatformFile* file_handle, bool* created) { | 265 PlatformFile* file_handle, bool* created) { |
266 PlatformFileError error = CreateOrOpenInternal(context, url, file_flags, | 266 PlatformFileError error = CreateOrOpenInternal(context, url, file_flags, |
267 file_handle, created); | 267 file_handle, created); |
268 if (*file_handle != base::kInvalidPlatformFileValue && | 268 if (*file_handle != base::kInvalidPlatformFileValue && |
269 file_flags & base::PLATFORM_FILE_WRITE && | 269 file_flags & base::PLATFORM_FILE_WRITE && |
270 context->quota_limit_type() == quota::kQuotaLimitTypeUnlimited) { | 270 context->quota_limit_type() == quota::kQuotaLimitTypeUnlimited) { |
271 DCHECK_EQ(base::PLATFORM_FILE_OK, error); | 271 DCHECK_EQ(base::PLATFORM_FILE_OK, error); |
272 DCHECK_EQ(kFileSystemTypePersistent, url.type()); | |
273 context->file_system_context()->GetQuotaUtil(url.type())-> | 272 context->file_system_context()->GetQuotaUtil(url.type())-> |
274 StickyInvalidateUsageCache(url.origin(), url.type()); | 273 StickyInvalidateUsageCache(url.origin(), url.type()); |
275 } | 274 } |
276 return error; | 275 return error; |
277 } | 276 } |
278 | 277 |
279 PlatformFileError ObfuscatedFileUtil::Close( | 278 PlatformFileError ObfuscatedFileUtil::Close( |
280 FileSystemOperationContext* context, | 279 FileSystemOperationContext* context, |
281 base::PlatformFile file) { | 280 base::PlatformFile file) { |
282 return NativeFileUtil::Close(file); | 281 return NativeFileUtil::Close(file); |
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 // If truncating we need to update the usage. | 1355 // If truncating we need to update the usage. |
1357 if (error == base::PLATFORM_FILE_OK && delta) { | 1356 if (error == base::PLATFORM_FILE_OK && delta) { |
1358 UpdateUsage(context, url, delta); | 1357 UpdateUsage(context, url, delta); |
1359 context->change_observers()->Notify( | 1358 context->change_observers()->Notify( |
1360 &FileChangeObserver::OnModifyFile, MakeTuple(url)); | 1359 &FileChangeObserver::OnModifyFile, MakeTuple(url)); |
1361 } | 1360 } |
1362 return error; | 1361 return error; |
1363 } | 1362 } |
1364 | 1363 |
1365 } // namespace fileapi | 1364 } // namespace fileapi |
OLD | NEW |