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

Unified Diff: components/bookmarks/browser/bookmark_storage.cc

Issue 1079943002: Avoid copying the data string when posting ImportantFileWriter write tasks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « base/files/important_file_writer_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/bookmarks/browser/bookmark_storage.cc
diff --git a/components/bookmarks/browser/bookmark_storage.cc b/components/bookmarks/browser/bookmark_storage.cc
index daafdbea09378a185baf8bc13b0277eba9afd290..2612f9c324d680b7f00ea6c00bea46d670e8fb2c 100644
--- a/components/bookmarks/browser/bookmark_storage.cc
+++ b/components/bookmarks/browser/bookmark_storage.cc
@@ -205,10 +205,10 @@ bool BookmarkStorage::SaveNow() {
return false;
}
- std::string data;
- if (!SerializeData(&data))
+ scoped_ptr<std::string> data(new std::string);
+ if (!SerializeData(data.get()))
return false;
- writer_.WriteNow(data);
+ writer_.WriteNow(data.Pass());
return true;
}
« no previous file with comments | « base/files/important_file_writer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698