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

Unified Diff: tools/battor_agent/battor_agent_bin.cc

Issue 1524873002: Creates a BattOrConnection for communicating with the BattOr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added missing dep Created 5 years 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
« no previous file with comments | « tools/battor_agent/battor_agent.gyp ('k') | tools/battor_agent/battor_connection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/battor_agent/battor_agent_bin.cc
diff --git a/tools/battor_agent/battor_agent_bin.cc b/tools/battor_agent/battor_agent_bin.cc
index 26c855c6e870107755917d4f2e70524799f53ce0..5843ae906b10f6e3f97aaf7075808cda945e38ef 100644
--- a/tools/battor_agent/battor_agent_bin.cc
+++ b/tools/battor_agent/battor_agent_bin.cc
@@ -49,7 +49,7 @@ void PrintSupportsExplicitClockSync() {
std::string GetArg(int argnum, int argc, char* argv[]) {
if (argnum >= argc) {
PrintUsage();
- PLOG(FATAL);
+ exit(1);
}
return argv[argnum];
@@ -58,16 +58,13 @@ std::string GetArg(int argnum, int argc, char* argv[]) {
// Checks if an error occurred and, if it did, prints the error and exits
// with an error code.
void CheckError(battor::BattOrError error) {
- if (error != battor::BATTOR_ERROR_NONE) {
- LOG(ERROR) << "Fatal error when communicating with the BattOr: " << error;
- PLOG(FATAL);
- }
+ if (error != battor::BATTOR_ERROR_NONE)
+ LOG(FATAL) << "Fatal error when communicating with the BattOr: " << error;
}
// Prints an error message and exits due to a required thread failing to start.
void ExitFromThreadStartFailure(const std::string& thread_name) {
- LOG(ERROR) << "Failed to start " << thread_name;
- PLOG(FATAL);
+ LOG(FATAL) << "Failed to start " << thread_name;
}
} // namespace
@@ -84,9 +81,7 @@ class BattOrAgentBin : public BattOrAgent::Listener {
file_thread_(kFileThreadName),
ui_thread_(kUiThreadName) {}
- ~BattOrAgentBin() {
- DCHECK(!agent_);
- }
+ ~BattOrAgentBin() { DCHECK(!agent_); }
// Runs the BattOr binary and returns the exit code.
int Run(int argc, char* argv[]) {
« no previous file with comments | « tools/battor_agent/battor_agent.gyp ('k') | tools/battor_agent/battor_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698