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

Side by Side Diff: webkit/chromeos/fileapi/file_access_permissions.h

Issue 6810037: File API changes needed for safely passing user selected file entities from the file browser comp... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_
6 #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
7 #pragma once
8
9 #include <map>
10 #include <set>
11 #include <string>
12
13 #include "base/file_path.h"
14 #include "base/synchronization/lock.h"
15
16 class Extension;
17
18 namespace chromeos {
19
20 class FileAccessPermissions {
21 public:
22 FileAccessPermissions();
23 virtual ~FileAccessPermissions();
24
25 // Grants |extension_id| access to |path|.
26 void GrantAccessPermission(const std::string& extension_id,
27 const FilePath& path);
28 // Checks id |extension_id| has permission to access to |path|.
29 bool HasAccessPermission(const std::string& extension_id,
30 const FilePath& path);
31 // Revokes all file permissions for |extension_id|.
32 void RevokePermissions(const std::string& extension_id);
33
34 private:
35 typedef std::set<FilePath> PathSet;
36 typedef std::map<std::string, PathSet> PathAccessMap;
37
38 base::Lock lock_; // Synchronize all access to path_map_.
39 PathAccessMap path_map_;
40 };
41
42 };
43
44 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698