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

Side by Side Diff: remoting/host/host_service_win.cc

Issue 10535082: /C++ readability/ - Make Chromoting Host report crashes to Breakpad (Windows only). The user must e… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | 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/host_service_win.h" 8 #include "remoting/host/host_service_win.h"
9 9
10 #include <windows.h> 10 #include <windows.h>
11 #include <wtsapi32.h> 11 #include <wtsapi32.h>
12 #include <stdio.h> 12 #include <stdio.h>
13 13
14 #include "base/at_exit.h" 14 #include "base/at_exit.h"
15 #include "base/base_paths.h" 15 #include "base/base_paths.h"
16 #include "base/bind.h" 16 #include "base/bind.h"
17 #include "base/command_line.h" 17 #include "base/command_line.h"
18 #include "base/file_util.h" 18 #include "base/file_util.h"
19 #include "base/logging.h" 19 #include "base/logging.h"
20 #include "base/message_loop.h" 20 #include "base/message_loop.h"
21 #include "base/path_service.h" 21 #include "base/path_service.h"
22 #include "base/stringize_macros.h" 22 #include "base/stringize_macros.h"
23 #include "base/stringprintf.h" 23 #include "base/stringprintf.h"
24 #include "base/threading/thread.h" 24 #include "base/threading/thread.h"
25 #include "base/win/wrapped_window_proc.h" 25 #include "base/win/wrapped_window_proc.h"
26 26 #include "remoting/base/breakpad.h"
27 #include "remoting/base/scoped_sc_handle_win.h" 27 #include "remoting/base/scoped_sc_handle_win.h"
28 #include "remoting/host/branding.h" 28 #include "remoting/host/branding.h"
29 #include "remoting/host/breakpad.h"
29 #include "remoting/host/host_service_resource.h" 30 #include "remoting/host/host_service_resource.h"
30 #include "remoting/host/wts_console_observer_win.h" 31 #include "remoting/host/wts_console_observer_win.h"
31 #include "remoting/host/wts_session_process_launcher_win.h" 32 #include "remoting/host/wts_session_process_launcher_win.h"
32 33
33 using base::StringPrintf; 34 using base::StringPrintf;
34 35
35 namespace { 36 namespace {
36 37
37 // Session id that does not represent any session. 38 // Session id that does not represent any session.
38 const uint32 kInvalidSession = 0xffffffff; 39 const uint32 kInvalidSession = 0xffffffff;
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 } 404 }
404 405
405 default: 406 default:
406 return DefWindowProc(hwnd, message, wparam, lparam); 407 return DefWindowProc(hwnd, message, wparam, lparam);
407 } 408 }
408 } 409 }
409 410
410 } // namespace remoting 411 } // namespace remoting
411 412
412 int main(int argc, char** argv) { 413 int main(int argc, char** argv) {
414 // Initializes the crash dump reports.
415 if (remoting::IsCrashReportingEnabled()) {
416 remoting::InitializeCrashReporting();
417 }
418
413 CommandLine::Init(argc, argv); 419 CommandLine::Init(argc, argv);
414 420
415 // This object instance is required by Chrome code (for example, 421 // This object instance is required by Chrome code (for example,
416 // FilePath, LazyInstance, MessageLoop). 422 // FilePath, LazyInstance, MessageLoop).
417 base::AtExitManager exit_manager; 423 base::AtExitManager exit_manager;
418 424
419 // Write logs to the application profile directory. 425 // Write logs to the application profile directory.
420 FilePath debug_log = remoting::GetConfigDir(). 426 FilePath debug_log = remoting::GetConfigDir().
421 Append(FILE_PATH_LITERAL("debug.log")); 427 Append(FILE_PATH_LITERAL("debug.log"));
422 InitLogging(debug_log.value().c_str(), 428 InitLogging(debug_log.value().c_str(),
(...skipping 11 matching lines...) Expand all
434 } 440 }
435 441
436 remoting::HostService* service = remoting::HostService::GetInstance(); 442 remoting::HostService* service = remoting::HostService::GetInstance();
437 if (!service->InitWithCommandLine(command_line)) { 443 if (!service->InitWithCommandLine(command_line)) {
438 usage(argv[0]); 444 usage(argv[0]);
439 return kUsageExitCode; 445 return kUsageExitCode;
440 } 446 }
441 447
442 return service->Run(); 448 return service->Run();
443 } 449 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698