Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Unified Diff: webkit/fileapi/isolated_context.cc

Issue 10532085: Retry: Make Isolated file system writable only if it is configured so (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/fileapi/isolated_context.h ('k') | webkit/fileapi/isolated_context_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « webkit/fileapi/isolated_context.h ('k') | webkit/fileapi/isolated_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698