OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shell/browser/shell_browser_main.h" | 5 #include "content/shell/browser/shell_browser_main.h" |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "build/build_config.h" |
12 #include "content/public/browser/browser_main_runner.h" | 13 #include "content/public/browser/browser_main_runner.h" |
13 | 14 |
14 #if defined(OS_ANDROID) | 15 #if defined(OS_ANDROID) |
15 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
16 #endif | 17 #endif |
17 | 18 |
18 // Main routine for running as the Browser process. | 19 // Main routine for running as the Browser process. |
19 int ShellBrowserMain( | 20 int ShellBrowserMain( |
20 const content::MainFunctionParams& parameters, | 21 const content::MainFunctionParams& parameters, |
21 const scoped_ptr<content::BrowserMainRunner>& main_runner) { | 22 const scoped_ptr<content::BrowserMainRunner>& main_runner) { |
22 int exit_code = main_runner->Initialize(parameters); | 23 int exit_code = main_runner->Initialize(parameters); |
23 DCHECK_LT(exit_code, 0) | 24 DCHECK_LT(exit_code, 0) |
24 << "BrowserMainRunner::Initialize failed in ShellBrowserMain"; | 25 << "BrowserMainRunner::Initialize failed in ShellBrowserMain"; |
25 | 26 |
26 if (exit_code >= 0) | 27 if (exit_code >= 0) |
27 return exit_code; | 28 return exit_code; |
28 | 29 |
29 #if !defined(OS_ANDROID) | 30 #if !defined(OS_ANDROID) |
30 exit_code = main_runner->Run(); | 31 exit_code = main_runner->Run(); |
31 | 32 |
32 main_runner->Shutdown(); | 33 main_runner->Shutdown(); |
33 #endif | 34 #endif |
34 | 35 |
35 return exit_code; | 36 return exit_code; |
36 } | 37 } |
OLD | NEW |