summaryrefslogtreecommitdiffstats
path: root/webkit/quota
diff options
context:
space:
mode:
authordmikurube@chromium.org <dmikurube@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-10 11:20:56 +0000
committerdmikurube@chromium.org <dmikurube@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-10 11:20:56 +0000
commitb97b5d364f899cacf587606ec42eeaefb13b045a (patch)
tree2f2b60f0babbe82b96275e5605b4456357f7fd6e /webkit/quota
parent7f891f7903443bdac4e3cb76518512f35d68ceaa (diff)
downloadchromium_src-b97b5d364f899cacf587606ec42eeaefb13b045a.zip
chromium_src-b97b5d364f899cacf587606ec42eeaefb13b045a.tar.gz
chromium_src-b97b5d364f899cacf587606ec42eeaefb13b045a.tar.bz2
Set allowed bytes growth in FileSystemOperation from QuotaManager.
It sets allowed bytes growth before copy(/move)/write/truncate. It includes : 1) rewriting FileSystemOperationTest with using FileSystemContext, PathManager and QuotaManager, and 2) switching the callee of LocalFileSystemFileUtil into QuotaFileUtil. BUG=74841 TEST=FileSystemOperationTest.*, FileSystemOperationWriteTest.* Review URL: http://codereview.chromium.org/6865008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84776 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/quota')
-rw-r--r--webkit/quota/quota_manager.cc9
-rw-r--r--webkit/quota/quota_manager.h10
2 files changed, 16 insertions, 3 deletions
diff --git a/webkit/quota/quota_manager.cc b/webkit/quota/quota_manager.cc
index 0f18532..bd00f60 100644
--- a/webkit/quota/quota_manager.cc
+++ b/webkit/quota/quota_manager.cc
@@ -519,6 +519,15 @@ void QuotaManager::DeleteOnCorrectThread() const {
// QuotaManagerProxy ----------------------------------------------------------
+void QuotaManagerProxy::GetUsageAndQuota(
+ const GURL& origin,
+ StorageType type,
+ QuotaManager::GetUsageAndQuotaCallback* callback) {
+ DCHECK(io_thread_->BelongsToCurrentThread());
+ if (manager_)
+ manager_->GetUsageAndQuota(origin, type, callback);
+}
+
void QuotaManagerProxy::RegisterClient(QuotaClient* client) {
if (!io_thread_->BelongsToCurrentThread()) {
io_thread_->PostTask(FROM_HERE, NewRunnableMethod(
diff --git a/webkit/quota/quota_manager.h b/webkit/quota/quota_manager.h
index eb8d70f..16c0588 100644
--- a/webkit/quota/quota_manager.h
+++ b/webkit/quota/quota_manager.h
@@ -54,9 +54,10 @@ class QuotaManager : public QuotaTaskObserver,
QuotaManagerProxy* proxy() { return proxy_.get(); }
// Called by clients or webapps.
- void GetUsageAndQuota(const GURL& origin,
- StorageType type,
- GetUsageAndQuotaCallback* callback);
+ // This method is declared as virtual to allow test code to override it.
+ virtual void GetUsageAndQuota(const GURL& origin,
+ StorageType type,
+ GetUsageAndQuotaCallback* callback);
// Called by webapps.
void RequestQuota(const GURL& origin,
@@ -158,6 +159,9 @@ struct QuotaManagerDeleter {
class QuotaManagerProxy
: public base::RefCountedThreadSafe<QuotaManagerProxy> {
public:
+ void GetUsageAndQuota(const GURL& origin,
+ StorageType type,
+ QuotaManager::GetUsageAndQuotaCallback* callback);
void RegisterClient(QuotaClient* client);
void NotifyStorageModified(QuotaClient::ID client_id,
const GURL& origin,