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

Unified Diff: webkit/fileapi/file_system_operation.cc

Issue 7054012: Notify read access to the QuotaManager in FileSystemOperation (Closed) Base URL: svn://svn.chromium.org/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
Index: webkit/fileapi/file_system_operation.cc
diff --git a/webkit/fileapi/file_system_operation.cc b/webkit/fileapi/file_system_operation.cc
index d3f1f379858a27d8f713e60b1d80cac6d89ba1c8..9a1f726dab3ff4f21806a61c3d7b00767c52b244 100644
--- a/webkit/fileapi/file_system_operation.cc
+++ b/webkit/fileapi/file_system_operation.cc
@@ -13,6 +13,7 @@
#include "webkit/fileapi/file_system_file_util_proxy.h"
#include "webkit/fileapi/file_system_operation_context.h"
#include "webkit/fileapi/file_system_path_manager.h"
+#include "webkit/fileapi/file_system_quota_util.h"
#include "webkit/fileapi/file_system_types.h"
#include "webkit/fileapi/file_system_util.h"
#include "webkit/fileapi/file_writer_delegate.h"
@@ -36,9 +37,6 @@ FileSystemOperation::FileSystemOperation(
#ifndef NDEBUG
pending_operation_ = kOperationNone;
#endif
- // TODO(dmikurube): Read and set available bytes from the Quota Manager.
ericu 2011/05/24 03:03:56 Was this just dead code?
kinuko 2011/05/24 03:09:32 I believe so.
- file_system_operation_context_.set_allowed_bytes_growth(
- QuotaFileUtil::kNoLimit);
}
FileSystemOperation::~FileSystemOperation() {
@@ -656,8 +654,9 @@ void FileSystemOperation::DidEnsureFileExistsExclusive(
if (rv == base::PLATFORM_FILE_OK && !created) {
dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_EXISTS);
delete this;
- } else
+ } else {
DidFinishFileOperation(rv);
+ }
}
void FileSystemOperation::DidEnsureFileExistsNonExclusive(
@@ -818,6 +817,16 @@ bool FileSystemOperation::VerifyFileSystemPathForRead(
file_system_context()->path_manager()->GetFileSystemFileUtil(*type);
DCHECK(*file_system_file_util);
+ // We notify this read access whether the read access succeeds or not.
+ // This must be ok since this is used to let the QM's eviction logic know
+ // someone is interested in reading the origin data and therefore to indicate
+ // that evicting this origin may not be a good idea.
+ file_system_context()->GetQuotaUtil(*type)->
+ NotifyOriginWasAccessedOnIOThread(
+ file_system_context()->quota_manager_proxy(),
+ *origin_url,
+ *type);
+
return true;
}
« no previous file with comments | « no previous file | webkit/fileapi/file_system_operation_unittest.cc » ('j') | webkit/fileapi/file_system_operation_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698