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

Side by Side Diff: tools/battor_agent/battor_agent_bin.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 | « sync/test/fake_server/fake_server_http_post_provider.cc ('k') | tools/gn/input_file_manager.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 // This file provides a thin binary wrapper around the BattOr Agent 5 // This file provides a thin binary wrapper around the BattOr Agent
6 // library. This binary wrapper provides a means for non-C++ tracing 6 // library. This binary wrapper provides a means for non-C++ tracing
7 // controllers, such as Telemetry and Android Systrace, to issue high-level 7 // controllers, such as Telemetry and Android Systrace, to issue high-level
8 // tracing commands to the BattOr through an interactive shell. 8 // tracing commands to the BattOr through an interactive shell.
9 // 9 //
10 // Example usage of how an external trace controller might use this binary: 10 // Example usage of how an external trace controller might use this binary:
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 142 }
143 143
144 io_thread_.task_runner()->PostTask( 144 io_thread_.task_runner()->PostTask(
145 FROM_HERE, 145 FROM_HERE,
146 base::Bind(&BattOrAgentBin::CreateAgent, base::Unretained(this), path, 146 base::Bind(&BattOrAgentBin::CreateAgent, base::Unretained(this), path,
147 base::ThreadTaskRunnerHandle::Get())); 147 base::ThreadTaskRunnerHandle::Get()));
148 } 148 }
149 149
150 // Performs any cleanup necessary after the BattOr binary is done running. 150 // Performs any cleanup necessary after the BattOr binary is done running.
151 void TearDown() { 151 void TearDown() {
152 base::WaitableEvent done(false, false); 152 base::WaitableEvent done(base::WaitableEvent::ResetPolicy::AUTOMATIC,
153 base::WaitableEvent::InitialState::NOT_SIGNALED);
153 io_thread_.task_runner()->PostTask( 154 io_thread_.task_runner()->PostTask(
154 FROM_HERE, base::Bind(&BattOrAgentBin::DeleteAgent, 155 FROM_HERE, base::Bind(&BattOrAgentBin::DeleteAgent,
155 base::Unretained(this), &done)); 156 base::Unretained(this), &done));
156 done.Wait(); 157 done.Wait();
157 } 158 }
158 159
159 void RunNextCommand() { 160 void RunNextCommand() {
160 std::string cmd; 161 std::string cmd;
161 std::getline(std::cin, cmd); 162 std::getline(std::cin, cmd);
162 163
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 }; 307 };
307 308
308 } // namespace battor 309 } // namespace battor
309 310
310 int main(int argc, char* argv[]) { 311 int main(int argc, char* argv[]) {
311 base::AtExitManager exit_manager; 312 base::AtExitManager exit_manager;
312 base::CommandLine::Init(argc, argv); 313 base::CommandLine::Init(argc, argv);
313 battor::BattOrAgentBin bin; 314 battor::BattOrAgentBin bin;
314 return bin.Run(argc, argv); 315 return bin.Run(argc, argv);
315 } 316 }
OLDNEW
« no previous file with comments | « sync/test/fake_server/fake_server_http_post_provider.cc ('k') | tools/gn/input_file_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698