Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1588)

Unified Diff: ash/mus/bridge/wm_shell_mus.cc

Issue 2318223003: mash: Migrate wallpaper controllers to ash/common. (Closed)
Patch Set: Address comments. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/mus/bridge/wm_shell_mus.cc
diff --git a/ash/mus/bridge/wm_shell_mus.cc b/ash/mus/bridge/wm_shell_mus.cc
index 78959a48aad559e9114e08841a787df655b60d2d..36dc2c4e82bd03e5416aa34b4f0a909004962b46 100644
--- a/ash/mus/bridge/wm_shell_mus.cc
+++ b/ash/mus/bridge/wm_shell_mus.cc
@@ -113,7 +113,11 @@ WmShellMus::WmShellMus(
: WmShell(std::move(shell_delegate)),
window_manager_(window_manager),
pointer_watcher_event_router_(pointer_watcher_event_router),
- session_state_delegate_(new SessionStateDelegateStub) {
+ session_state_delegate_(new SessionStateDelegateStub),
+ blocking_pool_(
+ new base::SequencedWorkerPool(3 /* max_threads */,
+ "MashBlocking",
+ base::TaskPriority::USER_VISIBLE)) {
window_tree_client()->AddObserver(this);
WmShell::Set(this);
@@ -159,6 +163,13 @@ WmShellMus::~WmShellMus() {
if (window_tree_client())
window_tree_client()->RemoveObserver(this);
WmShell::Set(nullptr);
+
+ // Like BrowserThreadImpl, the goal is to make it impossible for ash to
+ // 'infinite loop' during shutdown, but to reasonably expect that all
+ // BLOCKING_SHUTDOWN tasks queued during shutdown get run. There's nothing
+ // particularly scientific about the number chosen.
+ const int kMaxNewShutdownBlockingTasks = 1000;
+ blocking_pool_->Shutdown(kMaxNewShutdownBlockingTasks);
}
// static
@@ -406,6 +417,10 @@ bool WmShellMus::IsTouchDown() {
return false;
}
+base::SequencedWorkerPool* WmShellMus::GetBlockingPool() {
+ return blocking_pool_.get();
+}
+
#if defined(OS_CHROMEOS)
void WmShellMus::ToggleIgnoreExternalKeyboard() {
NOTIMPLEMENTED();

Powered by Google App Engine
This is Rietveld 408576698