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

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

Issue 2119283002: Use container::back() and container::pop_back() for content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
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 467597fb39d37d5eed5ecd9c26ab94760f475fdc..ea05dc43be6825dc0ade66afd7b32ba087cb0859 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
@@ -233,23 +233,18 @@ void PepperInternalFileRefBackend::ReadDirectoryComplete(
std::vector<PP_FileType> file_types;
if (error == base::File::FILE_OK && fs_host_.get()) {
std::string dir_path = path_;
- if (dir_path.empty() || dir_path[dir_path.size() - 1] != '/')
+ if (dir_path.empty() || dir_path.back() != '/')
dir_path += '/';
- for (storage::FileSystemOperation::FileEntryList::const_iterator it =
- accumulated_file_list->begin();
- it != accumulated_file_list->end();
- ++it) {
- if (it->is_directory)
- file_types.push_back(PP_FILETYPE_DIRECTORY);
- else
- file_types.push_back(PP_FILETYPE_REGULAR);
+ for (const auto& it : *accumulated_file_list) {
+ file_types.push_back(it.is_directory ? PP_FILETYPE_DIRECTORY
+ : PP_FILETYPE_REGULAR);
ppapi::FileRefCreateInfo info;
info.file_system_type = fs_type_;
info.file_system_plugin_resource = fs_host_->pp_resource();
std::string path =
- dir_path + storage::FilePathToString(base::FilePath(it->name));
+ dir_path + storage::FilePathToString(base::FilePath(it.name));
info.internal_path = path;
info.display_name = ppapi::GetNameForInternalFilePath(path);
infos.push_back(info);

Powered by Google App Engine
This is Rietveld 408576698