| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "storage/browser/fileapi/sandbox_file_system_backend_delegate.h" | 5 #include "storage/browser/fileapi/sandbox_file_system_backend_delegate.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 } | 386 } |
| 387 | 387 |
| 388 int64_t SandboxFileSystemBackendDelegate::GetOriginUsageOnFileTaskRunner( | 388 int64_t SandboxFileSystemBackendDelegate::GetOriginUsageOnFileTaskRunner( |
| 389 FileSystemContext* file_system_context, | 389 FileSystemContext* file_system_context, |
| 390 const GURL& origin_url, | 390 const GURL& origin_url, |
| 391 FileSystemType type) { | 391 FileSystemType type) { |
| 392 DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); | 392 DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); |
| 393 | 393 |
| 394 // Don't use usage cache and return recalculated usage for sticky invalidated | 394 // Don't use usage cache and return recalculated usage for sticky invalidated |
| 395 // origins. | 395 // origins. |
| 396 if (ContainsKey(sticky_dirty_origins_, std::make_pair(origin_url, type))) | 396 if (base::ContainsKey(sticky_dirty_origins_, |
| 397 std::make_pair(origin_url, type))) |
| 397 return RecalculateUsage(file_system_context, origin_url, type); | 398 return RecalculateUsage(file_system_context, origin_url, type); |
| 398 | 399 |
| 399 base::FilePath base_path = | 400 base::FilePath base_path = |
| 400 GetBaseDirectoryForOriginAndType(origin_url, type, false); | 401 GetBaseDirectoryForOriginAndType(origin_url, type, false); |
| 401 if (base_path.empty() || !base::DirectoryExists(base_path)) | 402 if (base_path.empty() || !base::DirectoryExists(base_path)) |
| 402 return 0; | 403 return 0; |
| 403 base::FilePath usage_file_path = | 404 base::FilePath usage_file_path = |
| 404 base_path.Append(FileSystemUsageCache::kUsageFileName); | 405 base_path.Append(FileSystemUsageCache::kUsageFileName); |
| 405 | 406 |
| 406 bool is_valid = usage_cache()->IsValid(usage_file_path); | 407 bool is_valid = usage_cache()->IsValid(usage_file_path); |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 return new ObfuscatedFileUtil(special_storage_policy, | 696 return new ObfuscatedFileUtil(special_storage_policy, |
| 696 file_system_directory, | 697 file_system_directory, |
| 697 env_override, | 698 env_override, |
| 698 file_task_runner, | 699 file_task_runner, |
| 699 base::Bind(&GetTypeStringForURL), | 700 base::Bind(&GetTypeStringForURL), |
| 700 GetKnownTypeStrings(), | 701 GetKnownTypeStrings(), |
| 701 NULL); | 702 NULL); |
| 702 } | 703 } |
| 703 | 704 |
| 704 } // namespace storage | 705 } // namespace storage |
| OLD | NEW |