OLD | NEW |
---|---|
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 #include <atlbase.h> | 5 #include <atlbase.h> |
6 #include <atlcom.h> | 6 #include <atlcom.h> |
7 #include <atlctl.h> | 7 #include <atlctl.h> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 : public ATL::CAtlExeModuleT<ElevatedControllerModuleWin> { | 21 : public ATL::CAtlExeModuleT<ElevatedControllerModuleWin> { |
22 public: | 22 public: |
23 DECLARE_LIBID(LIBID_ChromotingElevatedControllerLib) | 23 DECLARE_LIBID(LIBID_ChromotingElevatedControllerLib) |
24 }; | 24 }; |
25 | 25 |
26 } // namespace remoting | 26 } // namespace remoting |
27 | 27 |
28 | 28 |
29 remoting::ElevatedControllerModuleWin _AtlModule; | 29 remoting::ElevatedControllerModuleWin _AtlModule; |
30 | 30 |
31 int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int command) { | 31 HINSTANCE g_hInstance = NULL; |
alexeypa (please no reviews)
2012/04/12 21:20:41
nit: g_hInstance -> g_instance
alexeypa (please no reviews)
2012/04/12 21:20:41
I believe you should be able to use _AtlModule.Get
simonmorris
2012/04/12 22:11:44
Done.
simonmorris
2012/04/12 22:11:44
This way is consistent with host_plugin.cc. Is the
alexeypa (please no reviews)
2012/04/12 23:10:33
This way you don't pollute the global namespace an
simonmorris
2012/04/13 00:11:50
Done.
| |
32 | |
33 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int command) { | |
alexeypa (please no reviews)
2012/04/12 21:20:41
nit: hInstance -> instance
simonmorris
2012/04/12 22:11:44
Done.
| |
32 CommandLine::Init(0, NULL); | 34 CommandLine::Init(0, NULL); |
33 | 35 |
36 g_hInstance = hInstance; | |
37 | |
34 // This object instance is required by Chrome code (for example, | 38 // This object instance is required by Chrome code (for example, |
35 // FilePath, LazyInstance, MessageLoop). | 39 // FilePath, LazyInstance, MessageLoop). |
36 base::AtExitManager exit_manager; | 40 base::AtExitManager exit_manager; |
37 | 41 |
38 // Write logs to the application profile directory. | 42 // Write logs to the application profile directory. |
39 FilePath debug_log = remoting::GetConfigDir(). | 43 FilePath debug_log = remoting::GetConfigDir(). |
40 Append(FILE_PATH_LITERAL("debug.log")); | 44 Append(FILE_PATH_LITERAL("debug.log")); |
41 InitLogging(debug_log.value().c_str(), | 45 InitLogging(debug_log.value().c_str(), |
42 logging::LOG_ONLY_TO_FILE, | 46 logging::LOG_ONLY_TO_FILE, |
43 logging::DONT_LOCK_LOG_FILE, | 47 logging::DONT_LOCK_LOG_FILE, |
44 logging::APPEND_TO_OLD_LOG_FILE, | 48 logging::APPEND_TO_OLD_LOG_FILE, |
45 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | 49 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); |
46 | 50 |
47 return _AtlModule.WinMain(command); | 51 return _AtlModule.WinMain(command); |
48 } | 52 } |
OLD | NEW |