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

Side by Side Diff: remoting/host/win/host_service.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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file implements the Windows service controlling Me2Me host processes 5 // This file implements the Windows service controlling Me2Me host processes
6 // running within user sessions. 6 // running within user sessions.
7 7
8 #include "remoting/host/win/host_service.h" 8 #include "remoting/host/win/host_service.h"
9 9
10 #include <windows.h> 10 #include <windows.h>
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 std::list<RegisteredObserver>::const_iterator i; 129 std::list<RegisteredObserver>::const_iterator i;
130 for (i = observers_.begin(); i != observers_.end(); ++i) { 130 for (i = observers_.begin(); i != observers_.end(); ++i) {
131 if (i->observer == observer) { 131 if (i->observer == observer) {
132 observers_.erase(i); 132 observers_.erase(i);
133 return; 133 return;
134 } 134 }
135 } 135 }
136 } 136 }
137 137
138 HostService::HostService() : 138 HostService::HostService()
139 run_routine_(&HostService::RunAsService), 139 : run_routine_(&HostService::RunAsService),
140 service_status_handle_(0), 140 service_status_handle_(0),
141 stopped_event_(true, false), 141 stopped_event_(base::WaitableEvent::ResetPolicy::MANUAL,
142 weak_factory_(this) { 142 base::WaitableEvent::InitialState::NOT_SIGNALED),
143 } 143 weak_factory_(this) {}
144 144
145 HostService::~HostService() { 145 HostService::~HostService() {
146 } 146 }
147 147
148 void HostService::OnSessionChange(uint32_t event, uint32_t session_id) { 148 void HostService::OnSessionChange(uint32_t event, uint32_t session_id) {
149 DCHECK(main_task_runner_->BelongsToCurrentThread()); 149 DCHECK(main_task_runner_->BelongsToCurrentThread());
150 DCHECK_NE(session_id, kInvalidSessionId); 150 DCHECK_NE(session_id, kInvalidSessionId);
151 151
152 // Process only attach/detach notifications. 152 // Process only attach/detach notifications.
153 if (event != WTS_CONSOLE_CONNECT && event != WTS_CONSOLE_DISCONNECT && 153 if (event != WTS_CONSOLE_CONNECT && event != WTS_CONSOLE_DISCONNECT &&
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 int DaemonProcessMain() { 434 int DaemonProcessMain() {
435 HostService* service = HostService::GetInstance(); 435 HostService* service = HostService::GetInstance();
436 if (!service->InitWithCommandLine(base::CommandLine::ForCurrentProcess())) { 436 if (!service->InitWithCommandLine(base::CommandLine::ForCurrentProcess())) {
437 return kInvalidCommandLineExitCode; 437 return kInvalidCommandLineExitCode;
438 } 438 }
439 439
440 return service->Run(); 440 return service->Run();
441 } 441 }
442 442
443 } // namespace remoting 443 } // namespace remoting
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/bind_task_runner_unittest.cc ('k') | ui/views/mus/views_mus_test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698