| OLD | NEW |
| 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 |
| 11 #include "base/files/file_path.h" |
| 11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 12 #include "storage/browser/fileapi/sandbox_origin_database_interface.h" | 13 #include "storage/browser/fileapi/sandbox_origin_database_interface.h" |
| 13 | 14 |
| 14 namespace leveldb { | 15 namespace leveldb { |
| 15 class Env; | 16 class Env; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace storage { | 19 namespace storage { |
| 19 | 20 |
| 20 class ObfuscatedFileUtil; | 21 class ObfuscatedFileUtil; |
| 21 class SandboxIsolatedOriginDatabase; | 22 class SandboxIsolatedOriginDatabase; |
| 22 class SandboxOriginDatabase; | 23 class SandboxOriginDatabase; |
| 23 | 24 |
| 24 class STORAGE_EXPORT_PRIVATE SandboxPrioritizedOriginDatabase | 25 class STORAGE_EXPORT_PRIVATE SandboxPrioritizedOriginDatabase |
| 25 : public SandboxOriginDatabaseInterface { | 26 : public SandboxOriginDatabaseInterface { |
| 26 public: | 27 public: |
| 28 static const base::FilePath::CharType* kPrimaryDirectory; |
| 29 static const base::FilePath::CharType* kPrimaryOriginFile; |
| 30 |
| 27 SandboxPrioritizedOriginDatabase(const base::FilePath& file_system_directory, | 31 SandboxPrioritizedOriginDatabase(const base::FilePath& file_system_directory, |
| 28 leveldb::Env* env_override); | 32 leveldb::Env* env_override); |
| 29 virtual ~SandboxPrioritizedOriginDatabase(); | 33 virtual ~SandboxPrioritizedOriginDatabase(); |
| 30 | 34 |
| 31 // Sets |origin| as primary origin in this database (e.g. may | 35 // Sets |origin| as primary origin in this database (e.g. may |
| 32 // allow faster access). | 36 // allow faster access). |
| 33 // Returns false if this database already has a primary origin | 37 // Returns false if this database already has a primary origin |
| 34 // which is different from |origin|. | 38 // which is different from |origin|. |
| 35 bool InitializePrimaryOrigin(const std::string& origin); | 39 bool InitializePrimaryOrigin(const std::string& origin); |
| 36 std::string GetPrimaryOrigin(); | 40 std::string GetPrimaryOrigin(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 63 const base::FilePath primary_origin_file_; | 67 const base::FilePath primary_origin_file_; |
| 64 scoped_ptr<SandboxOriginDatabase> origin_database_; | 68 scoped_ptr<SandboxOriginDatabase> origin_database_; |
| 65 scoped_ptr<SandboxIsolatedOriginDatabase> primary_origin_database_; | 69 scoped_ptr<SandboxIsolatedOriginDatabase> primary_origin_database_; |
| 66 | 70 |
| 67 DISALLOW_COPY_AND_ASSIGN(SandboxPrioritizedOriginDatabase); | 71 DISALLOW_COPY_AND_ASSIGN(SandboxPrioritizedOriginDatabase); |
| 68 }; | 72 }; |
| 69 | 73 |
| 70 } // namespace storage | 74 } // namespace storage |
| 71 | 75 |
| 72 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_PRIORITIZED_ORIGIN_DATABASE_H_ | 76 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_PRIORITIZED_ORIGIN_DATABASE_H_ |
| OLD | NEW |