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> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 189 |
190 return; | 190 return; |
191 } | 191 } |
192 | 192 |
193 base::FilePath compressed_output_path = | 193 base::FilePath compressed_output_path = |
194 tar_file_path.AddExtension(FILE_PATH_LITERAL(".gz")); | 194 tar_file_path.AddExtension(FILE_PATH_LITERAL(".gz")); |
195 base::FilePath user_log_dir = | 195 base::FilePath user_log_dir = |
196 logging::GetSessionLogDir(*base::CommandLine::ForCurrentProcess()); | 196 logging::GetSessionLogDir(*base::CommandLine::ForCurrentProcess()); |
197 | 197 |
198 base::PostTaskWithTraits( | 198 base::PostTaskWithTraits( |
199 FROM_HERE, | 199 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, |
200 base::TaskTraits().MayBlock().WithPriority( | |
201 base::TaskPriority::BACKGROUND), | |
202 base::Bind(&AddUserLogsToArchive, user_log_dir, tar_file_path, | 200 base::Bind(&AddUserLogsToArchive, user_log_dir, tar_file_path, |
203 compressed_output_path, callback)); | 201 compressed_output_path, callback)); |
204 } | 202 } |
205 | 203 |
206 void InitializeLogFile(base::File* file, | 204 void InitializeLogFile(base::File* file, |
207 const base::FilePath& file_path, | 205 const base::FilePath& file_path, |
208 uint32_t flags) { | 206 uint32_t flags) { |
209 base::FilePath dir = file_path.DirName(); | 207 base::FilePath dir = file_path.DirName(); |
210 if (!base::DirectoryExists(dir)) { | 208 if (!base::DirectoryExists(dir)) { |
211 if (!base::CreateDirectory(dir)) { | 209 if (!base::CreateDirectory(dir)) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 fileshelf.Append(FILE_PATH_LITERAL("combined-logs.tar")); | 265 fileshelf.Append(FILE_PATH_LITERAL("combined-logs.tar")); |
268 | 266 |
269 // Get system logs from /var/log first, then add user-specific stuff. | 267 // Get system logs from /var/log first, then add user-specific stuff. |
270 StartLogRetrieval(file_path, | 268 StartLogRetrieval(file_path, |
271 false, | 269 false, |
272 sequence_token_name, | 270 sequence_token_name, |
273 base::Bind(&OnSystemLogsAdded, callback)); | 271 base::Bind(&OnSystemLogsAdded, callback)); |
274 } | 272 } |
275 | 273 |
276 } // namespace chromeos | 274 } // namespace chromeos |
OLD | NEW |