Chromium Code Reviews| Index: webkit/chromeos/fileapi/file_access_permissions.h |
| =================================================================== |
| --- webkit/chromeos/fileapi/file_access_permissions.h (revision 0) |
| +++ webkit/chromeos/fileapi/file_access_permissions.h (revision 0) |
| @@ -0,0 +1,44 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ |
| +#define CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ |
|
ericu
2011/04/15 01:46:42
Wrong guard macro.
zel
2011/04/15 02:18:55
whoops, good catch... don't know how I haven't see
|
| +#pragma once |
| + |
| +#include <map> |
| +#include <set> |
| +#include <string> |
| + |
| +#include "base/file_path.h" |
| +#include "base/synchronization/lock.h" |
| + |
| +class Extension; |
| + |
| +namespace chromeos { |
| + |
| +class FileAccessPermissions { |
| + public: |
| + FileAccessPermissions(); |
| + virtual ~FileAccessPermissions(); |
| + |
| + // Grants |extension_id| access to |path|. |
| + void GrantAccessPermission(const std::string& extension_id, |
| + const FilePath& path); |
| + // Checks id |extension_id| has permission to access to |path|. |
| + bool HasAccessPermission(const std::string& extension_id, |
| + const FilePath& path); |
| + // Revokes all file permissions for |extension_id|. |
| + void RevokePermissions(const std::string& extension_id); |
| + |
| + private: |
| + typedef std::set<FilePath> PathSet; |
| + typedef std::map<std::string, PathSet> PathAccessMap; |
| + |
| + base::Lock lock_; // Synchronize all access to path_map_. |
| + PathAccessMap path_map_; |
| +}; |
| + |
| +}; |
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ |
| Property changes on: webkit/chromeos/fileapi/file_access_permissions.h |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |