OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "base/auto_reset.h" | 24 #include "base/auto_reset.h" |
25 #include "base/files/file_path.h" | 25 #include "base/files/file_path.h" |
26 #include "base/files/scoped_file.h" | 26 #include "base/files/scoped_file.h" |
27 #include "base/logging.h" | 27 #include "base/logging.h" |
28 #include "base/memory/scoped_ptr.h" | 28 #include "base/memory/scoped_ptr.h" |
29 #include "base/scoped_generic.h" | 29 #include "base/scoped_generic.h" |
30 #include "base/strings/utf_string_conversions.h" | 30 #include "base/strings/utf_string_conversions.h" |
31 #include "build/build_config.h" | 31 #include "build/build_config.h" |
32 #include "client/crash_report_database.h" | 32 #include "client/crash_report_database.h" |
33 #include "client/crashpad_client.h" | 33 #include "client/crashpad_client.h" |
| 34 #include "client/prune_crash_reports.h" |
34 #include "tools/tool_support.h" | 35 #include "tools/tool_support.h" |
35 #include "handler/crash_report_upload_thread.h" | 36 #include "handler/crash_report_upload_thread.h" |
| 37 #include "handler/prune_crash_reports_thread.h" |
36 #include "util/file/file_io.h" | 38 #include "util/file/file_io.h" |
37 #include "util/stdlib/map_insert.h" | 39 #include "util/stdlib/map_insert.h" |
38 #include "util/stdlib/string_number_conversion.h" | 40 #include "util/stdlib/string_number_conversion.h" |
39 #include "util/string/split_string.h" | 41 #include "util/string/split_string.h" |
40 #include "util/synchronization/semaphore.h" | 42 #include "util/synchronization/semaphore.h" |
41 | 43 |
42 #if defined(OS_MACOSX) | 44 #if defined(OS_MACOSX) |
43 #include <libgen.h> | 45 #include <libgen.h> |
44 #include <signal.h> | 46 #include <signal.h> |
45 | 47 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 scoped_ptr<CrashReportDatabase> database(CrashReportDatabase::Initialize( | 367 scoped_ptr<CrashReportDatabase> database(CrashReportDatabase::Initialize( |
366 base::FilePath(ToolSupport::CommandLineArgumentToFilePathStringType( | 368 base::FilePath(ToolSupport::CommandLineArgumentToFilePathStringType( |
367 options.database)))); | 369 options.database)))); |
368 if (!database) { | 370 if (!database) { |
369 return EXIT_FAILURE; | 371 return EXIT_FAILURE; |
370 } | 372 } |
371 | 373 |
372 CrashReportUploadThread upload_thread(database.get(), options.url); | 374 CrashReportUploadThread upload_thread(database.get(), options.url); |
373 upload_thread.Start(); | 375 upload_thread.Start(); |
374 | 376 |
| 377 PruneCrashReportThread prune_thread(database.get(), |
| 378 PruneCondition::GetDefault()); |
| 379 prune_thread.Start(); |
| 380 |
375 CrashReportExceptionHandler exception_handler( | 381 CrashReportExceptionHandler exception_handler( |
376 database.get(), &upload_thread, &options.annotations); | 382 database.get(), &upload_thread, &options.annotations); |
377 | 383 |
378 exception_handler_server.Run(&exception_handler); | 384 exception_handler_server.Run(&exception_handler); |
379 | 385 |
380 upload_thread.Stop(); | 386 upload_thread.Stop(); |
| 387 prune_thread.Stop(); |
381 | 388 |
382 return EXIT_SUCCESS; | 389 return EXIT_SUCCESS; |
383 } | 390 } |
384 | 391 |
385 } // namespace crashpad | 392 } // namespace crashpad |
OLD | NEW |