diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-24 06:43:54 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-24 06:43:54 +0000 |
commit | 03616ddad3438ddde91cbc2c405444346fb341f3 (patch) | |
tree | a066572f84529202cb6a18698be0976aa4a9f259 /webkit/fileapi/file_system_operation.cc | |
parent | 8280427e3d67fd90c0d2744ed59993ecfb705082 (diff) | |
download | chromium_src-03616ddad3438ddde91cbc2c405444346fb341f3.zip chromium_src-03616ddad3438ddde91cbc2c405444346fb341f3.tar.gz chromium_src-03616ddad3438ddde91cbc2c405444346fb341f3.tar.bz2 |
Notify read access to the QuotaManager in FileSystemOperation
BUG=none
TEST=FileSystemOperationTest.*
Review URL: http://codereview.chromium.org/7054012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86400 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/file_system_operation.cc')
-rw-r--r-- | webkit/fileapi/file_system_operation.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/webkit/fileapi/file_system_operation.cc b/webkit/fileapi/file_system_operation.cc index 9692cb3..e994f21 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. - 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; } |