Index: webkit/fileapi/isolated_context.cc |
diff --git a/webkit/fileapi/isolated_context.cc b/webkit/fileapi/isolated_context.cc |
index cc9e925585b2dc26c3543bc026f19e448954c0b2..e8b52ae83f0ae9bc77904e2934878aac00714bde 100644 |
--- a/webkit/fileapi/isolated_context.cc |
+++ b/webkit/fileapi/isolated_context.cc |
@@ -51,6 +51,7 @@ void IsolatedContext::RevokeIsolatedFileSystem( |
const std::string& filesystem_id) { |
base::AutoLock locker(lock_); |
toplevel_map_.erase(filesystem_id); |
+ writable_ids_.erase(filesystem_id); |
} |
bool IsolatedContext::CrackIsolatedPath(const FilePath& virtual_path, |
@@ -97,7 +98,7 @@ bool IsolatedContext::CrackIsolatedPath(const FilePath& virtual_path, |
return true; |
} |
-bool IsolatedContext::GetTopLevelPaths(std::string filesystem_id, |
+bool IsolatedContext::GetTopLevelPaths(const std::string& filesystem_id, |
std::vector<FilePath>* paths) const { |
DCHECK(paths); |
base::AutoLock locker(lock_); |
@@ -114,6 +115,23 @@ bool IsolatedContext::GetTopLevelPaths(std::string filesystem_id, |
return true; |
} |
+bool IsolatedContext::SetWritable(const std::string& filesystem_id, |
+ bool writable) { |
+ base::AutoLock locker(lock_); |
+ if (toplevel_map_.find(filesystem_id) == toplevel_map_.end()) |
+ return false; |
+ if (writable) |
+ writable_ids_.insert(filesystem_id); |
+ else |
+ writable_ids_.erase(filesystem_id); |
+ return true; |
+} |
+ |
+bool IsolatedContext::IsWritable(const std::string& filesystem_id) const { |
+ base::AutoLock locker(lock_); |
+ return (writable_ids_.find(filesystem_id) != writable_ids_.end()); |
+} |
+ |
FilePath IsolatedContext::CreateVirtualPath( |
const std::string& filesystem_id, const FilePath& relative_path) const { |
FilePath full_path; |