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

Unified Diff: webkit/database/database_tracker.h

Issue 7037018: DB quota (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
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 | « content/worker/worker_webkitclient_impl.cc ('k') | webkit/glue/webkitclient_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/database/database_tracker.h
===================================================================
--- webkit/database/database_tracker.h (revision 86348)
+++ webkit/database/database_tracker.h (working copy)
@@ -70,9 +70,8 @@
// This class manages the main database, and keeps track of per origin quotas.
//
// The data in this class is not thread-safe, so all methods of this class
-// should be called on the same thread. The only exception is
-// database_directory() which returns a constant that is initialized when
-// the DatabaseTracker instance is created.
+// should be called on the same thread. The only exceptions are the ctor(),
+// the dtor() and the database_directory() and quota_manager_proxy() getters.
//
// Furthermore, some methods of this class have to read/write data from/to
// the disk. Therefore, in a multi-threaded application, all methods of this
@@ -124,11 +123,17 @@
virtual bool GetAllOriginIdentifiers(std::vector<string16>* origin_ids);
virtual bool GetAllOriginsInfo(std::vector<OriginInfo>* origins_info);
+ // TODO(michaeln): remove quota related stuff when quota manager
+ // integration is complete
void SetOriginQuota(const string16& origin_identifier, int64 new_quota);
int64 GetDefaultQuota() { return default_quota_; }
- // Sets the default quota for all origins. Should be used in tests only.
- void SetDefaultQuota(int64 quota);
+ void SetDefaultQuota(int64 quota); // for testing
+ // Safe to call on any thread.
+ quota::QuotaManagerProxy* quota_manager_proxy() const {
+ return quota_manager_proxy_.get();
+ }
+
bool IsDatabaseScheduledForDeletion(const string16& origin_identifier,
const string16& database_name);
@@ -151,8 +156,9 @@
// Delete all databases that belong to the given origin. Returns net::OK on
// success, net::FAILED if not all databases could be deleted, and
// net::ERR_IO_PENDING and |callback| is invoked upon completion, if non-NULL.
- int DeleteDataForOrigin(const string16& origin_identifier,
- net::CompletionCallback* callback);
+ // virtual for unit testing only
+ virtual int DeleteDataForOrigin(const string16& origin_identifier,
+ net::CompletionCallback* callback);
bool IsIncognitoProfile() const { return is_incognito_; }
« no previous file with comments | « content/worker/worker_webkitclient_impl.cc ('k') | webkit/glue/webkitclient_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698