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

Unified Diff: content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc

Issue 190423002: Correctly handle has_more in PepperInternalFileRefBackend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
« no previous file with comments | « content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc
diff --git a/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc b/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc
index d45792960613f3952e8555ed90ebdf2c2fda2520..4aba18b7052026f1c76e1ac2c16bc0e38d6fcadc 100644
--- a/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc
+++ b/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc
@@ -197,21 +197,27 @@ int32_t PepperInternalFileRefBackend::ReadDirectoryEntries(
if (!GetFileSystemURL().is_valid())
return PP_ERROR_FAILED;
+ fileapi::FileSystemOperation::FileEntryList* accumulated_file_list
+ = new fileapi::FileSystemOperation::FileEntryList;
GetFileSystemContext()->operation_runner()->ReadDirectory(
GetFileSystemURL(),
base::Bind(&PepperInternalFileRefBackend::ReadDirectoryComplete,
weak_factory_.GetWeakPtr(),
- reply_context));
+ reply_context,
+ base::Owned(accumulated_file_list)));
return PP_OK_COMPLETIONPENDING;
}
void PepperInternalFileRefBackend::ReadDirectoryComplete(
ppapi::host::ReplyMessageContext context,
+ fileapi::FileSystemOperation::FileEntryList* accumulated_file_list,
base::File::Error error,
const fileapi::FileSystemOperation::FileEntryList& file_list,
bool has_more) {
- // The current filesystem backend always returns false.
- DCHECK(!has_more);
+ accumulated_file_list->insert(accumulated_file_list->end(),
+ file_list.begin(), file_list.end());
+ if (has_more)
+ return;
context.params.set_result(ppapi::FileErrorToPepperError(error));
@@ -223,7 +229,8 @@ void PepperInternalFileRefBackend::ReadDirectoryComplete(
dir_path += '/';
for (fileapi::FileSystemOperation::FileEntryList::const_iterator it =
- file_list.begin(); it != file_list.end(); ++it) {
+ accumulated_file_list->begin();
+ it != accumulated_file_list->end(); ++it) {
if (it->is_directory)
file_types.push_back(PP_FILETYPE_DIRECTORY);
else
« no previous file with comments | « content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698