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 void FileSystemContext::DeleteDataForOriginOnFileThread( | 73 void FileSystemContext::DeleteDataForOriginOnFileThread( |
74 const GURL& origin_url) { | 74 const GURL& origin_url) { |
75 DCHECK(path_manager_.get()); | 75 DCHECK(path_manager_.get()); |
76 DCHECK(file_message_loop_->BelongsToCurrentThread()); | 76 DCHECK(file_message_loop_->BelongsToCurrentThread()); |
77 | 77 |
78 FilePath path_for_origin = | 78 FilePath path_for_origin = |
79 sandbox_provider()->GetBaseDirectoryForOrigin(origin_url); | 79 sandbox_provider()->GetBaseDirectoryForOrigin(origin_url); |
80 file_util::Delete(path_for_origin, true /* recursive */); | 80 file_util::Delete(path_for_origin, true /* recursive */); |
81 } | 81 } |
82 | 82 |
83 | |
84 void FileSystemContext::DeleteDataForOriginAndTypeOnFileThread( | |
85 const GURL& origin_url, FileSystemType type) { | |
86 DCHECK(path_manager_.get()); | |
kinuko
2011/05/11 09:45:56
This doesn't seem to be necessary. (Ditto in the
tzik (google)
2011/05/11 11:32:25
Done.
| |
87 DCHECK(file_message_loop_->BelongsToCurrentThread()); | |
88 | |
89 FilePath path_for_origin = | |
90 sandbox_provider()->GetBaseDirectoryForOriginAndType(origin_url, type); | |
91 file_util::Delete(path_for_origin, true /* recursive */); | |
Dai Mikurube (NOT FULLTIME)
2011/05/11 09:14:57
Is the .usage file updated? (Updating may not be
kinuko
2011/05/11 09:38:15
Sorry I hadn't read this review comment (and wasn'
| |
92 } | |
93 | |
83 void FileSystemContext::DeleteOnCorrectThread() const { | 94 void FileSystemContext::DeleteOnCorrectThread() const { |
84 if (!io_message_loop_->BelongsToCurrentThread()) { | 95 if (!io_message_loop_->BelongsToCurrentThread()) { |
85 io_message_loop_->DeleteSoon(FROM_HERE, this); | 96 io_message_loop_->DeleteSoon(FROM_HERE, this); |
86 return; | 97 return; |
87 } | 98 } |
88 delete this; | 99 delete this; |
89 } | 100 } |
90 | 101 |
91 SandboxMountPointProvider* FileSystemContext::sandbox_provider() const { | 102 SandboxMountPointProvider* FileSystemContext::sandbox_provider() const { |
92 return path_manager_->sandbox_provider(); | 103 return path_manager_->sandbox_provider(); |
93 } | 104 } |
94 | 105 |
95 } // namespace fileapi | 106 } // namespace fileapi |
OLD | NEW |