diff options
5 files changed, 14 insertions, 2 deletions
diff --git a/content/browser/renderer_host/pepper/quota_reservation.cc b/content/browser/renderer_host/pepper/quota_reservation.cc index bf82bfb..0b0b3c1 100644 --- a/content/browser/renderer_host/pepper/quota_reservation.cc +++ b/content/browser/renderer_host/pepper/quota_reservation.cc @@ -70,7 +70,7 @@ int64_t QuotaReservation::OpenFile(int32_t id, std::pair<FileMap::iterator, bool> insert_result = files_.insert(std::make_pair(id, file_handle.get())); if (insert_result.second) { - int64_t max_written_offset = file_handle->GetEstimatedFileSize(); + int64_t max_written_offset = file_handle->GetMaxWrittenOffset(); ignore_result(file_handle.release()); return max_written_offset; } @@ -124,7 +124,7 @@ void QuotaReservation::GotReservedQuota( ppapi::FileSizeMap max_written_offsets; for (FileMap::iterator it = files_.begin(); it != files_.end(); ++ it) { max_written_offsets.insert( - std::make_pair(it->first, it->second->GetEstimatedFileSize())); + std::make_pair(it->first, it->second->GetMaxWrittenOffset())); } if (file_system_context_) { diff --git a/webkit/browser/fileapi/quota/open_file_handle.cc b/webkit/browser/fileapi/quota/open_file_handle.cc index 63ecb17..27f50b1 100644 --- a/webkit/browser/fileapi/quota/open_file_handle.cc +++ b/webkit/browser/fileapi/quota/open_file_handle.cc @@ -35,6 +35,11 @@ int64 OpenFileHandle::GetEstimatedFileSize() const { return context_->GetEstimatedFileSize(); } +int64 OpenFileHandle::GetMaxWrittenOffset() const { + DCHECK(sequence_checker_.CalledOnValidSequencedThread()); + return context_->GetMaxWrittenOffset(); +} + const base::FilePath& OpenFileHandle::platform_path() const { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); return context_->platform_path(); diff --git a/webkit/browser/fileapi/quota/open_file_handle.h b/webkit/browser/fileapi/quota/open_file_handle.h index 653a4c1..2bd7e93 100644 --- a/webkit/browser/fileapi/quota/open_file_handle.h +++ b/webkit/browser/fileapi/quota/open_file_handle.h @@ -48,6 +48,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT OpenFileHandle { // OpenFileHandle object life cycle, so that client may cache the value. int64 GetEstimatedFileSize() const; + int64 GetMaxWrittenOffset() const; const base::FilePath& platform_path() const; private: diff --git a/webkit/browser/fileapi/quota/open_file_handle_context.cc b/webkit/browser/fileapi/quota/open_file_handle_context.cc index b69553a..57e284f 100644 --- a/webkit/browser/fileapi/quota/open_file_handle_context.cc +++ b/webkit/browser/fileapi/quota/open_file_handle_context.cc @@ -43,6 +43,11 @@ int64 OpenFileHandleContext::GetEstimatedFileSize() const { return maximum_written_offset_ + append_mode_write_amount_; } +int64 OpenFileHandleContext::GetMaxWrittenOffset() const { + DCHECK(sequence_checker_.CalledOnValidSequencedThread()); + return maximum_written_offset_; +} + OpenFileHandleContext::~OpenFileHandleContext() { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); diff --git a/webkit/browser/fileapi/quota/open_file_handle_context.h b/webkit/browser/fileapi/quota/open_file_handle_context.h index 5ca7933..9bc33a2 100644 --- a/webkit/browser/fileapi/quota/open_file_handle_context.h +++ b/webkit/browser/fileapi/quota/open_file_handle_context.h @@ -39,6 +39,7 @@ class OpenFileHandleContext : public base::RefCounted<OpenFileHandleContext> { } int64 GetEstimatedFileSize() const; + int64 GetMaxWrittenOffset() const; private: friend class base::RefCounted<OpenFileHandleContext>; |