ios: Don't start upload thread from background.

It is not safe to start the upload thread when in the background (due
to the potential for flocked files in shared containers).

Bug: 1317812
Change-Id: Ie476c2ccbc7232bc9e1a30a7a497128a4248c39e
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3595621
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
This commit is contained in:
Justin Cohen 2022-04-20 00:09:00 -04:00 committed by Crashpad LUCI CQ
parent 94ea6d6f30
commit 55cee0127e

View File

@ -273,7 +273,14 @@ void InProcessHandler::StartProcessingPendingReports() {
return;
upload_thread_enabled_ = true;
UpdatePruneAndUploadThreads(true);
// This may be a no-op if IsApplicationActive is false, as it is not safe to
// start the upload thread when in the background (due to the potential for
// flocked files in shared containers).
// TODO(crbug.com/crashpad/400): Consider moving prune and upload thread to
// BackgroundTasks and/or NSURLSession. This might allow uploads to continue
// in the background.
UpdatePruneAndUploadThreads(system_data_.IsApplicationActive());
}
void InProcessHandler::UpdatePruneAndUploadThreads(bool active) {