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

Unified Diff: webkit/fileapi/isolated_context.h

Issue 10540070: Make Isolated file system writable only if it is configured so (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added writer wiring for sandbox and test mpp 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/file_system_operation.cc ('k') | webkit/fileapi/isolated_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/isolated_context.h
diff --git a/webkit/fileapi/isolated_context.h b/webkit/fileapi/isolated_context.h
index 6024ab3f4cee9557877d92167ee53135311a58c3..fa6d0a9ef0011d81c969f509eb0e3b6778611f34 100644
--- a/webkit/fileapi/isolated_context.h
+++ b/webkit/fileapi/isolated_context.h
@@ -77,13 +77,20 @@ class FILEAPI_EXPORT IsolatedContext {
// Returns a vector of the full paths of the top-level entry paths
// registered for the |filesystem_id|. Returns false if the
// |filesystem_is| is not valid.
- bool GetTopLevelPaths(std::string filesystem_id,
+ bool GetTopLevelPaths(const std::string& filesystem_id,
std::vector<FilePath>* paths) const;
// Returns the virtual path that looks like /<filesystem_id>/<relative_path>.
FilePath CreateVirtualPath(const std::string& filesystem_id,
const FilePath& relative_path) const;
+ // Set the filesystem writable if |writable| is true, non-writable
+ // if it is false. Returns false if the |filesystem_id| is not valid.
+ bool SetWritable(const std::string& filesystem_id, bool writable);
+
+ // Returns true if the |filesystem_id| is writable.
+ bool IsWritable(const std::string& filesystem_id) const;
+
private:
friend struct base::DefaultLazyInstanceTraits<IsolatedContext>;
@@ -104,6 +111,13 @@ class FILEAPI_EXPORT IsolatedContext {
// Maps the toplevel entries to the filesystem id.
IDToPathMap toplevel_map_;
+ // Holds a set of writable ids.
+ // Isolated file systems are created read-only by default, and this set
+ // holds a list of exceptions.
+ // Detailed filesystem permission may be provided by an external
+ // security policy manager, e.g. ChildProcessSecurityPolicy.
+ std::set<std::string> writable_ids_;
+
DISALLOW_COPY_AND_ASSIGN(IsolatedContext);
};
« no previous file with comments | « webkit/fileapi/file_system_operation.cc ('k') | webkit/fileapi/isolated_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698