| 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 <stdint.h> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 11 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 11 #include "base/files/file.h" | 13 #include "base/files/file.h" |
| 12 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
| 13 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 14 #include "base/process/kill.h" | 16 #include "base/process/kill.h" |
| 15 #include "base/process/launch.h" | 17 #include "base/process/launch.h" |
| 16 #include "chrome/common/logging_chrome.h" | 18 #include "chrome/common/logging_chrome.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 FROM_HERE, | 198 FROM_HERE, |
| 197 base::Bind(&AddUserLogsToArchive, | 199 base::Bind(&AddUserLogsToArchive, |
| 198 user_log_dir, | 200 user_log_dir, |
| 199 tar_file_path, | 201 tar_file_path, |
| 200 compressed_output_path, | 202 compressed_output_path, |
| 201 callback)); | 203 callback)); |
| 202 } | 204 } |
| 203 | 205 |
| 204 void IntializeLogFile(base::File* file, | 206 void IntializeLogFile(base::File* file, |
| 205 const base::FilePath& file_path, | 207 const base::FilePath& file_path, |
| 206 uint32 flags) { | 208 uint32_t flags) { |
| 207 base::FilePath dir = file_path.DirName(); | 209 base::FilePath dir = file_path.DirName(); |
| 208 if (!base::DirectoryExists(dir)) { | 210 if (!base::DirectoryExists(dir)) { |
| 209 if (!base::CreateDirectory(dir)) { | 211 if (!base::CreateDirectory(dir)) { |
| 210 LOG(ERROR) << "Can not create " << dir.value(); | 212 LOG(ERROR) << "Can not create " << dir.value(); |
| 211 return; | 213 return; |
| 212 } | 214 } |
| 213 } | 215 } |
| 214 | 216 |
| 215 file->Initialize(file_path, flags); | 217 file->Initialize(file_path, flags); |
| 216 } | 218 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 fileshelf.Append(FILE_PATH_LITERAL("combined-logs.tar")); | 268 fileshelf.Append(FILE_PATH_LITERAL("combined-logs.tar")); |
| 267 | 269 |
| 268 // Get system logs from /var/log first, then add user-specific stuff. | 270 // Get system logs from /var/log first, then add user-specific stuff. |
| 269 StartLogRetrieval(file_path, | 271 StartLogRetrieval(file_path, |
| 270 false, | 272 false, |
| 271 sequence_token_name, | 273 sequence_token_name, |
| 272 base::Bind(&OnSystemLogsAdded, callback)); | 274 base::Bind(&OnSystemLogsAdded, callback)); |
| 273 } | 275 } |
| 274 | 276 |
| 275 } // namespace chromeos | 277 } // namespace chromeos |
| OLD | NEW |