Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(611)

Unified Diff: webkit/quota/quota_database.h

Issue 7057006: Add Dump{Quota,LastAccessTime}Table (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webkit/quota/quota_database.cc » ('j') | webkit/quota/quota_database.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/quota/quota_database.h
diff --git a/webkit/quota/quota_database.h b/webkit/quota/quota_database.h
index e18f338545f78bacc279eb5785f338e62529b59c..d43f8062b269916d53f695f8b71a7415651ac045 100644
--- a/webkit/quota/quota_database.h
+++ b/webkit/quota/quota_database.h
@@ -9,10 +9,12 @@
#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 "googleurl/src/gurl.h"
#include "webkit/quota/quota_types.h"
namespace sql {
@@ -75,6 +77,30 @@ class QuotaDatabase {
bool CreateSchema();
bool ResetSchema();
+ // For Tests and Debug use
+ struct QuotaTableEntry {
+ std::string host;
+ StorageType type;
+ int64 quota;
+ };
+ typedef base::Callback<bool (const QuotaTableEntry&)> QuotaTableCallback;
+ bool DumpQuotaTable(QuotaTableCallback* callback);
+ friend bool operator <(const QuotaTableEntry& lhs,
+ const QuotaTableEntry& rhs);
+ bool AssignQuotaTable(const std::set<QuotaTableEntry>& entries);
kinuko 2011/05/20 13:19:54 I guess we won't need assign methods?
tzik 2011/05/23 05:24:15 Done. Moved to quota_database_unittest.
+
+ struct AccessTableEntry {
+ GURL origin;
+ StorageType type;
+ int used_count;
+ base::Time last_access_time;
+ };
+ typedef base::Callback<bool (const AccessTableEntry&)> AccessTableCallback;
+ bool DumpAccessTable(AccessTableCallback* callback);
+ friend bool operator <(const AccessTableEntry& lhs,
+ const AccessTableEntry& rhs);
+ bool AssignAccessTable(const std::set<AccessTableEntry>& entries);
+
FilePath db_file_path_;
scoped_ptr<sql::Connection> db_;
« no previous file with comments | « no previous file | webkit/quota/quota_database.cc » ('j') | webkit/quota/quota_database.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698