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

Side by Side Diff: webkit/fileapi/sandbox_origin_database.h

Issue 14885021: Cleanup: Prefix HTML5 Sandbox FileSystem related files with 'sandbox_' (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_FILEAPI_FILE_SYSTEM_ORIGIN_DATABASE_H_ 5 #ifndef WEBKIT_FILEAPI_SANDBOX_ORIGIN_DATABASE_H_
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_ORIGIN_DATABASE_H_ 6 #define WEBKIT_FILEAPI_SANDBOX_ORIGIN_DATABASE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/time.h" 14 #include "base/time.h"
15 #include "webkit/storage/webkit_storage_export.h" 15 #include "webkit/storage/webkit_storage_export.h"
16 16
17 namespace leveldb { 17 namespace leveldb {
18 class DB; 18 class DB;
19 class Status; 19 class Status;
20 } 20 }
21 21
22 namespace tracked_objects { 22 namespace tracked_objects {
23 class Location; 23 class Location;
24 } 24 }
25 25
26 namespace fileapi { 26 namespace fileapi {
27 27
28 // All methods of this class other than the constructor may be used only from 28 // All methods of this class other than the constructor may be used only from
29 // the browser's FILE thread. The constructor may be used on any thread. 29 // the browser's FILE thread. The constructor may be used on any thread.
30 class WEBKIT_STORAGE_EXPORT_PRIVATE FileSystemOriginDatabase { 30 class WEBKIT_STORAGE_EXPORT_PRIVATE SandboxOriginDatabase {
31 public: 31 public:
32 struct WEBKIT_STORAGE_EXPORT_PRIVATE OriginRecord { 32 struct WEBKIT_STORAGE_EXPORT_PRIVATE OriginRecord {
33 std::string origin; 33 std::string origin;
34 base::FilePath path; 34 base::FilePath path;
35 35
36 OriginRecord(); 36 OriginRecord();
37 OriginRecord(const std::string& origin, const base::FilePath& path); 37 OriginRecord(const std::string& origin, const base::FilePath& path);
38 ~OriginRecord(); 38 ~OriginRecord();
39 }; 39 };
40 40
41 // Only one instance of FileSystemOriginDatabase should exist for a given path 41 // Only one instance of SandboxOriginDatabase should exist for a given path
42 // at a given time. 42 // at a given time.
43 explicit FileSystemOriginDatabase(const base::FilePath& file_system_directory) ; 43 explicit SandboxOriginDatabase(const base::FilePath& file_system_directory);
44 ~FileSystemOriginDatabase(); 44 ~SandboxOriginDatabase();
45 45
46 bool HasOriginPath(const std::string& origin); 46 bool HasOriginPath(const std::string& origin);
47 47
48 // This will produce a unique path and add it to its database, if it's not 48 // This will produce a unique path and add it to its database, if it's not
49 // already present. 49 // already present.
50 bool GetPathForOrigin(const std::string& origin, base::FilePath* directory); 50 bool GetPathForOrigin(const std::string& origin, base::FilePath* directory);
51 51
52 // Also returns success if the origin is not found. 52 // Also returns success if the origin is not found.
53 bool RemovePathForOrigin(const std::string& origin); 53 bool RemovePathForOrigin(const std::string& origin);
54 54
(...skipping 12 matching lines...) Expand all
67 bool Init(RecoveryOption recovery_option); 67 bool Init(RecoveryOption recovery_option);
68 bool RepairDatabase(const std::string& db_path); 68 bool RepairDatabase(const std::string& db_path);
69 void HandleError(const tracked_objects::Location& from_here, 69 void HandleError(const tracked_objects::Location& from_here,
70 const leveldb::Status& status); 70 const leveldb::Status& status);
71 void ReportInitStatus(const leveldb::Status& status); 71 void ReportInitStatus(const leveldb::Status& status);
72 bool GetLastPathNumber(int* number); 72 bool GetLastPathNumber(int* number);
73 73
74 base::FilePath file_system_directory_; 74 base::FilePath file_system_directory_;
75 scoped_ptr<leveldb::DB> db_; 75 scoped_ptr<leveldb::DB> db_;
76 base::Time last_reported_time_; 76 base::Time last_reported_time_;
77 DISALLOW_COPY_AND_ASSIGN(FileSystemOriginDatabase); 77 DISALLOW_COPY_AND_ASSIGN(SandboxOriginDatabase);
78 }; 78 };
79 79
80 } // namespace fileapi 80 } // namespace fileapi
81 81
82 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_ORIGIN_DATABASE_H_ 82 #endif // WEBKIT_FILEAPI_SANDBOX_ORIGIN_DATABASE_H_
OLDNEW
« no previous file with comments | « webkit/fileapi/sandbox_directory_database_unittest.cc ('k') | webkit/fileapi/sandbox_origin_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698