OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_DATABASE_DATABASES_TABLE_H_ | 5 #ifndef WEBKIT_DATABASE_DATABASES_TABLE_H_ |
6 #define WEBKIT_DATABASE_DATABASES_TABLE_H_ | 6 #define WEBKIT_DATABASE_DATABASES_TABLE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 #include "webkit/storage/webkit_storage_export.h" |
11 | 12 |
12 namespace sql { | 13 namespace sql { |
13 class Connection; | 14 class Connection; |
14 } | 15 } |
15 | 16 |
16 namespace webkit_database { | 17 namespace webkit_database { |
17 | 18 |
18 struct DatabaseDetails { | 19 struct WEBKIT_STORAGE_EXPORT_PRIVATE DatabaseDetails { |
19 DatabaseDetails(); | 20 DatabaseDetails(); |
20 ~DatabaseDetails(); | 21 ~DatabaseDetails(); |
21 | 22 |
22 string16 origin_identifier; | 23 string16 origin_identifier; |
23 string16 database_name; | 24 string16 database_name; |
24 string16 description; | 25 string16 description; |
25 int64 estimated_size; | 26 int64 estimated_size; |
26 }; | 27 }; |
27 | 28 |
28 class DatabasesTable { | 29 class WEBKIT_STORAGE_EXPORT_PRIVATE DatabasesTable { |
29 public: | 30 public: |
30 explicit DatabasesTable(sql::Connection* db) : db_(db) { } | 31 explicit DatabasesTable(sql::Connection* db) : db_(db) { } |
31 | 32 |
32 bool Init(); | 33 bool Init(); |
33 int64 GetDatabaseID(const string16& origin_identifier, | 34 int64 GetDatabaseID(const string16& origin_identifier, |
34 const string16& database_name); | 35 const string16& database_name); |
35 bool GetDatabaseDetails(const string16& origin_identifier, | 36 bool GetDatabaseDetails(const string16& origin_identifier, |
36 const string16& database_name, | 37 const string16& database_name, |
37 DatabaseDetails* details); | 38 DatabaseDetails* details); |
38 bool InsertDatabaseDetails(const DatabaseDetails& details); | 39 bool InsertDatabaseDetails(const DatabaseDetails& details); |
39 bool UpdateDatabaseDetails(const DatabaseDetails& details); | 40 bool UpdateDatabaseDetails(const DatabaseDetails& details); |
40 bool DeleteDatabaseDetails(const string16& origin_identifier, | 41 bool DeleteDatabaseDetails(const string16& origin_identifier, |
41 const string16& database_name); | 42 const string16& database_name); |
42 bool GetAllOrigins(std::vector<string16>* origins); | 43 bool GetAllOrigins(std::vector<string16>* origins); |
43 bool GetAllDatabaseDetailsForOrigin(const string16& origin_identifier, | 44 bool GetAllDatabaseDetailsForOrigin(const string16& origin_identifier, |
44 std::vector<DatabaseDetails>* details); | 45 std::vector<DatabaseDetails>* details); |
45 bool DeleteOrigin(const string16& origin_identifier); | 46 bool DeleteOrigin(const string16& origin_identifier); |
46 private: | 47 private: |
47 sql::Connection* db_; | 48 sql::Connection* db_; |
48 }; | 49 }; |
49 | 50 |
50 } // namespace webkit_database | 51 } // namespace webkit_database |
51 | 52 |
52 #endif // WEBKIT_DATABASE_DATABASES_TABLE_H_ | 53 #endif // WEBKIT_DATABASE_DATABASES_TABLE_H_ |
OLD | NEW |