Reorder the sequence of includes
[platform/framework/web/crosswalk-tizen.git] / runtime / browser / runtime_process.cc
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16
17 #include <ewk_chromium.h>
18
19 #include "common/command_line.h"
20 #include "common/logger.h"
21 #include "common/profiler.h"
22 #include "runtime/browser/runtime.h"
23
24 int main(int argc, char* argv[]) {
25   STEP_PROFILE_START("Start -> Launch Completed");
26   STEP_PROFILE_START("Start -> OnCreate");
27   // Parse commandline.
28   common::CommandLine::Init(argc, argv);
29
30   // Default behavior, run as runtime.
31   LOGGER(INFO) << "Runtime process has been created.";
32   ewk_init();
33   char* chromium_arg_options[] = {
34     argv[0],
35     const_cast<char*>("--no-sandbox"),
36     const_cast<char*>("--enable-file-cookies"),
37     const_cast<char*>("--allow-file-access-from-files"),
38     const_cast<char*>("--allow-universal-access-from-files")
39   };
40   const int chromium_arg_cnt =
41       sizeof(chromium_arg_options) / sizeof(chromium_arg_options[0]);
42   ewk_set_arguments(chromium_arg_cnt, chromium_arg_options);
43
44   int ret = 0;
45   // Runtime's destructor should be called before ewk_shutdown()
46   {
47     runtime::Runtime runtime;
48     ret = runtime.Exec(argc, argv);
49   }
50   ewk_shutdown();
51   exit(ret);
52
53   return EXIT_SUCCESS;
54 }