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

Unified Diff: webkit/fileapi/quota_file_util.cc

Issue 7671039: Count-up/down the dirty count in the usage cache at FileSystemOperation, not at QuotaFU. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Renamed ScopedOriginUpdateHelper. Created 9 years, 4 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/quota_file_util.cc
diff --git a/webkit/fileapi/quota_file_util.cc b/webkit/fileapi/quota_file_util.cc
index 2ab4f79b934c7f4560349a8bf6cef3b33f712970..613eb495936e9c228d81b67382a619c6f84097fe 100644
--- a/webkit/fileapi/quota_file_util.cc
+++ b/webkit/fileapi/quota_file_util.cc
@@ -46,9 +46,9 @@ bool CanCopy(
}
// A helper class to hook quota_util() methods before and after modifications.
-class ScopedOriginUpdateHelper {
+class OriginUpdateHelper {
public:
- explicit ScopedOriginUpdateHelper(
+ explicit OriginUpdateHelper(
FileSystemOperationContext* operation_context,
const GURL& origin_url,
FileSystemType type)
@@ -62,13 +62,9 @@ class ScopedOriginUpdateHelper {
operation_context_->file_system_context()->GetQuotaUtil(type_);
quota_manager_proxy_ =
operation_context_->file_system_context()->quota_manager_proxy();
- if (quota_util_)
- quota_util_->StartUpdateOriginOnFileThread(origin_url_, type_);
}
- ~ScopedOriginUpdateHelper() {
- if (quota_util_)
- quota_util_->EndUpdateOriginOnFileThread(origin_url_, type_);
+ ~OriginUpdateHelper() {
}
void NotifyUpdate(int64 growth) {
@@ -85,7 +81,7 @@ class ScopedOriginUpdateHelper {
QuotaManagerProxy* quota_manager_proxy_;
const GURL& origin_url_;
FileSystemType type_;
- DISALLOW_COPY_AND_ASSIGN(ScopedOriginUpdateHelper);
+ DISALLOW_COPY_AND_ASSIGN(OriginUpdateHelper);
};
} // namespace (anonymous)
@@ -111,7 +107,7 @@ base::PlatformFileError QuotaFileUtil::CopyOrMoveFile(
// TODO(kinuko): For cross-filesystem move case we need 2 helpers, one for
// src and one for dest.
- ScopedOriginUpdateHelper helper(
+ OriginUpdateHelper helper(
kinuko 2011/08/25 09:12:00 If all we do is calling NotifyUpdate() it looks li
Dai Mikurube (NOT FULLTIME) 2011/08/25 09:19:46 Ah, exactly. I'll modify it in the next change.
fs_context,
fs_context->dest_origin_url(),
fs_context->dest_type());
@@ -148,7 +144,7 @@ base::PlatformFileError QuotaFileUtil::DeleteFile(
FileSystemOperationContext* fs_context,
const FilePath& file_path) {
DCHECK(fs_context);
- ScopedOriginUpdateHelper helper(
+ OriginUpdateHelper helper(
fs_context,
fs_context->src_origin_url(),
fs_context->src_type());
@@ -173,7 +169,7 @@ base::PlatformFileError QuotaFileUtil::Truncate(
const FilePath& path,
int64 length) {
int64 allowed_bytes_growth = fs_context->allowed_bytes_growth();
- ScopedOriginUpdateHelper helper(
+ OriginUpdateHelper helper(
fs_context,
fs_context->src_origin_url(),
fs_context->src_type());
« webkit/fileapi/file_system_operation.h ('K') | « webkit/fileapi/file_system_operation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698