Commit d4be08b8 authored by robliao's avatar robliao Committed by Commit bot

Revert of Reland RedirectNonUINonIOBrowserThreads to TaskScheduler by default...

Revert of Reland RedirectNonUINonIOBrowserThreads to TaskScheduler by default on trunk (patchset #1 id:1 of https://codereview.chromium.org/2856583002/ )

Reason for revert:
Possible failure: https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.chromiumos%2FLinux_ChromiumOS_Tests__dbg__1_%2F25521%2F%2B%2Frecipes%2Fsteps%2Fbrowser_tests%2F0%2Flogs%2FCaptivePortalWindowTest.OnRedirected%2F0

Original issue's description:
> Reland RedirectNonUINonIOBrowserThreads to TaskScheduler by default on trunk
>
> This reverts commit f07732ec
> (https://codereview.chromium.org/2791933004)
> and reapplies b6d0c9a0
> (https://codereview.chromium.org/2690183002/).
>
> BUG=653916, 707986
> TBR=jam@chromium.org, rkaplow@chromium.org
> Previously reviewed at https://codereview.chromium.org/2690183002/
>
> Review-Url: https://codereview.chromium.org/2856583002
> Cr-Commit-Position: refs/heads/master@{#468376}
> Committed: https://chromium.googlesource.com/chromium/src/+/3e27cb6e501ae55d614b56d566487590518ec223

TBR=jam@chromium.org,rkaplow@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=653916, 707986

Review-Url: https://codereview.chromium.org/2848413002
Cr-Commit-Position: refs/heads/master@{#468481}
parent abeb3b92
...@@ -34,11 +34,9 @@ class Predictor; ...@@ -34,11 +34,9 @@ class Predictor;
namespace content { namespace content {
class BrowserGpuChannelHostFactory; class BrowserGpuChannelHostFactory;
class BrowserGpuMemoryBufferManager; class BrowserGpuMemoryBufferManager;
class BrowserMainLoop;
class BrowserShutdownProfileDumper; class BrowserShutdownProfileDumper;
class BrowserSurfaceViewManager; class BrowserSurfaceViewManager;
class BrowserTestBase; class BrowserTestBase;
class CategorizedWorkerPool;
class NestedMessagePumpAndroid; class NestedMessagePumpAndroid;
class ScopedAllowWaitForAndroidLayoutTests; class ScopedAllowWaitForAndroidLayoutTests;
class ScopedAllowWaitForDebugURL; class ScopedAllowWaitForDebugURL;
...@@ -47,6 +45,7 @@ class SynchronousCompositor; ...@@ -47,6 +45,7 @@ class SynchronousCompositor;
class SynchronousCompositorBrowserFilter; class SynchronousCompositorBrowserFilter;
class SynchronousCompositorHost; class SynchronousCompositorHost;
class TextInputClientMac; class TextInputClientMac;
class CategorizedWorkerPool;
} // namespace content } // namespace content
namespace dbus { namespace dbus {
class Bus; class Bus;
...@@ -186,7 +185,6 @@ class BASE_EXPORT ThreadRestrictions { ...@@ -186,7 +185,6 @@ class BASE_EXPORT ThreadRestrictions {
friend class android_webview::AwFormDatabaseService; friend class android_webview::AwFormDatabaseService;
friend class android_webview::CookieManager; friend class android_webview::CookieManager;
friend class base::StackSamplingProfiler; friend class base::StackSamplingProfiler;
friend class content::BrowserMainLoop;
friend class content::BrowserShutdownProfileDumper; friend class content::BrowserShutdownProfileDumper;
friend class content::BrowserSurfaceViewManager; friend class content::BrowserSurfaceViewManager;
friend class content::BrowserTestBase; friend class content::BrowserTestBase;
......
...@@ -1259,88 +1259,86 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() { ...@@ -1259,88 +1259,86 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
service_manager_context_.reset(); service_manager_context_.reset();
mojo_ipc_support_.reset(); mojo_ipc_support_.reset();
{ // Must be size_t so we can subtract from it.
base::ThreadRestrictions::ScopedAllowWait allow_wait_for_join; for (size_t thread_id = BrowserThread::ID_COUNT - 1;
thread_id >= (BrowserThread::UI + 1);
// Must be size_t so we can subtract from it. --thread_id) {
for (size_t thread_id = BrowserThread::ID_COUNT - 1; // Find the thread object we want to stop. Looping over all valid
thread_id >= (BrowserThread::UI + 1); --thread_id) { // BrowserThread IDs and DCHECKing on a missing case in the switch
// Find the thread object we want to stop. Looping over all valid // statement helps avoid a mismatch between this code and the
// BrowserThread IDs and DCHECKing on a missing case in the switch // BrowserThread::ID enumeration.
// statement helps avoid a mismatch between this code and the //
// BrowserThread::ID enumeration. // The destruction order is the reverse order of occurrence in the
// // BrowserThread::ID list. The rationale for the order is as
// The destruction order is the reverse order of occurrence in the // follows (need to be filled in a bit):
// BrowserThread::ID list. The rationale for the order is as follows (need //
// to be filled in a bit): //
// // - The IO thread is the only user of the CACHE thread.
// - The IO thread is the only user of the CACHE thread. //
// // - The PROCESS_LAUNCHER thread must be stopped after IO in case
// - The PROCESS_LAUNCHER thread must be stopped after IO in case // the IO thread posted a task to terminate a process on the
// the IO thread posted a task to terminate a process on the // process launcher thread.
// process launcher thread. //
// // - (Not sure why DB stops last.)
// - (Not sure why DB stops last.) switch (thread_id) {
switch (thread_id) { case BrowserThread::DB: {
case BrowserThread::DB: { TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:DBThread");
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:DBThread"); ResetThread_DB(std::move(db_thread_));
ResetThread_DB(std::move(db_thread_)); break;
break;
}
case BrowserThread::FILE: {
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:FileThread");
// Clean up state that lives on or uses the FILE thread before it goes
// away.
save_file_manager_->Shutdown();
ResetThread_FILE(std::move(file_thread_));
break;
}
case BrowserThread::FILE_USER_BLOCKING: {
TRACE_EVENT0("shutdown",
"BrowserMainLoop::Subsystem:FileUserBlockingThread");
ResetThread_FILE_USER_BLOCKING(std::move(file_user_blocking_thread_));
break;
}
case BrowserThread::PROCESS_LAUNCHER: {
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:LauncherThread");
ResetThread_PROCESS_LAUNCHER(std::move(process_launcher_thread_));
break;
}
case BrowserThread::CACHE: {
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:CacheThread");
ResetThread_CACHE(std::move(cache_thread_));
break;
}
case BrowserThread::IO: {
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:IOThread");
ResetThread_IO(std::move(io_thread_));
break;
}
case BrowserThread::UI:
case BrowserThread::ID_COUNT:
NOTREACHED();
break;
} }
case BrowserThread::FILE: {
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:FileThread");
// Clean up state that lives on or uses the FILE thread before it goes
// away.
save_file_manager_->Shutdown();
ResetThread_FILE(std::move(file_thread_));
break;
}
case BrowserThread::FILE_USER_BLOCKING: {
TRACE_EVENT0("shutdown",
"BrowserMainLoop::Subsystem:FileUserBlockingThread");
ResetThread_FILE_USER_BLOCKING(std::move(file_user_blocking_thread_));
break;
}
case BrowserThread::PROCESS_LAUNCHER: {
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:LauncherThread");
ResetThread_PROCESS_LAUNCHER(std::move(process_launcher_thread_));
break;
}
case BrowserThread::CACHE: {
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:CacheThread");
ResetThread_CACHE(std::move(cache_thread_));
break;
}
case BrowserThread::IO: {
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:IOThread");
ResetThread_IO(std::move(io_thread_));
break;
}
case BrowserThread::UI:
case BrowserThread::ID_COUNT:
NOTREACHED();
break;
} }
{ }
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:IndexedDBThread"); {
ResetThread_IndexedDb(std::move(indexed_db_thread_)); TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:IndexedDBThread");
} ResetThread_IndexedDb(std::move(indexed_db_thread_));
}
// Close the blocking I/O pool after the other threads. Other threads such // Close the blocking I/O pool after the other threads. Other threads such
// as the I/O thread may need to schedule work like closing files or // as the I/O thread may need to schedule work like closing files or flushing
// flushing data during shutdown, so the blocking pool needs to be // data during shutdown, so the blocking pool needs to be available. There
// available. There may also be slow operations pending that will blcok // may also be slow operations pending that will blcok shutdown, so closing
// shutdown, so closing it here (which will block until required operations // it here (which will block until required operations are complete) gives
// are complete) gives more head start for those operations to finish. // more head start for those operations to finish.
{ {
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:ThreadPool"); TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:ThreadPool");
BrowserThreadImpl::ShutdownThreadPool(); BrowserThreadImpl::ShutdownThreadPool();
} }
{ {
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:TaskScheduler"); TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:TaskScheduler");
base::TaskScheduler::GetInstance()->Shutdown(); base::TaskScheduler::GetInstance()->Shutdown();
}
} }
// Must happen after the IO thread is shutdown since this may be accessed from // Must happen after the IO thread is shutdown since this may be accessed from
......
...@@ -365,7 +365,6 @@ ...@@ -365,7 +365,6 @@
{ {
"name": "Default", "name": "Default",
"params": { "params": {
"RedirectNonUINonIOBrowserThreads": "true",
"RedirectSequencedWorkerPools": "true" "RedirectSequencedWorkerPools": "true"
} }
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment