• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #include "content/public/app/content_main.h"
6 
7 #include "base/memory/scoped_ptr.h"
8 #include "content/public/app/content_main_runner.h"
9 
10 namespace content {
11 
12 #if defined(OS_WIN)
ContentMain(HINSTANCE instance,sandbox::SandboxInterfaceInfo * sandbox_info,ContentMainDelegate * delegate)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());
23 
24   int exit_code;
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)
33     return exit_code;
34 
35   exit_code = main_runner->Run();
36 
37   main_runner->Shutdown();
38 
39   return exit_code;
40 }
41 
42 }  // namespace content
43