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

Side by Side Diff: ui/views/mus/views_mus_test_suite.cc

Issue 2039943005: clang-tidy WaitableEvent refactor (Windows side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « remoting/host/win/host_service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/views/mus/views_mus_test_suite.h" 5 #include "ui/views/mus/views_mus_test_suite.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 base::WaitableEvent::InitialState::NOT_SIGNALED); 91 base::WaitableEvent::InitialState::NOT_SIGNALED);
92 thread_.task_runner()->PostTask( 92 thread_.task_runner()->PostTask(
93 FROM_HERE, base::Bind(&ShellConnection::TearDownConnections, 93 FROM_HERE, base::Bind(&ShellConnection::TearDownConnections,
94 base::Unretained(this), &wait)); 94 base::Unretained(this), &wait));
95 wait.Wait(); 95 wait.Wait();
96 } 96 }
97 97
98 private: 98 private:
99 shell::Connector* GetConnector() { 99 shell::Connector* GetConnector() {
100 shell_connector_.reset(); 100 shell_connector_.reset();
101 base::WaitableEvent wait(false, false); 101 base::WaitableEvent wait(base::WaitableEvent::ResetPolicy::AUTOMATIC,
102 base::WaitableEvent::InitialState::NOT_SIGNALED);
102 thread_.task_runner()->PostTask(FROM_HERE, 103 thread_.task_runner()->PostTask(FROM_HERE,
103 base::Bind(&ShellConnection::CloneConnector, 104 base::Bind(&ShellConnection::CloneConnector,
104 base::Unretained(this), &wait)); 105 base::Unretained(this), &wait));
105 wait.Wait(); 106 wait.Wait();
106 DCHECK(shell_connector_); 107 DCHECK(shell_connector_);
107 return shell_connector_.get(); 108 return shell_connector_.get();
108 } 109 }
109 110
110 void CloneConnector(base::WaitableEvent* wait) { 111 void CloneConnector(base::WaitableEvent* wait) {
111 shell_connector_ = shell_connection_->connector()->Clone(); 112 shell_connector_ = shell_connection_->connector()->Clone();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 ViewsTestSuite::Initialize(); 168 ViewsTestSuite::Initialize();
168 shell_connections_.reset(new ShellConnection); 169 shell_connections_.reset(new ShellConnection);
169 } 170 }
170 171
171 void ViewsMusTestSuite::Shutdown() { 172 void ViewsMusTestSuite::Shutdown() {
172 shell_connections_.reset(); 173 shell_connections_.reset();
173 ViewsTestSuite::Shutdown(); 174 ViewsTestSuite::Shutdown();
174 } 175 }
175 176
176 } // namespace views 177 } // namespace views
OLDNEW
« no previous file with comments | « remoting/host/win/host_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698