#include "atom/app/runtime.h"
#include "atom/app/ui_runtime.h"
#include "atom/app/watch_runtime.h"
+#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/native_window_efl.h"
#include "base/logging.h"
#include "efl/window_factory.h"
namespace runtime {
+Runtime::Runtime() {
+ atom::AtomBrowserMainParts::SetNodeEnvironment();
+}
+
Runtime::~Runtime() {
}
class Runtime {
public:
+ Runtime();
virtual ~Runtime() = 0;
virtual int Exec() = 0;
#include "atom/app/atom_main_delegate.h"
#include "atom/app/ui_runtime.h"
-#include "atom/browser/browser.h"
#include "atom/browser/atom_browser_client.h"
#include "atom/browser/atom_browser_main_parts.h"
+#include "atom/browser/browser.h"
#include "atom/common/atom_command_line.h"
#include "base/logging.h"
#include "content/public/app/content_main.h"
-#include "tizen/common/app_db.h"
+#include "gin/v8_initializer.h"
#include "tizen/common/app_control.h"
-#include "tizen/common/constants.h"
+#include "tizen/common/app_db.h"
#include "tizen/common/application_data.h"
#include "tizen/common/command_line.h"
-
-#include "gin/v8_initializer.h"
+#include "tizen/common/constants.h"
namespace runtime {
-UiRuntime::UiRuntime(content::ContentMainParams *params) {
- _params = params;
-
- // This line's position is essential as this creates the Browser
- // object which is needed later on by ui_runtime in its ui_loop callbacks
- atom::AtomBrowserMainParts::SetNodeEnvironment();
+UiRuntime::UiRuntime(content::ContentMainParams *params)
+ : _params(params) {
}
UiRuntime::~UiRuntime() {
WatchRuntime::WatchRuntime(content::ContentMainParams *params)
: _params(params) {
- // This line's position is essential as this creates the Browser
- // object which is needed later on by watch_runtime in its watch_loop callbacks
- atom::AtomBrowserMainParts::SetNodeEnvironment();
}
WatchRuntime::~WatchRuntime() {
#include "content/public/app/content_main.h"
#include "atom/app/node_main.h"
+#include "atom/browser/atom_browser_main_parts.h"
#include "atom/common/atom_command_line.h"
#include "base/at_exit.h"
#include "base/i18n/icu_util.h"
#if defined(OS_TIZEN)
bool g_initialized_ = false;
-std::unique_ptr<runtime::Runtime> runtime_;
// For debug purpose only.
// TODO: To be removed later
base::CommandLine::Init(argc, argv);
}
+ std::unique_ptr<runtime::Runtime> runtime_;
common::CommandLine* runtime_cmd = common::CommandLine::ForCurrentProcess();
std::string appid = runtime_cmd->GetAppIdFromCommandLine("/usr/bin/wrt");
#if defined(OS_TIZEN)
if (hasTizenPackageID(argc,argv)) { // TODO: Check to be removed later
elm_init(argc, argv);
- if (!g_initialized_) {
- runtime_ = runtime::Runtime::MakeRuntime(¶ms);
- } else {
+ runtime_ = runtime::Runtime::MakeRuntime(¶ms);
+ if (g_initialized_) {
runtime_->SetParam(¶ms);
}
return runtime_->Exec();
params.argc = argc;
params.argv = const_cast<const char**>(argv);
atom::AtomCommandLine::Init(argc, argv);
- runtime_ = runtime::Runtime::MakeRuntime(nullptr);
+ atom::AtomBrowserMainParts::SetNodeEnvironment();
tizen::PreloadManager::GetInstance()->CreateCacheComponent();
return 0;
};