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_context.h" | 5 #include "webkit/fileapi/file_system_context.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
10 #include "webkit/fileapi/file_system_path_manager.h" | 10 #include "webkit/fileapi/file_system_path_manager.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 DCHECK(file_message_loop_->BelongsToCurrentThread()); | 85 DCHECK(file_message_loop_->BelongsToCurrentThread()); |
86 if (type == fileapi::kFileSystemTypeTemporary || | 86 if (type == fileapi::kFileSystemTypeTemporary || |
87 type == fileapi::kFileSystemTypePersistent) { | 87 type == fileapi::kFileSystemTypePersistent) { |
88 DCHECK(sandbox_provider()); | 88 DCHECK(sandbox_provider()); |
89 return sandbox_provider()->DeleteOriginDataOnFileThread( | 89 return sandbox_provider()->DeleteOriginDataOnFileThread( |
90 quota_manager_proxy(), origin_url, type); | 90 quota_manager_proxy(), origin_url, type); |
91 } | 91 } |
92 return false; | 92 return false; |
93 } | 93 } |
94 | 94 |
| 95 void FileSystemContext::RecalculateUsage( |
| 96 const GURL& origin_url, FileSystemType type) { |
| 97 DCHECK(sandbox_provider()); |
| 98 sandbox_provider()->ScheduleRecalculateUsage(origin_url, type); |
| 99 } |
| 100 |
95 FileSystemQuotaUtil* | 101 FileSystemQuotaUtil* |
96 FileSystemContext::GetQuotaUtil(FileSystemType type) const { | 102 FileSystemContext::GetQuotaUtil(FileSystemType type) const { |
97 if (type == fileapi::kFileSystemTypeTemporary || | 103 if (type == fileapi::kFileSystemTypeTemporary || |
98 type == fileapi::kFileSystemTypePersistent) { | 104 type == fileapi::kFileSystemTypePersistent) { |
99 DCHECK(sandbox_provider()); | 105 DCHECK(sandbox_provider()); |
100 return sandbox_provider()->quota_util(); | 106 return sandbox_provider()->quota_util(); |
101 } | 107 } |
102 return NULL; | 108 return NULL; |
103 } | 109 } |
104 | 110 |
105 void FileSystemContext::DeleteOnCorrectThread() const { | 111 void FileSystemContext::DeleteOnCorrectThread() const { |
106 if (!io_message_loop_->BelongsToCurrentThread()) { | 112 if (!io_message_loop_->BelongsToCurrentThread()) { |
107 io_message_loop_->DeleteSoon(FROM_HERE, this); | 113 io_message_loop_->DeleteSoon(FROM_HERE, this); |
108 return; | 114 return; |
109 } | 115 } |
110 delete this; | 116 delete this; |
111 } | 117 } |
112 | 118 |
113 SandboxMountPointProvider* FileSystemContext::sandbox_provider() const { | 119 SandboxMountPointProvider* FileSystemContext::sandbox_provider() const { |
114 return path_manager_->sandbox_provider(); | 120 return path_manager_->sandbox_provider(); |
115 } | 121 } |
116 | 122 |
117 } // namespace fileapi | 123 } // namespace fileapi |
OLD | NEW |