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; |
} |