Skip to content

Commit

Permalink
Fix ProcessHost shutdown when ProcessHostOnUI is turned on.
Browse files Browse the repository at this point in the history
It turns out BrowserProcessSubThread is only used for IO thread at this point so it doesn't get a chance to clean up things that live on the UI thread. In a subsequent cl I'll rename it to BrowserProcessIOThread to make it clear, but this is the minmal fix for ProcessHostOnUI for now.

This fixes the remaining failures on the windows bots, which were the InProcessGpuTest tests.

Bug: 904556
Change-Id: Ie3575ecef4d4f206b23b583fbb86c4e6b30f523a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2877684
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#880129}
  • Loading branch information
John Abd-El-Malek authored and Chromium LUCI CQ committed May 6, 2021
1 parent bb276ba commit cab1dbc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 3 additions & 0 deletions content/browser/browser_main_loop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,9 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
if (RenderProcessHost::run_renderer_in_process())
RenderProcessHostImpl::ShutDownInProcessRenderer();

if (base::FeatureList::IsEnabled(features::kProcessHostOnUI))
BrowserProcessSubThread::ProcessHostCleanUp();

if (parts_) {
TRACE_EVENT0("shutdown",
"BrowserMainLoop::Subsystem:PostMainMessageLoopRun");
Expand Down
5 changes: 0 additions & 5 deletions content/browser/browser_process_sub_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ void BrowserProcessSubThread::CleanUp() {
ProcessHostCleanUp();
}

if (base::FeatureList::IsEnabled(features::kProcessHostOnUI) &&
BrowserThread::CurrentlyOn(BrowserThread::UI)) {
ProcessHostCleanUp();
}

notification_service_.reset();

#if defined(OS_WIN)
Expand Down
4 changes: 2 additions & 2 deletions content/browser/browser_process_sub_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class CONTENT_EXPORT BrowserProcessSubThread : public base::Thread {
// starting this BrowserProcessSubThread.
void AllowBlockingForTesting();

static void ProcessHostCleanUp();

protected:
void Init() override;
void Run(base::RunLoop* run_loop) override;
Expand All @@ -71,8 +73,6 @@ class CONTENT_EXPORT BrowserProcessSubThread : public base::Thread {
// This method encapsulates cleanup that needs to happen on the IO thread.
void IOThreadCleanUp();

void ProcessHostCleanUp();

const BrowserThread::ID identifier_;

// BrowserThreads are not allowed to do file I/O nor wait on synchronization
Expand Down

0 comments on commit cab1dbc

Please sign in to comment.