| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <tchar.h> | 6 #include <tchar.h> |
| 7 | 7 |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "chrome/app/breakpad_win.h" | 10 #include "chrome/app/breakpad_win.h" |
| 11 #include "chrome/app/client_util.h" | 11 #include "chrome/app/client_util.h" |
| 12 #include "content/public/app/startup_helper_win.h" | 12 #include "content/public/app/startup_helper_win.h" |
| 13 #include "content/public/common/result_codes.h" | 13 #include "content/public/common/result_codes.h" |
| 14 #include "sandbox/src/sandbox_factory.h" | 14 #include "sandbox/src/sandbox_factory.h" |
| 15 | 15 |
| 16 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { | 16 //int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { |
| 17 int main() { |
| 18 HINSTANCE instance = (HINSTANCE)GetModuleHandle(NULL); |
| 19 // base::EnableTerminationOnHeapCorruption(); |
| 20 |
| 17 bool exit_now = true; | 21 bool exit_now = true; |
| 18 // We restarted because of a previous crash. Ask user if we should relaunch. | 22 // We restarted because of a previous crash. Ask user if we should relaunch. |
| 19 if (ShowRestartDialogIfCrashed(&exit_now)) { | 23 if (ShowRestartDialogIfCrashed(&exit_now)) { |
| 20 if (exit_now) | 24 if (exit_now) |
| 21 return content::RESULT_CODE_NORMAL_EXIT; | 25 return content::RESULT_CODE_NORMAL_EXIT; |
| 22 } | 26 } |
| 23 | 27 |
| 24 // Initialize the sandbox services. | 28 // Initialize the sandbox services. |
| 25 sandbox::SandboxInterfaceInfo sandbox_info = {0}; | 29 sandbox::SandboxInterfaceInfo sandbox_info = {0}; |
| 26 content::InitializeSandboxInfo(&sandbox_info); | 30 content::InitializeSandboxInfo(&sandbox_info); |
| 27 | 31 |
| 28 // The exit manager is in charge of calling the dtors of singletons. | 32 // The exit manager is in charge of calling the dtors of singletons. |
| 29 base::AtExitManager exit_manager; | 33 base::AtExitManager exit_manager; |
| 30 | 34 |
| 31 // Initialize the commandline singleton from the environment. | 35 // Initialize the commandline singleton from the environment. |
| 32 CommandLine::Init(0, NULL); | 36 CommandLine::Init(0, NULL); |
| 33 | 37 |
| 34 // Load and launch the chrome dll. *Everything* happens inside. | 38 // Load and launch the chrome dll. *Everything* happens inside. |
| 35 MainDllLoader* loader = MakeMainDllLoader(); | 39 MainDllLoader* loader = MakeMainDllLoader(); |
| 36 int rc = loader->Launch(instance, &sandbox_info); | 40 int rc = loader->Launch(instance, &sandbox_info); |
| 37 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); | 41 loader->RelaunchChromeBrowserWithNewCommandLineIfNeeded(); |
| 38 delete loader; | 42 delete loader; |
| 39 | 43 |
| 40 return rc; | 44 return rc; |
| 41 } | 45 } |
| OLD | NEW |