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

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

Issue 12163003: Add FilePath to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WEBKIT_CHROMEOS_FILEAPI_FILE_ACCESS_PERMISSIONS_H_ 5 #ifndef WEBKIT_CHROMEOS_FILEAPI_FILE_ACCESS_PERMISSIONS_H_
6 #define WEBKIT_CHROMEOS_FILEAPI_FILE_ACCESS_PERMISSIONS_H_ 6 #define WEBKIT_CHROMEOS_FILEAPI_FILE_ACCESS_PERMISSIONS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 11
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/synchronization/lock.h" 13 #include "base/synchronization/lock.h"
14 14
15 namespace chromeos { 15 namespace chromeos {
16 16
17 class FileAccessPermissions { 17 class FileAccessPermissions {
18 public: 18 public:
19 FileAccessPermissions(); 19 FileAccessPermissions();
20 virtual ~FileAccessPermissions(); 20 virtual ~FileAccessPermissions();
21 21
22 // Grants |extension_id| access to |path|. 22 // Grants |extension_id| access to |path|.
23 void GrantAccessPermission(const std::string& extension_id, 23 void GrantAccessPermission(const std::string& extension_id,
24 const FilePath& path); 24 const base::FilePath& path);
25 // Checks id |extension_id| has permission to access to |path|. 25 // Checks id |extension_id| has permission to access to |path|.
26 bool HasAccessPermission(const std::string& extension_id, 26 bool HasAccessPermission(const std::string& extension_id,
27 const FilePath& path); 27 const base::FilePath& path);
28 // Revokes all file permissions for |extension_id|. 28 // Revokes all file permissions for |extension_id|.
29 void RevokePermissions(const std::string& extension_id); 29 void RevokePermissions(const std::string& extension_id);
30 30
31 private: 31 private:
32 typedef std::set<FilePath> PathSet; 32 typedef std::set<base::FilePath> PathSet;
33 typedef std::map<std::string, PathSet> PathAccessMap; 33 typedef std::map<std::string, PathSet> PathAccessMap;
34 34
35 base::Lock lock_; // Synchronize all access to path_map_. 35 base::Lock lock_; // Synchronize all access to path_map_.
36 PathAccessMap path_map_; 36 PathAccessMap path_map_;
37 }; 37 };
38 38
39 } // namespace chromeos 39 } // namespace chromeos
40 40
41 #endif // WEBKIT_CHROMEOS_FILEAPI_FILE_ACCESS_PERMISSIONS_H_ 41 #endif // WEBKIT_CHROMEOS_FILEAPI_FILE_ACCESS_PERMISSIONS_H_
OLDNEW
« no previous file with comments | « webkit/chromeos/fileapi/cros_mount_point_provider_unittest.cc ('k') | webkit/chromeos/fileapi/file_access_permissions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698