Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / content / shell / browser / shell_browser_main.cc
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
3 // found in the LICENSE file.
4
5 #include "content/shell/browser/shell_browser_main.h"
6
7 #include <iostream>
8
9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/message_loop/message_loop.h"
12 #include "content/public/browser/browser_main_runner.h"
13
14 #if defined(OS_ANDROID)
15 #include "base/run_loop.h"
16 #endif
17
18 // Main routine for running as the Browser process.
19 int ShellBrowserMain(
20     const content::MainFunctionParams& parameters,
21     const scoped_ptr<content::BrowserMainRunner>& main_runner) {
22   int exit_code = main_runner->Initialize(parameters);
23   DCHECK_LT(exit_code, 0)
24       << "BrowserMainRunner::Initialize failed in ShellBrowserMain";
25
26   if (exit_code >= 0)
27     return exit_code;
28
29 #if !defined(OS_ANDROID)
30   exit_code = main_runner->Run();
31
32   main_runner->Shutdown();
33 #endif
34
35   return exit_code;
36 }