summaryrefslogtreecommitdiffstats
path: root/content/browser/renderer_host/pepper
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-09 02:51:09 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-09 02:51:09 +0000
commitc2520bb1dc105f69bc56cf0c6ce758f6e3ef2643 (patch)
tree9c6803b84aa6d40b7ba1f8d9f81f7f723aa03d23 /content/browser/renderer_host/pepper
parente7fd177fd621aaa91b0400aa2375d8510a10e447 (diff)
downloadchromium_src-c2520bb1dc105f69bc56cf0c6ce758f6e3ef2643.zip
chromium_src-c2520bb1dc105f69bc56cf0c6ce758f6e3ef2643.tar.gz
chromium_src-c2520bb1dc105f69bc56cf0c6ce758f6e3ef2643.tar.bz2
Correctly handle has_more in PepperInternalFileRefBackend
BUG=347900 Review URL: https://codereview.chromium.org/190423002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255811 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/pepper')
-rw-r--r--content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc15
-rw-r--r--content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.h1
2 files changed, 12 insertions, 4 deletions
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 d457929..4aba18b 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
diff --git a/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.h b/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.h
index 0e70270..a8c95c6 100644
--- a/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.h
+++ b/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.h
@@ -65,6 +65,7 @@ class PepperInternalFileRefBackend : public PepperFileRefBackend {
const base::File::Info& file_info);
void ReadDirectoryComplete(
ppapi::host::ReplyMessageContext context,
+ fileapi::FileSystemOperation::FileEntryList* accumulated_file_list,
base::File::Error error,
const fileapi::FileSystemOperation::FileEntryList& file_list,
bool has_more);