Skip to content

Commit

Permalink
Defer quitting main message loop till shutdown tasks run
Browse files Browse the repository at this point in the history
This takes care of MiraclePtr warnings in VizProcessTransportFactory
upon shutdown.

Change-Id: Ie2345e53f79e81bb99f5e8f79451f9e258823929
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4836863
Reviewed-by: Peter Kvitek <kvitekp@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1192519}
  • Loading branch information
caseq authored and Chromium LUCI CQ committed Sep 5, 2023
1 parent 8856481 commit 303a20d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion headless/lib/browser/headless_browser_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,12 @@ void HeadlessBrowserImpl::Shutdown() {
content::GetIOThreadTaskRunner({})->DeleteSoon(
FROM_HERE, system_request_context_manager_.release());
}
// We might have posted task during shutdown, let these run
// before quitting the message loop. See ~HeadlessWebContentsImpl
// for additional context.
if (quit_main_message_loop_) {
std::move(quit_main_message_loop_).Run();
BrowserMainThread()->PostTask(FROM_HERE,
std::move(quit_main_message_loop_));
}
}

Expand Down

0 comments on commit 303a20d

Please sign in to comment.