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

Unified Diff: extensions/browser/file_reader_unittest.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
Index: extensions/browser/file_reader_unittest.cc
diff --git a/extensions/browser/file_reader_unittest.cc b/extensions/browser/file_reader_unittest.cc
index fa958793b096726e37b5217e4bfcd23363682462..37caa01b8f90d258390e828503c2ddb087cf4e27 100644
--- a/extensions/browser/file_reader_unittest.cc
+++ b/extensions/browser/file_reader_unittest.cc
@@ -40,17 +40,17 @@ class Receiver {
}
bool succeeded() const { return succeeded_; }
- const std::string& data() const { return data_; }
+ const std::string& data() const { return *data_; }
private:
- void DidReadFile(bool success, const std::string& data) {
+ void DidReadFile(bool success, std::unique_ptr<std::string> data) {
succeeded_ = success;
- data_ = data;
+ data_ = std::move(data);
base::MessageLoop::current()->QuitWhenIdle();
}
bool succeeded_;
- std::string data_;
+ std::unique_ptr<std::string> data_;
};
void RunBasicTest(const char* filename) {
« no previous file with comments | « extensions/browser/file_reader.cc ('k') | extensions/browser/guest_view/web_view/web_ui/web_ui_url_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698