Chromium Code Reviews| 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 "content/public/app/content_main.h" | 5 #include "content/public/app/content_main.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "content/public/app/content_main_runner.h" | 8 #include "content/public/app/content_main_runner.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 #if defined(OS_WIN) | 12 int ContentMain(ContentMainParams* params) { |
|
sky
2014/03/07 23:14:22
Is it possible to make the various mains take a co
jam
2014/03/07 23:29:12
Done.
| |
| 13 int ContentMain(HINSTANCE instance, | |
| 14 sandbox::SandboxInterfaceInfo* sandbox_info, | |
| 15 ContentMainDelegate* delegate) { | |
| 16 #else | |
| 17 int ContentMain(int argc, | |
| 18 const char** argv, | |
| 19 ContentMainDelegate* delegate) { | |
| 20 #endif // OS_WIN | |
| 21 | |
| 22 scoped_ptr<ContentMainRunner> main_runner(ContentMainRunner::Create()); | 13 scoped_ptr<ContentMainRunner> main_runner(ContentMainRunner::Create()); |
| 23 | 14 |
| 24 int exit_code; | 15 int exit_code = main_runner->Initialize(params); |
| 25 | |
| 26 #if defined(OS_WIN) | |
| 27 exit_code = main_runner->Initialize(instance, sandbox_info, delegate); | |
| 28 #else | |
| 29 exit_code = main_runner->Initialize(argc, argv, delegate); | |
| 30 #endif // OS_WIN | |
| 31 | |
| 32 if (exit_code >= 0) | 16 if (exit_code >= 0) |
| 33 return exit_code; | 17 return exit_code; |
| 34 | 18 |
| 35 exit_code = main_runner->Run(); | 19 exit_code = main_runner->Run(); |
| 36 | 20 |
| 37 main_runner->Shutdown(); | 21 main_runner->Shutdown(); |
| 38 | 22 |
| 39 return exit_code; | 23 return exit_code; |
| 40 } | 24 } |
| 41 | 25 |
| 42 } // namespace content | 26 } // namespace content |
| OLD | NEW |