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_context.h" | 5 #include "webkit/fileapi/file_system_context.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } | 71 } |
72 | 72 |
73 bool FileSystemContext::DeleteDataForOriginOnFileThread( | 73 bool FileSystemContext::DeleteDataForOriginOnFileThread( |
74 const GURL& origin_url) { | 74 const GURL& origin_url) { |
75 DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); | 75 DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); |
76 DCHECK(sandbox_provider()); | 76 DCHECK(sandbox_provider()); |
77 | 77 |
78 // Delete temporary and persistent data. | 78 // Delete temporary and persistent data. |
79 return | 79 return |
80 sandbox_provider()->DeleteOriginDataOnFileThread( | 80 sandbox_provider()->DeleteOriginDataOnFileThread( |
81 this, quota_manager_proxy(), origin_url, kFileSystemTypeTemporary) && | 81 quota_manager_proxy(), origin_url, kFileSystemTypeTemporary) && |
82 sandbox_provider()->DeleteOriginDataOnFileThread( | 82 sandbox_provider()->DeleteOriginDataOnFileThread( |
83 this, quota_manager_proxy(), origin_url, kFileSystemTypePersistent); | 83 quota_manager_proxy(), origin_url, kFileSystemTypePersistent); |
84 } | 84 } |
85 | 85 |
86 bool FileSystemContext::DeleteDataForOriginAndTypeOnFileThread( | 86 bool FileSystemContext::DeleteDataForOriginAndTypeOnFileThread( |
87 const GURL& origin_url, FileSystemType type) { | 87 const GURL& origin_url, FileSystemType type) { |
88 DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); | 88 DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); |
89 if (type == fileapi::kFileSystemTypeTemporary || | 89 if (type == fileapi::kFileSystemTypeTemporary || |
90 type == fileapi::kFileSystemTypePersistent) { | 90 type == fileapi::kFileSystemTypePersistent) { |
91 DCHECK(sandbox_provider()); | 91 DCHECK(sandbox_provider()); |
92 return sandbox_provider()->DeleteOriginDataOnFileThread( | 92 return sandbox_provider()->DeleteOriginDataOnFileThread( |
93 this, quota_manager_proxy(), origin_url, type); | 93 quota_manager_proxy(), origin_url, type); |
94 } | 94 } |
95 return false; | 95 return false; |
96 } | 96 } |
97 | 97 |
98 FileSystemQuotaUtil* | 98 FileSystemQuotaUtil* |
99 FileSystemContext::GetQuotaUtil(FileSystemType type) const { | 99 FileSystemContext::GetQuotaUtil(FileSystemType type) const { |
100 FileSystemMountPointProvider* mount_point_provider = | 100 FileSystemMountPointProvider* mount_point_provider = |
101 GetMountPointProvider(type); | 101 GetMountPointProvider(type); |
102 if (!mount_point_provider) | 102 if (!mount_point_provider) |
103 return NULL; | 103 return NULL; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 if (!io_task_runner_->RunsTasksOnCurrentThread() && | 209 if (!io_task_runner_->RunsTasksOnCurrentThread() && |
210 io_task_runner_->DeleteSoon(FROM_HERE, this)) { | 210 io_task_runner_->DeleteSoon(FROM_HERE, this)) { |
211 return; | 211 return; |
212 } | 212 } |
213 STLDeleteContainerPairSecondPointers(provider_map_.begin(), | 213 STLDeleteContainerPairSecondPointers(provider_map_.begin(), |
214 provider_map_.end()); | 214 provider_map_.end()); |
215 delete this; | 215 delete this; |
216 } | 216 } |
217 | 217 |
218 } // namespace fileapi | 218 } // namespace fileapi |
OLD | NEW |