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

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

Issue 1154383006: Adding crash utilities to chromecast/crash. (Closed) Base URL: https://eureka-internal.googlesource.com/chromium/src@master
Patch Set: cast_shell_unittests not built for android Created 5 years, 6 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
« no previous file with comments | « chromecast/crash/linux/dummy_minidump_generator.h ('k') | chromecast/crash/linux/dump_info.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chromecast/crash/linux/dummy_minidump_generator.h"
6
7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h"
9 #include "base/logging.h"
10
11 namespace chromecast {
12
13 DummyMinidumpGenerator::DummyMinidumpGenerator(
14 const std::string& existing_minidump_path)
15 : existing_minidump_path_(existing_minidump_path) {
16 }
17
18 bool DummyMinidumpGenerator::Generate(const std::string& minidump_path) {
19 base::FilePath file(existing_minidump_path_);
20 if (!base::PathExists(file)) {
21 LOG(ERROR) << file.value() << " is not a valid file path";
22 return false;
23 }
24
25 LOG(INFO) << "Moving minidump from " << existing_minidump_path_ << " to "
26 << minidump_path << " for further uploading.";
27 // Use stdlib call here to avoid potential IO restrictions on this thread.
28 if (rename(file.value().c_str(), minidump_path.c_str()) < 0) {
29 LOG(ERROR) << "Could not move file: " << file.value() << " "
30 << strerror(errno);
31 return false;
32 }
33
34 return true;
35 }
36
37 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/crash/linux/dummy_minidump_generator.h ('k') | chromecast/crash/linux/dump_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698