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

Side by Side Diff: blimp/client/feature/compositor/blimp_input_manager.cc

Issue 2024723002: DO NOT COMMIT (will be split in sub-components) - clang-tidy WaitableEvent refactor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WEvent_enums
Patch Set: fix presubmits Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « base/trace_event/trace_sampling_thread.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "blimp/client/feature/compositor/blimp_input_manager.h" 5 #include "blimp/client/feature/compositor/blimp_input_manager.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 29 matching lines...) Expand all
40 FROM_HERE, 40 FROM_HERE,
41 base::Bind( 41 base::Bind(
42 &BlimpInputManager::CreateInputHandlerWrapperOnCompositorThread, 42 &BlimpInputManager::CreateInputHandlerWrapperOnCompositorThread,
43 base::Unretained(this), weak_factory_.GetWeakPtr(), 43 base::Unretained(this), weak_factory_.GetWeakPtr(),
44 input_handler)); 44 input_handler));
45 } 45 }
46 46
47 BlimpInputManager::~BlimpInputManager() { 47 BlimpInputManager::~BlimpInputManager() {
48 DCHECK(IsMainThread()); 48 DCHECK(IsMainThread());
49 49
50 base::WaitableEvent shutdown_event(false /* manual_reset */, 50 base::WaitableEvent shutdown_event(
51 false /* initially_signaled */); 51 base::WaitableEvent::ResetPolicy::AUTOMATIC,
52 base::WaitableEvent::InitialState::NOT_SIGNALED);
52 { 53 {
53 base::AutoReset<bool> auto_reset_main_thread_blocked( 54 base::AutoReset<bool> auto_reset_main_thread_blocked(
54 &main_thread_blocked_, true); 55 &main_thread_blocked_, true);
55 compositor_task_runner_->PostTask( 56 compositor_task_runner_->PostTask(
56 FROM_HERE, 57 FROM_HERE,
57 base::Bind( 58 base::Bind(
58 &BlimpInputManager::ShutdownOnCompositorThread, 59 &BlimpInputManager::ShutdownOnCompositorThread,
59 base::Unretained(this), &shutdown_event)); 60 base::Unretained(this), &shutdown_event));
60 shutdown_event.Wait(); 61 shutdown_event.Wait();
61 } 62 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 bool BlimpInputManager::IsMainThread() const { 146 bool BlimpInputManager::IsMainThread() const {
146 return main_task_runner_->BelongsToCurrentThread(); 147 return main_task_runner_->BelongsToCurrentThread();
147 } 148 }
148 149
149 bool BlimpInputManager::IsCompositorThread() const { 150 bool BlimpInputManager::IsCompositorThread() const {
150 return compositor_task_runner_->BelongsToCurrentThread(); 151 return compositor_task_runner_->BelongsToCurrentThread();
151 } 152 }
152 153
153 } // namespace client 154 } // namespace client
154 } // namespace blimp 155 } // namespace blimp
OLDNEW
« no previous file with comments | « base/trace_event/trace_sampling_thread.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698