summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/sandboxed_file_system_context.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/fileapi/sandboxed_file_system_context.cc')
-rw-r--r--webkit/fileapi/sandboxed_file_system_context.cc22
1 files changed, 18 insertions, 4 deletions
diff --git a/webkit/fileapi/sandboxed_file_system_context.cc b/webkit/fileapi/sandboxed_file_system_context.cc
index b71f57c..b3b009e 100644
--- a/webkit/fileapi/sandboxed_file_system_context.cc
+++ b/webkit/fileapi/sandboxed_file_system_context.cc
@@ -4,7 +4,7 @@
#include "webkit/fileapi/sandboxed_file_system_context.h"
-#include "base/file_path.h"
+#include "base/file_util.h"
#include "base/message_loop_proxy.h"
#include "webkit/fileapi/file_system_path_manager.h"
#include "webkit/fileapi/file_system_quota_manager.h"
@@ -17,10 +17,11 @@ SandboxedFileSystemContext::SandboxedFileSystemContext(
bool is_incognito,
bool allow_file_access,
bool unlimited_quota)
- : path_manager_(new FileSystemPathManager(
+ : file_message_loop_(file_message_loop),
+ path_manager_(new FileSystemPathManager(
file_message_loop, profile_path, is_incognito, allow_file_access)),
- quota_manager_(new FileSystemQuotaManager(allow_file_access,
- unlimited_quota)) {
+ quota_manager_(new FileSystemQuotaManager(
+ allow_file_access, unlimited_quota)) {
}
SandboxedFileSystemContext::~SandboxedFileSystemContext() {
@@ -31,4 +32,17 @@ void SandboxedFileSystemContext::Shutdown() {
quota_manager_.reset();
}
+void SandboxedFileSystemContext::DeleteDataForOriginOnFileThread(
+ const GURL& origin_url) {
+ DCHECK(path_manager_.get());
+ DCHECK(file_message_loop_->BelongsToCurrentThread());
+
+ std::string storage_identifier =
+ FileSystemPathManager::GetStorageIdentifierFromURL(origin_url);
+ FilePath path_for_origin = path_manager_->base_path().AppendASCII(
+ storage_identifier);
+
+ file_util::Delete(path_for_origin, true /* recursive */);
+}
+
} // namespace fileapi