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

Side by Side Diff: chromecast/crash/linux/dump_info.cc

Issue 2258493003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 #include "chromecast/crash/linux/dump_info.h" 4 #include "chromecast/crash/linux/dump_info.h"
5 5
6 #include <errno.h> 6 #include <errno.h>
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 logfile_(logfile), 47 logfile_(logfile),
48 dump_time_(dump_time), 48 dump_time_(dump_time),
49 params_(params), 49 params_(params),
50 valid_(true) {} 50 valid_(true) {}
51 51
52 DumpInfo::~DumpInfo() { 52 DumpInfo::~DumpInfo() {
53 } 53 }
54 54
55 std::unique_ptr<base::Value> DumpInfo::GetAsValue() const { 55 std::unique_ptr<base::Value> DumpInfo::GetAsValue() const {
56 std::unique_ptr<base::Value> result = 56 std::unique_ptr<base::Value> result =
57 base::WrapUnique(new base::DictionaryValue()); 57 base::MakeUnique<base::DictionaryValue>();
58 base::DictionaryValue* entry; 58 base::DictionaryValue* entry;
59 result->GetAsDictionary(&entry); 59 result->GetAsDictionary(&entry);
60 entry->SetString(kNameKey, params_.process_name); 60 entry->SetString(kNameKey, params_.process_name);
61 61
62 base::Time::Exploded ex; 62 base::Time::Exploded ex;
63 dump_time_.LocalExplode(&ex); 63 dump_time_.LocalExplode(&ex);
64 std::string dump_time = 64 std::string dump_time =
65 base::StringPrintf(kDumpTimeFormat, ex.year, ex.month, ex.day_of_month, 65 base::StringPrintf(kDumpTimeFormat, ex.year, ex.month, ex.day_of_month,
66 ex.hour, ex.minute, ex.second); 66 ex.hour, ex.minute, ex.second);
67 entry->SetString(kDumpTimeKey, dump_time); 67 entry->SetString(kDumpTimeKey, dump_time);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 &ex.day_of_month, &ex.hour, &ex.minute, &ex.second) < 6) { 146 &ex.day_of_month, &ex.hour, &ex.minute, &ex.second) < 6) {
147 LOG(INFO) << "Failed to convert dump time invalid"; 147 LOG(INFO) << "Failed to convert dump time invalid";
148 return false; 148 return false;
149 } 149 }
150 150
151 dump_time_ = base::Time::FromLocalExploded(ex); 151 dump_time_ = base::Time::FromLocalExploded(ex);
152 return true; 152 return true;
153 } 153 }
154 154
155 } // namespace chromecast 155 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/crash/linux/crash_testing_utils.cc ('k') | chromecast/crash/linux/synchronized_minidump_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698