Index: chromecast/crash/dummy_minidump_generator.cc |
diff --git a/chromecast/crash/dummy_minidump_generator.cc b/chromecast/crash/dummy_minidump_generator.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b06d4680ea3135e79e6275157c3de52914e966f6 |
--- /dev/null |
+++ b/chromecast/crash/dummy_minidump_generator.cc |
@@ -0,0 +1,32 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chromecast/crash/dummy_minidump_generator.h" |
+ |
+#include "base/files/file_path.h" |
+#include "base/files/file_util.h" |
+#include "base/logging.h" |
+ |
+namespace chromecast { |
+ |
+DummyMinidumpGenerator::DummyMinidumpGenerator( |
+ const std::string& existing_minidump_path) |
+ : existing_minidump_path_(existing_minidump_path) { |
+} |
+ |
+bool DummyMinidumpGenerator::Generate(const std::string& minidump_path) { |
+ base::FilePath file(existing_minidump_path_); |
+ if (!base::PathExists(file)) { |
+ LOG(ERROR) << file.value() << " is not a valid file path"; |
+ return false; |
+ } |
+ |
+ LOG(INFO) << "Moving minidump from " << existing_minidump_path_ << " to " |
+ << minidump_path << " for further uploading."; |
+ // Use stdlib call here to avoid potential IO restrictions on this thread. |
+ return (0 == rename(file.value().c_str(), |
+ base::FilePath(minidump_path).value().c_str())); |
+} |
+ |
+} // namespace chromecast |