Chromium Code Reviews| Index: webkit/fileapi/isolated_context.cc |
| diff --git a/webkit/fileapi/isolated_context.cc b/webkit/fileapi/isolated_context.cc |
| index cc9e925585b2dc26c3543bc026f19e448954c0b2..b2e91aa538cb092354c04aadbd44d2023abf8417 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 (writable_ids_.find(filesystem_id) == writable_ids_.end()) |
| + return false; |
|
kinaba
2012/06/08 04:40:19
I failed to understand these two lines.
It looks l
kinuko
2012/06/08 05:24:25
Aha you're right. I was first writing this patch
|
| + 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; |