| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 | 4 |
| 5 #include "chrome/browser/chromeos/system_logs/debug_log_writer.h" | 5 #include "chrome/browser/chromeos/system_logs/debug_log_writer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 if (!process.IsValid()) { | 92 if (!process.IsValid()) { |
| 93 LOG(ERROR) << "Failed to execute command " << argv[0]; | 93 LOG(ERROR) << "Failed to execute command " << argv[0]; |
| 94 if (!callback.is_null()) | 94 if (!callback.is_null()) |
| 95 callback.Run(false); | 95 callback.Run(false); |
| 96 | 96 |
| 97 return; | 97 return; |
| 98 } | 98 } |
| 99 | 99 |
| 100 int exit_code = 0; | 100 int exit_code = 0; |
| 101 if (!process.WaitForExit(&exit_code)) { | 101 if (!process.WaitForExit(&exit_code)) { |
| 102 LOG(ERROR) << "Can't get exit code for pid " << process.pid(); | 102 LOG(ERROR) << "Can't get exit code for pid " << process.Pid(); |
| 103 if (!callback.is_null()) | 103 if (!callback.is_null()) |
| 104 callback.Run(false); | 104 callback.Run(false); |
| 105 | 105 |
| 106 return; | 106 return; |
| 107 } | 107 } |
| 108 if (!callback.is_null()) | 108 if (!callback.is_null()) |
| 109 callback.Run(exit_code == 0); | 109 callback.Run(exit_code == 0); |
| 110 } | 110 } |
| 111 | 111 |
| 112 // Callback for handling the outcome of CompressArchive(). It reports | 112 // Callback for handling the outcome of CompressArchive(). It reports |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 fileshelf.Append(FILE_PATH_LITERAL("combined-logs.tar")); | 266 fileshelf.Append(FILE_PATH_LITERAL("combined-logs.tar")); |
| 267 | 267 |
| 268 // Get system logs from /var/log first, then add user-specific stuff. | 268 // Get system logs from /var/log first, then add user-specific stuff. |
| 269 StartLogRetrieval(file_path, | 269 StartLogRetrieval(file_path, |
| 270 false, | 270 false, |
| 271 sequence_token_name, | 271 sequence_token_name, |
| 272 base::Bind(&OnSystemLogsAdded, callback)); | 272 base::Bind(&OnSystemLogsAdded, callback)); |
| 273 } | 273 } |
| 274 | 274 |
| 275 } // namespace chromeos | 275 } // namespace chromeos |
| OLD | NEW |