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

Side by Side Diff: storage/browser/fileapi/sandbox_prioritized_origin_database.h

Issue 669603008: Standardize usage of virtual/override/final in storage/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 STORAGE_BROWSER_FILEAPI_SANDBOX_PRIORITIZED_ORIGIN_DATABASE_H_ 5 #ifndef STORAGE_BROWSER_FILEAPI_SANDBOX_PRIORITIZED_ORIGIN_DATABASE_H_
6 #define STORAGE_BROWSER_FILEAPI_SANDBOX_PRIORITIZED_ORIGIN_DATABASE_H_ 6 #define STORAGE_BROWSER_FILEAPI_SANDBOX_PRIORITIZED_ORIGIN_DATABASE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 12 matching lines...) Expand all
23 class SandboxOriginDatabase; 23 class SandboxOriginDatabase;
24 24
25 class STORAGE_EXPORT_PRIVATE SandboxPrioritizedOriginDatabase 25 class STORAGE_EXPORT_PRIVATE SandboxPrioritizedOriginDatabase
26 : public SandboxOriginDatabaseInterface { 26 : public SandboxOriginDatabaseInterface {
27 public: 27 public:
28 static const base::FilePath::CharType* kPrimaryDirectory; 28 static const base::FilePath::CharType* kPrimaryDirectory;
29 static const base::FilePath::CharType* kPrimaryOriginFile; 29 static const base::FilePath::CharType* kPrimaryOriginFile;
30 30
31 SandboxPrioritizedOriginDatabase(const base::FilePath& file_system_directory, 31 SandboxPrioritizedOriginDatabase(const base::FilePath& file_system_directory,
32 leveldb::Env* env_override); 32 leveldb::Env* env_override);
33 virtual ~SandboxPrioritizedOriginDatabase(); 33 ~SandboxPrioritizedOriginDatabase() override;
34 34
35 // Sets |origin| as primary origin in this database (e.g. may 35 // Sets |origin| as primary origin in this database (e.g. may
36 // allow faster access). 36 // allow faster access).
37 // Returns false if this database already has a primary origin 37 // Returns false if this database already has a primary origin
38 // which is different from |origin|. 38 // which is different from |origin|.
39 bool InitializePrimaryOrigin(const std::string& origin); 39 bool InitializePrimaryOrigin(const std::string& origin);
40 std::string GetPrimaryOrigin(); 40 std::string GetPrimaryOrigin();
41 41
42 // SandboxOriginDatabaseInterface overrides. 42 // SandboxOriginDatabaseInterface overrides.
43 virtual bool HasOriginPath(const std::string& origin) override; 43 bool HasOriginPath(const std::string& origin) override;
44 virtual bool GetPathForOrigin(const std::string& origin, 44 bool GetPathForOrigin(const std::string& origin,
45 base::FilePath* directory) override; 45 base::FilePath* directory) override;
46 virtual bool RemovePathForOrigin(const std::string& origin) override; 46 bool RemovePathForOrigin(const std::string& origin) override;
47 virtual bool ListAllOrigins(std::vector<OriginRecord>* origins) override; 47 bool ListAllOrigins(std::vector<OriginRecord>* origins) override;
48 virtual void DropDatabase() override; 48 void DropDatabase() override;
49 49
50 const base::FilePath& primary_origin_file() const { 50 const base::FilePath& primary_origin_file() const {
51 return primary_origin_file_; 51 return primary_origin_file_;
52 } 52 }
53 53
54 private: 54 private:
55 bool MaybeLoadPrimaryOrigin(); 55 bool MaybeLoadPrimaryOrigin();
56 bool ResetPrimaryOrigin(const std::string& origin); 56 bool ResetPrimaryOrigin(const std::string& origin);
57 void MaybeMigrateDatabase(const std::string& origin); 57 void MaybeMigrateDatabase(const std::string& origin);
58 void MaybeInitializeDatabases(bool create); 58 void MaybeInitializeDatabases(bool create);
59 void MaybeInitializeNonPrimaryDatabase(bool create); 59 void MaybeInitializeNonPrimaryDatabase(bool create);
60 60
61 // For migration. 61 // For migration.
62 friend class ObfuscatedFileUtil; 62 friend class ObfuscatedFileUtil;
63 SandboxOriginDatabase* GetSandboxOriginDatabase(); 63 SandboxOriginDatabase* GetSandboxOriginDatabase();
64 64
65 const base::FilePath file_system_directory_; 65 const base::FilePath file_system_directory_;
66 leveldb::Env* env_override_; 66 leveldb::Env* env_override_;
67 const base::FilePath primary_origin_file_; 67 const base::FilePath primary_origin_file_;
68 scoped_ptr<SandboxOriginDatabase> origin_database_; 68 scoped_ptr<SandboxOriginDatabase> origin_database_;
69 scoped_ptr<SandboxIsolatedOriginDatabase> primary_origin_database_; 69 scoped_ptr<SandboxIsolatedOriginDatabase> primary_origin_database_;
70 70
71 DISALLOW_COPY_AND_ASSIGN(SandboxPrioritizedOriginDatabase); 71 DISALLOW_COPY_AND_ASSIGN(SandboxPrioritizedOriginDatabase);
72 }; 72 };
73 73
74 } // namespace storage 74 } // namespace storage
75 75
76 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_PRIORITIZED_ORIGIN_DATABASE_H_ 76 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_PRIORITIZED_ORIGIN_DATABASE_H_
OLDNEW
« no previous file with comments | « storage/browser/fileapi/sandbox_origin_database.h ('k') | storage/browser/fileapi/sandbox_quota_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698