| Index: webkit/fileapi/isolated_context.h
|
| diff --git a/webkit/fileapi/isolated_context.h b/webkit/fileapi/isolated_context.h
|
| index fa6d0a9ef0011d81c969f509eb0e3b6778611f34..ac71015b2b85e91a585df44c4fd1d5df4a09a00f 100644
|
| --- a/webkit/fileapi/isolated_context.h
|
| +++ b/webkit/fileapi/isolated_context.h
|
| @@ -53,8 +53,12 @@ class FILEAPI_EXPORT IsolatedContext {
|
| // file set contains non absolute paths.
|
| std::string RegisterIsolatedFileSystem(const std::set<FilePath>& fileset);
|
|
|
| - // Revokes filesystem specified by the given filesystem_id.
|
| - void RevokeIsolatedFileSystem(const std::string& filesystem_id);
|
| + // Adds a reference to a filesystem specified by the given filesystem_id.
|
| + void AddReference(const std::string& filesystem_id);
|
| +
|
| + // Removes a reference to a filesystem specified by the given filesystem_id.
|
| + // If the reference count reaches 0 the isolated context gets destroyed.
|
| + void RemoveReference(const std::string& filesystem_id);
|
|
|
| // Cracks the given |virtual_path| (which should look like
|
| // "/<filesystem_id>/<relative_path>") and populates the |filesystem_id|
|
| @@ -102,6 +106,10 @@ class FILEAPI_EXPORT IsolatedContext {
|
| IsolatedContext();
|
| ~IsolatedContext();
|
|
|
| + // Removes the given filesystem without locking.
|
| + // (The caller must hold a lock)
|
| + void RevokeWithoutLocking(const std::string& filesystem_id);
|
| +
|
| // Returns a new filesystem_id. Called with lock.
|
| std::string GetNewFileSystemId() const;
|
|
|
| @@ -118,6 +126,10 @@ class FILEAPI_EXPORT IsolatedContext {
|
| // security policy manager, e.g. ChildProcessSecurityPolicy.
|
| std::set<std::string> writable_ids_;
|
|
|
| + // Reference counts. An isolated filesystem is created with ref==0,
|
| + // and will get deleted when the ref count reaches <=0.
|
| + std::map<std::string, int> ref_counts_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(IsolatedContext);
|
| };
|
|
|
|
|