| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |