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

Unified Diff: webkit/fileapi/syncable/canned_syncable_file_system.cc

Issue 11266031: Add Quota related method to CannedSyncableFileSystem for testing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
Index: webkit/fileapi/syncable/canned_syncable_file_system.cc
diff --git a/webkit/fileapi/syncable/canned_syncable_file_system.cc b/webkit/fileapi/syncable/canned_syncable_file_system.cc
index d78c328b76727538b5fdf76ff4e1d5951cbbb570..2f8a58466eba312d8498ea1181b27b5121d0ea19 100644
--- a/webkit/fileapi/syncable/canned_syncable_file_system.cc
+++ b/webkit/fileapi/syncable/canned_syncable_file_system.cc
@@ -89,6 +89,15 @@ class WriteHelper {
int64 bytes_written_;
};
+void DidGetUsageAndQuota(const quota::StatusCallback& callback,
+ int64* usage_out, int64* quota_out,
+ quota::QuotaStatusCode status,
+ int64 usage, int64 quota) {
+ *usage_out = usage;
+ *quota_out = quota;
+ callback.Run(status);
+}
+
} // namespace
CannedSyncableFileSystem::CannedSyncableFileSystem(
@@ -265,6 +274,15 @@ PlatformFileError CannedSyncableFileSystem::DeleteFileSystem() {
test_helper_.type()));
}
+quota::QuotaStatusCode CannedSyncableFileSystem::GetUsageAndQuota(
+ int64* usage, int64* quota) {
+ return RunOnThread<quota::QuotaStatusCode>(
+ io_task_runner_,
+ FROM_HERE,
+ base::Bind(&CannedSyncableFileSystem::DoGetUsageAndQuota,
+ base::Unretained(this), usage, quota));
+}
+
FileSystemOperation* CannedSyncableFileSystem::NewOperation() {
return file_system_context_->CreateFileSystemOperation(URL(""), NULL);
}
@@ -337,6 +355,16 @@ void CannedSyncableFileSystem::DoWrite(
base::Owned(helper), callback));
}
+void CannedSyncableFileSystem::DoGetUsageAndQuota(
+ int64* usage,
+ int64* quota,
+ const quota::StatusCallback& callback) {
+ quota_manager_->GetUsageAndQuota(
+ test_helper_.origin(),
+ test_helper_.storage_type(),
+ base::Bind(&DidGetUsageAndQuota, callback, usage, quota));
+}
+
void CannedSyncableFileSystem::DidOpenFileSystem(
PlatformFileError result, const std::string& name, const GURL& root) {
result_ = result;
« no previous file with comments | « webkit/fileapi/syncable/canned_syncable_file_system.h ('k') | webkit/fileapi/syncable/syncable_file_system_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698