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