Pass FileSystem's ReadDirectory result by value
The result of ReadDirectory may be large, and, as it's passed by const-ref
in the current implementation, the callee has to copy it to use it later.
This CL changes the signature of the result handler to pass the result by
value, so that the result handler may move it without copying it.
Bug: 755451
Change-Id: I10050853106ac7324a7c46fbaeb0fadbd0e15f77
Reviewed-on: https://chromium-review.googlesource.com/628001
Commit-Queue: Taiju Tsuiki <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Reilly Grant <[email protected]>
Reviewed-by: Tomasz Mikolajewski <[email protected]>
Reviewed-by: Hiroki Nakagawa <[email protected]>
Cr-Commit-Position: refs/heads/master@{#497758}
diff --git a/content/browser/plugin_private_storage_helper.cc b/content/browser/plugin_private_storage_helper.cc
index 2b25d82..bb3d446 100644
--- a/content/browser/plugin_private_storage_helper.cc
+++ b/content/browser/plugin_private_storage_helper.cc
@@ -86,7 +86,7 @@
void OnFileSystemOpened(base::File::Error result);
void OnDirectoryRead(const std::string& root,
base::File::Error result,
- const storage::AsyncFileUtil::EntryList& file_list,
+ storage::AsyncFileUtil::EntryList file_list,
bool has_more);
void OnFileInfo(const std::string& file_name,
base::File::Error result,
@@ -150,14 +150,14 @@
filesystem_context_);
file_util->ReadDirectory(
std::move(operation_context), filesystem_context_->CrackURL(GURL(root)),
- base::Bind(&PluginPrivateDataByOriginChecker::OnDirectoryRead,
- base::Unretained(this), root));
+ base::BindRepeating(&PluginPrivateDataByOriginChecker::OnDirectoryRead,
+ base::Unretained(this), root));
}
void PluginPrivateDataByOriginChecker::OnDirectoryRead(
const std::string& root,
base::File::Error result,
- const storage::AsyncFileUtil::EntryList& file_list,
+ storage::AsyncFileUtil::EntryList file_list,
bool has_more) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DVLOG(3) << __func__ << " result: " << result