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

Side by Side Diff: remoting/host/win/host_service.cc

Issue 290173011: Cleanup: Use base::CommandLine in remoting/ (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 <sddl.h> 10 #include <sddl.h>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const wchar_t kComProcessMandatoryLabel[] = 58 const wchar_t kComProcessMandatoryLabel[] =
59 SDDL_SACL L":" 59 SDDL_SACL L":"
60 SDDL_ACE(SDDL_MANDATORY_LABEL, SDDL_NO_EXECUTE_UP, SDDL_ML_MEDIUM); 60 SDDL_ACE(SDDL_MANDATORY_LABEL, SDDL_NO_EXECUTE_UP, SDDL_ML_MEDIUM);
61 61
62 } // namespace 62 } // namespace
63 63
64 HostService* HostService::GetInstance() { 64 HostService* HostService::GetInstance() {
65 return Singleton<HostService>::get(); 65 return Singleton<HostService>::get();
66 } 66 }
67 67
68 bool HostService::InitWithCommandLine(const CommandLine* command_line) { 68 bool HostService::InitWithCommandLine(const base::CommandLine* command_line) {
69 CommandLine::StringVector args = command_line->GetArgs(); 69 base::CommandLine::StringVector args = command_line->GetArgs();
70 if (!args.empty()) { 70 if (!args.empty()) {
71 LOG(ERROR) << "No positional parameters expected."; 71 LOG(ERROR) << "No positional parameters expected.";
72 return false; 72 return false;
73 } 73 }
74 74
75 // Run interactively if needed. 75 // Run interactively if needed.
76 if (run_routine_ == &HostService::RunAsService && 76 if (run_routine_ == &HostService::RunAsService &&
77 command_line->HasSwitch(kConsoleSwitchName)) { 77 command_line->HasSwitch(kConsoleSwitchName)) {
78 run_routine_ = &HostService::RunInConsole; 78 run_routine_ = &HostService::RunInConsole;
79 } 79 }
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 // Run the service. 426 // Run the service.
427 self->RunAsServiceImpl(); 427 self->RunAsServiceImpl();
428 428
429 // Release the control handler and notify the main thread that it can exit 429 // Release the control handler and notify the main thread that it can exit
430 // now. 430 // now.
431 self->stopped_event_.Signal(); 431 self->stopped_event_.Signal();
432 } 432 }
433 433
434 int DaemonProcessMain() { 434 int DaemonProcessMain() {
435 HostService* service = HostService::GetInstance(); 435 HostService* service = HostService::GetInstance();
436 if (!service->InitWithCommandLine(CommandLine::ForCurrentProcess())) { 436 if (!service->InitWithCommandLine(base::CommandLine::ForCurrentProcess())) {
437 return kUsageExitCode; 437 return kUsageExitCode;
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 | « remoting/host/usage_stats_consent_mac.cc ('k') | remoting/host/win/launch_process_with_token.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698