summaryrefslogtreecommitdiffstats
path: root/content/browser/browser_main.cc
blob: 99f8247b3e909d8801c079ecbf3ab68a1775227d (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
// 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/browser/browser_main.h"

#include "base/debug/trace_event.h"
#include "content/public/browser/browser_main_runner.h"

// Main routine for running as the Browser process.
int BrowserMain(const content::MainFunctionParams& parameters) {
  TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, "");

  scoped_ptr<content::BrowserMainRunner> main_runner_(
      content::BrowserMainRunner::Create());

  int exit_code = main_runner_->Initialize(parameters);
  if (exit_code >= 0)
    return exit_code;

  exit_code = main_runner_->Run();

  main_runner_->Shutdown();

  TRACE_EVENT_END_ETW("BrowserMain", 0, 0);

  return exit_code;
}