summaryrefslogtreecommitdiffstats
path: root/webkit/quota/quota_database.h
diff options
context:
space:
mode:
authortzik@chromium.org <tzik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-24 07:45:44 +0000
committertzik@chromium.org <tzik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-24 07:45:44 +0000
commit378bab11881e161a65ff9c3d89775cdd9c95e24c (patch)
treee7ec1c8d34d8acc01c4b5063eca62ab1c79e8abd /webkit/quota/quota_database.h
parenta5f2695dda6c7175e328a6d4e4bc5e873c2668e8 (diff)
downloadchromium_src-378bab11881e161a65ff9c3d89775cdd9c95e24c.zip
chromium_src-378bab11881e161a65ff9c3d89775cdd9c95e24c.tar.gz
chromium_src-378bab11881e161a65ff9c3d89775cdd9c95e24c.tar.bz2
Add Dump{Quota,LastAccessTime}Table to QuotaDatabase
BUG=61676 TEST='QuotaDatabaseTest.*' Review URL: http://codereview.chromium.org/7057006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86403 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/quota/quota_database.h')
-rw-r--r--webkit/quota/quota_database.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/webkit/quota/quota_database.h b/webkit/quota/quota_database.h
index 32560b5..8017e8d 100644
--- a/webkit/quota/quota_database.h
+++ b/webkit/quota/quota_database.h
@@ -9,10 +9,13 @@
#include <string>
#include "base/basictypes.h"
+#include "base/callback.h"
#include "base/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
+#include "base/time.h"
#include "base/timer.h"
+#include "googleurl/src/gurl.h"
#include "webkit/quota/quota_types.h"
namespace sql {
@@ -66,6 +69,27 @@ class QuotaDatabase {
bool SetOriginDatabaseBootstrapped(bool bootstrap_flag);
private:
+ struct QuotaTableEntry {
+ std::string host;
+ StorageType type;
+ int64 quota;
+ };
+ friend bool operator <(const QuotaTableEntry& lhs,
+ const QuotaTableEntry& rhs);
+
+ struct LastAccessTimeTableEntry {
+ GURL origin;
+ StorageType type;
+ int used_count;
+ base::Time last_access_time;
+ };
+ friend bool operator <(const LastAccessTimeTableEntry& lhs,
+ const LastAccessTimeTableEntry& rhs);
+
+ typedef base::Callback<bool (const QuotaTableEntry&)> QuotaTableCallback;
+ typedef base::Callback<bool (const LastAccessTimeTableEntry&)>
+ LastAccessTimeTableCallback;
+
// For long-running transactions support. We always keep a transaction open
// so that multiple transactions can be batched. They are flushed
// with a delay after a modification has been made. We support neither
@@ -82,6 +106,11 @@ class QuotaDatabase {
bool CreateSchema();
bool ResetSchema();
+ // |callback| may return false to stop reading data
+ bool DumpQuotaTable(QuotaTableCallback* callback);
+ bool DumpLastAccessTimeTable(LastAccessTimeTableCallback* callback);
+
+
FilePath db_file_path_;
scoped_ptr<sql::Connection> db_;