diff options
Diffstat (limited to 'content/browser')
5 files changed, 17 insertions, 22 deletions
diff --git a/content/browser/renderer_host/pepper/pepper_file_io_host.cc b/content/browser/renderer_host/pepper/pepper_file_io_host.cc index e66219b..da802e5 100644 --- a/content/browser/renderer_host/pepper/pepper_file_io_host.cc +++ b/content/browser/renderer_host/pepper/pepper_file_io_host.cc @@ -334,11 +334,9 @@ int32_t PepperFileIOHost::OnHostMsgFlush( int32_t PepperFileIOHost::OnHostMsgClose( ppapi::host::HostMessageContext* context, - int64_t max_written_offset) { + const ppapi::FileGrowth& file_growth) { if (check_quota_) { - file_system_host_->CloseQuotaFile( - this, - ppapi::FileGrowth(max_written_offset, 0)); + file_system_host_->CloseQuotaFile(this, file_growth); check_quota_ = false; } diff --git a/content/browser/renderer_host/pepper/pepper_file_io_host.h b/content/browser/renderer_host/pepper/pepper_file_io_host.h index 76991a9..45953c9 100644 --- a/content/browser/renderer_host/pepper/pepper_file_io_host.h +++ b/content/browser/renderer_host/pepper/pepper_file_io_host.h @@ -23,6 +23,10 @@ #include "url/gurl.h" #include "webkit/browser/fileapi/file_system_context.h" +namespace ppapi { +struct FileGrowth; +} + namespace content { class PepperFileSystemBrowserHost; @@ -58,7 +62,7 @@ class PepperFileIOHost : public ppapi::host::ResourceHost, int32_t OnHostMsgSetLength(ppapi::host::HostMessageContext* context, int64_t length); int32_t OnHostMsgClose(ppapi::host::HostMessageContext* context, - int64_t max_written_offset); + const ppapi::FileGrowth& file_growth); int32_t OnHostMsgFlush(ppapi::host::HostMessageContext* context); int32_t OnHostMsgRequestOSFileHandle( ppapi::host::HostMessageContext* context); diff --git a/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc b/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc index 0430b6b..0401ae2 100644 --- a/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc +++ b/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc @@ -365,7 +365,7 @@ int32_t PepperFileSystemBrowserHost::OnHostMsgInitIsolatedFileSystem( int32_t PepperFileSystemBrowserHost::OnHostMsgReserveQuota( ppapi::host::HostMessageContext* context, int64_t amount, - const ppapi::FileSizeMap& file_sizes) { + const ppapi::FileGrowthMap& file_growths) { DCHECK(ChecksQuota()); DCHECK(amount > 0); @@ -373,11 +373,6 @@ int32_t PepperFileSystemBrowserHost::OnHostMsgReserveQuota( return PP_ERROR_INPROGRESS; reserving_quota_ = true; - ppapi::FileGrowthMap file_growths; - for (ppapi::FileSizeMap::const_iterator it = file_sizes.begin(); - it != file_sizes.end(); ++it) - file_growths[it->first] = ppapi::FileGrowth(it->second, 0); - int64_t reservation_amount = std::max<int64_t>(kMinimumQuotaReservationSize, amount); file_system_context_->default_file_task_runner()->PostTask( @@ -463,7 +458,7 @@ void PepperFileSystemBrowserHost::GotQuotaReservation( void PepperFileSystemBrowserHost::GotReservedQuota( ppapi::host::ReplyMessageContext reply_context, int64_t amount, - const ppapi::FileSizeMap& max_written_offsets) { + const ppapi::FileSizeMap& file_sizes) { DCHECK(reserving_quota_); reserving_quota_ = false; reserved_quota_ = amount; @@ -471,7 +466,7 @@ void PepperFileSystemBrowserHost::GotReservedQuota( reply_context.params.set_result(PP_OK); host()->SendReply( reply_context, - PpapiPluginMsg_FileSystem_ReserveQuotaReply(amount, max_written_offsets)); + PpapiPluginMsg_FileSystem_ReserveQuotaReply(amount, file_sizes)); } std::string PepperFileSystemBrowserHost::GetPluginMimeType() const { diff --git a/content/browser/renderer_host/pepper/pepper_file_system_browser_host.h b/content/browser/renderer_host/pepper/pepper_file_system_browser_host.h index 30b9df9..d31a16d 100644 --- a/content/browser/renderer_host/pepper/pepper_file_system_browser_host.h +++ b/content/browser/renderer_host/pepper/pepper_file_system_browser_host.h @@ -115,7 +115,7 @@ class CONTENT_EXPORT PepperFileSystemBrowserHost int32_t OnHostMsgReserveQuota( ppapi::host::HostMessageContext* context, int64_t amount, - const ppapi::FileSizeMap& max_written_offsets); + const ppapi::FileGrowthMap& file_growths); void SendReplyForFileSystem( ppapi::host::ReplyMessageContext reply_context, @@ -137,7 +137,7 @@ class CONTENT_EXPORT PepperFileSystemBrowserHost void GotReservedQuota( ppapi::host::ReplyMessageContext reply_context, int64_t amount, - const ppapi::FileSizeMap& max_written_offsets); + const ppapi::FileSizeMap& file_sizes); void DidOpenQuotaFile( PP_Resource file_io_resource, const OpenQuotaFileCallback& callback, diff --git a/content/browser/renderer_host/pepper/quota_reservation.cc b/content/browser/renderer_host/pepper/quota_reservation.cc index 2dd5caa..ed572d6 100644 --- a/content/browser/renderer_host/pepper/quota_reservation.cc +++ b/content/browser/renderer_host/pepper/quota_reservation.cc @@ -121,11 +121,9 @@ void QuotaReservation::OnClientCrash() { void QuotaReservation::GotReservedQuota( const ReserveQuotaCallback& callback, base::File::Error error) { - 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->GetMaxWrittenOffset())); - } + ppapi::FileSizeMap file_sizes; + for (FileMap::iterator it = files_.begin(); it != files_.end(); ++ it) + file_sizes[it->first] = it->second->GetMaxWrittenOffset(); if (file_system_context_) { BrowserThread::PostTask( @@ -133,10 +131,10 @@ void QuotaReservation::GotReservedQuota( FROM_HERE, base::Bind(callback, quota_reservation_->remaining_quota(), - max_written_offsets)); + file_sizes)); } else { // Unit testing code path. - callback.Run(quota_reservation_->remaining_quota(), max_written_offsets); + callback.Run(quota_reservation_->remaining_quota(), file_sizes); } } |