summaryrefslogtreecommitdiffstats
path: root/content/app/content_main.cc
blob: c82d7904da45b15f50a313c6b75dcab22bb6ce1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/public/app/content_main.h"

#include "base/memory/scoped_ptr.h"
#include "content/public/app/content_main_runner.h"

namespace content {

#if defined(OS_WIN)
int ContentMain(HINSTANCE instance,
                sandbox::SandboxInterfaceInfo* sandbox_info,
                ContentMainDelegate* delegate) {
#else
int ContentMain(int argc,
                const char** argv,
                ContentMainDelegate* delegate) {
#endif  // OS_WIN

  scoped_ptr<ContentMainRunner> main_runner(ContentMainRunner::Create());

  int exit_code;

#if defined(OS_WIN)
  exit_code = main_runner->Initialize(instance, sandbox_info, delegate);
#else
  exit_code = main_runner->Initialize(argc, argv, delegate);
#endif  // OS_WIN

  if (exit_code >= 0)
    return exit_code;

  exit_code = main_runner->Run();

  main_runner->Shutdown();

  return exit_code;
}

}  // namespace content