net cleanup: Remove unnecessary namespace prefixes.
[chromium-blink-merge.git] / storage / browser / fileapi / sandbox_origin_database_interface.h
blob4a01e4365e21a3a13eeb303b4b7540fc34eafa18
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
3 // found in the LICENSE file.
5 #ifndef STORAGE_BROWSER_FILEAPI_SANDBOX_ORIGIN_DATABASE_INTERFACE_H_
6 #define STORAGE_BROWSER_FILEAPI_SANDBOX_ORIGIN_DATABASE_INTERFACE_H_
8 #include <string>
9 #include <vector>
11 #include "base/files/file_path.h"
12 #include "storage/browser/storage_browser_export.h"
14 namespace storage {
16 class STORAGE_EXPORT_PRIVATE SandboxOriginDatabaseInterface {
17 public:
18 struct STORAGE_EXPORT_PRIVATE OriginRecord {
19 std::string origin;
20 base::FilePath path;
22 OriginRecord();
23 OriginRecord(const std::string& origin, const base::FilePath& path);
24 ~OriginRecord();
27 virtual ~SandboxOriginDatabaseInterface() {}
29 // Returns true if the origin's path is included in this database.
30 virtual bool HasOriginPath(const std::string& origin) = 0;
32 // This will produce a unique path and add it to its database, if it's not
33 // already present.
34 virtual bool GetPathForOrigin(const std::string& origin,
35 base::FilePath* directory) = 0;
37 // Removes the origin's path from the database.
38 // Returns success if the origin has been successfully removed, or
39 // the origin is not found.
40 // (This doesn't remove the actual path).
41 virtual bool RemovePathForOrigin(const std::string& origin) = 0;
43 // Lists all origins in this database.
44 virtual bool ListAllOrigins(std::vector<OriginRecord>* origins) = 0;
46 // This will release all database resources in use; call it to save memory.
47 virtual void DropDatabase() = 0;
49 protected:
50 SandboxOriginDatabaseInterface() {}
53 } // namespace storage
55 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_ORIGIN_DATABASE_INTERFACE_H_