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/sandbox_mount_point_provider.h" | 5 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_callback_factory.h" | 9 #include "base/memory/scoped_callback_factory.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
613 | 613 |
614 void SandboxMountPointProvider::EndUpdateOriginOnFileThread( | 614 void SandboxMountPointProvider::EndUpdateOriginOnFileThread( |
615 const GURL& origin_url, fileapi::FileSystemType type) { | 615 const GURL& origin_url, fileapi::FileSystemType type) { |
616 DCHECK(type == fileapi::kFileSystemTypeTemporary || | 616 DCHECK(type == fileapi::kFileSystemTypeTemporary || |
617 type == fileapi::kFileSystemTypePersistent); | 617 type == fileapi::kFileSystemTypePersistent); |
618 FilePath usage_file_path = GetUsageCachePathForOriginAndType( | 618 FilePath usage_file_path = GetUsageCachePathForOriginAndType( |
619 origin_url, type); | 619 origin_url, type); |
620 FileSystemUsageCache::DecrementDirty(usage_file_path); | 620 FileSystemUsageCache::DecrementDirty(usage_file_path); |
621 } | 621 } |
622 | 622 |
623 void SandboxMountPointProvider::ScheduleRecalculateUsage( | |
624 const GURL& origin_url, fileapi::FileSystemType type) { | |
625 StartUpdateOriginOnFileThread(origin_url, type); | |
ericu
2011/08/17 00:54:08
This doesn't actually start an update--it just mar
tzik
2011/08/18 08:02:26
Actually, what I want to do in here is to incremen
ericu
2011/08/19 04:05:56
What about just deleting the usage cache file? Or
tzik
2011/08/23 04:13:13
If some write-operation are running, they breaks d
| |
626 } | |
627 | |
623 FileSystemFileUtil* SandboxMountPointProvider::GetFileSystemFileUtil() { | 628 FileSystemFileUtil* SandboxMountPointProvider::GetFileSystemFileUtil() { |
624 return sandbox_file_util_.get(); | 629 return sandbox_file_util_.get(); |
625 } | 630 } |
626 | 631 |
627 FilePath SandboxMountPointProvider::GetUsageCachePathForOriginAndType( | 632 FilePath SandboxMountPointProvider::GetUsageCachePathForOriginAndType( |
628 const GURL& origin_url, fileapi::FileSystemType type) const { | 633 const GURL& origin_url, fileapi::FileSystemType type) const { |
629 FilePath base_path = | 634 FilePath base_path = |
630 GetBaseDirectoryForOriginAndType(origin_url, type, false); | 635 GetBaseDirectoryForOriginAndType(origin_url, type, false); |
631 if (base_path.empty()) | 636 if (base_path.empty()) |
632 return FilePath(); | 637 return FilePath(); |
(...skipping 19 matching lines...) Expand all Loading... | |
652 | 657 |
653 // Creates the root directory. | 658 // Creates the root directory. |
654 root = origin_base_path.Append(OldCreateUniqueDirectoryName(origin_url)); | 659 root = origin_base_path.Append(OldCreateUniqueDirectoryName(origin_url)); |
655 if (!file_util::CreateDirectory(root)) | 660 if (!file_util::CreateDirectory(root)) |
656 return FilePath(); | 661 return FilePath(); |
657 | 662 |
658 return root; | 663 return root; |
659 } | 664 } |
660 | 665 |
661 } // namespace fileapi | 666 } // namespace fileapi |
OLD | NEW |