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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 DCHECK(sandbox_provider()); | 73 DCHECK(sandbox_provider()); |
74 | 74 |
75 // Delete temporary and persistent data. | 75 // Delete temporary and persistent data. |
76 sandbox_provider()->DeleteOriginDataOnFileThread( | 76 sandbox_provider()->DeleteOriginDataOnFileThread( |
77 quota_manager_proxy(), origin_url, kFileSystemTypeTemporary); | 77 quota_manager_proxy(), origin_url, kFileSystemTypeTemporary); |
78 sandbox_provider()->DeleteOriginDataOnFileThread( | 78 sandbox_provider()->DeleteOriginDataOnFileThread( |
79 quota_manager_proxy(), origin_url, kFileSystemTypePersistent); | 79 quota_manager_proxy(), origin_url, kFileSystemTypePersistent); |
80 | 80 |
81 // Delete the upper level directory. | 81 // Delete the upper level directory. |
82 FilePath path_for_origin = | 82 FilePath path_for_origin = |
83 sandbox_provider()->GetBaseDirectoryForOrigin(origin_url); | 83 sandbox_provider()->GetBaseDirectoryForOrigin(origin_url, false); |
84 if (!file_util::PathExists(path_for_origin)) | 84 if (!file_util::PathExists(path_for_origin)) |
85 return true; | 85 return true; |
86 return file_util::Delete(path_for_origin, true /* recursive */); | 86 return file_util::Delete(path_for_origin, true /* recursive */); |
87 } | 87 } |
88 | 88 |
89 bool FileSystemContext::DeleteDataForOriginAndTypeOnFileThread( | 89 bool FileSystemContext::DeleteDataForOriginAndTypeOnFileThread( |
90 const GURL& origin_url, FileSystemType type) { | 90 const GURL& origin_url, FileSystemType type) { |
91 DCHECK(file_message_loop_->BelongsToCurrentThread()); | 91 DCHECK(file_message_loop_->BelongsToCurrentThread()); |
92 if (type == fileapi::kFileSystemTypeTemporary || | 92 if (type == fileapi::kFileSystemTypeTemporary || |
93 type == fileapi::kFileSystemTypePersistent) { | 93 type == fileapi::kFileSystemTypePersistent) { |
(...skipping 20 matching lines...) Expand all Loading... |
114 return; | 114 return; |
115 } | 115 } |
116 delete this; | 116 delete this; |
117 } | 117 } |
118 | 118 |
119 SandboxMountPointProvider* FileSystemContext::sandbox_provider() const { | 119 SandboxMountPointProvider* FileSystemContext::sandbox_provider() const { |
120 return path_manager_->sandbox_provider(); | 120 return path_manager_->sandbox_provider(); |
121 } | 121 } |
122 | 122 |
123 } // namespace fileapi | 123 } // namespace fileapi |
OLD | NEW |