summaryrefslogtreecommitdiffstats
path: root/webkit/database/databases_table.h
diff options
context:
space:
mode:
authordumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-02 21:41:56 +0000
committerdumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-02 21:41:56 +0000
commit615dedfcdefe5fd2d5ea3c97aea4f2669e0d6657 (patch)
tree02038c0c0863cc0ccb766b4c9f120e039b0d8f0e /webkit/database/databases_table.h
parent9f8b6045dedbb3189aec7910f23d1c8fa59a7641 (diff)
downloadchromium_src-615dedfcdefe5fd2d5ea3c97aea4f2669e0d6657.zip
chromium_src-615dedfcdefe5fd2d5ea3c97aea4f2669e0d6657.tar.gz
chromium_src-615dedfcdefe5fd2d5ea3c97aea4f2669e0d6657.tar.bz2
Adding Chromium's database tracker.
BUG=none TEST=none Review URL: http://codereview.chromium.org/334039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30747 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/database/databases_table.h')
-rw-r--r--webkit/database/databases_table.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/webkit/database/databases_table.h b/webkit/database/databases_table.h
new file mode 100644
index 0000000..cafff9f
--- /dev/null
+++ b/webkit/database/databases_table.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WEBKIT_DATABASE_DATABASES_TABLE_H_
+#define WEBKIT_DATABASE_DATABASES_TABLE_H_
+
+#include <vector>
+
+#include "base/string16.h"
+
+namespace sql {
+class Connection;
+}
+
+namespace webkit_database {
+
+struct DatabaseDetails {
+ DatabaseDetails() : estimated_size(0) { }
+
+ string16 origin_identifier;
+ string16 database_name;
+ string16 description;
+ int64 estimated_size;
+};
+
+class DatabasesTable {
+ public:
+ explicit DatabasesTable(sql::Connection* db) : db_(db) { }
+
+ bool Init();
+ bool GetDatabaseDetails(const string16& origin_identifier,
+ const string16& database_name,
+ DatabaseDetails* details);
+ bool InsertDatabaseDetails(const DatabaseDetails& details);
+ bool UpdateDatabaseDetails(const DatabaseDetails& details);
+ bool DeleteDatabaseDetails(const string16& origin_identifier,
+ const string16& database_name);
+ bool GetAllDatabaseDetailsForOrigin(const string16& origin_identifier,
+ std::vector<DatabaseDetails>* details);
+ private:
+ sql::Connection* db_;
+};
+
+} // namespace webkit_database
+
+#endif // WEBKIT_DATABASE_DATABASES_TABLE_H_