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

Unified Diff: extensions/browser/file_reader.cc

Issue 2231353002: Make FileReader return ownership of the string content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 4 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 | « extensions/browser/file_reader.h ('k') | extensions/browser/file_reader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/file_reader.cc
diff --git a/extensions/browser/file_reader.cc b/extensions/browser/file_reader.cc
index 89c1c297e42e287939266c3f42648b243e56b144..c5deb9b646e071cc844cceb9ec57922b35afab31 100644
--- a/extensions/browser/file_reader.cc
+++ b/extensions/browser/file_reader.cc
@@ -26,8 +26,8 @@ void FileReader::Start() {
FileReader::~FileReader() {}
void FileReader::ReadFileOnBackgroundThread() {
- std::string data;
- bool success = base::ReadFileToString(resource_.GetFilePath(), &data);
- origin_task_runner_->PostTask(FROM_HERE,
- base::Bind(callback_, success, data));
+ std::unique_ptr<std::string> data(new std::string());
+ bool success = base::ReadFileToString(resource_.GetFilePath(), data.get());
+ origin_task_runner_->PostTask(
+ FROM_HERE, base::Bind(callback_, success, base::Passed(std::move(data))));
}
« no previous file with comments | « extensions/browser/file_reader.h ('k') | extensions/browser/file_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698