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

Unified Diff: base/files/important_file_writer.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 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.h ('k') | base/files/important_file_writer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/important_file_writer.cc
diff --git a/base/files/important_file_writer.cc b/base/files/important_file_writer.cc
index a724dc36ee86cea4b06d70aa70fc4829cba7fe93..922aa0fa416b68ed70a7d85219e6a76b4c5b5cad 100644
--- a/base/files/important_file_writer.cc
+++ b/base/files/important_file_writer.cc
@@ -55,9 +55,10 @@ void LogFailure(const FilePath& path, TempFileFailure failure_code,
DPLOG(WARNING) << "temp file failure: " << path.value() << " : " << message;
}
-// Helper function to call WriteFileAtomically() with a scoped_ptr<std::string>.
+// Helper function to call WriteFileAtomically() with a
+// std::unique_ptr<std::string>.
bool WriteScopedStringToFileAtomically(const FilePath& path,
- scoped_ptr<std::string> data) {
+ std::unique_ptr<std::string> data) {
return ImportantFileWriter::WriteFileAtomically(path, *data);
}
@@ -157,7 +158,7 @@ bool ImportantFileWriter::HasPendingWrite() const {
return timer_.IsRunning();
}
-void ImportantFileWriter::WriteNow(scoped_ptr<std::string> data) {
+void ImportantFileWriter::WriteNow(std::unique_ptr<std::string> data) {
DCHECK(CalledOnValidThread());
if (!IsValueInRangeForNumericType<int32_t>(data->length())) {
NOTREACHED();
@@ -192,7 +193,7 @@ void ImportantFileWriter::ScheduleWrite(DataSerializer* serializer) {
void ImportantFileWriter::DoScheduledWrite() {
DCHECK(serializer_);
- scoped_ptr<std::string> data(new std::string);
+ std::unique_ptr<std::string> data(new std::string);
if (serializer_->SerializeData(data.get())) {
WriteNow(std::move(data));
} else {
« no previous file with comments | « base/files/important_file_writer.h ('k') | base/files/important_file_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698