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

Side by Side Diff: cloud_print/gcp20/prototype/gcp20_device.cc

Issue 735053002: Prefix CommandLine usage with base namespace (Part 7: cloud_print/) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <signal.h> 5 #include <signal.h>
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 g_message_loop->PostTask(FROM_HERE, base::Bind(&StopLoop)); 43 g_message_loop->PostTask(FROM_HERE, base::Bind(&StopLoop));
44 g_printer = NULL; 44 g_printer = NULL;
45 } 45 }
46 } 46 }
47 47
48 } // namespace 48 } // namespace
49 49
50 int main(int argc, char* argv[]) { 50 int main(int argc, char* argv[]) {
51 base::AtExitManager at_exit; 51 base::AtExitManager at_exit;
52 Printer printer; 52 Printer printer;
53 CommandLine::Init(argc, argv); 53 base::CommandLine::Init(argc, argv);
54 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
54 55
55 logging::LoggingSettings settings; 56 logging::LoggingSettings settings;
56 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; 57 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
57 logging::InitLogging(settings); 58 logging::InitLogging(settings);
58 59
59 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kHelp) || 60 if (command_line->HasSwitch(switches::kHelp) ||
60 CommandLine::ForCurrentProcess()->HasSwitch(switches::kHelpShort)) { 61 command_line->HasSwitch(switches::kHelpShort)) {
61 switches::PrintUsage(); 62 switches::PrintUsage();
62 return 0; 63 return 0;
63 } 64 }
64 65
65 signal(SIGINT, OnAbort); // Handle Ctrl+C signal. 66 signal(SIGINT, OnAbort); // Handle Ctrl+C signal.
66 67
67 base::MessageLoopForIO loop; 68 base::MessageLoopForIO loop;
68 g_message_loop = &loop; 69 g_message_loop = &loop;
69 g_message_loop->PostTask(FROM_HERE, base::Bind(&StartPrinter, &printer)); 70 g_message_loop->PostTask(FROM_HERE, base::Bind(&StartPrinter, &printer));
70 base::RunLoop runner; 71 base::RunLoop runner;
71 g_printer = &printer; 72 g_printer = &printer;
72 g_runner = &runner; 73 g_runner = &runner;
73 runner.Run(); 74 runner.Run();
74 75
75 return 0; 76 return 0;
76 } 77 }
77 78
OLDNEW
« no previous file with comments | « cloud_print/gcp20/prototype/dns_sd_server.cc ('k') | cloud_print/gcp20/prototype/print_job_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698