fixup! Implementation of Appcontrol functionalities 43/183443/3
authorsurya.kumar7 <surya.kumar7@samsung.com>
Thu, 5 Jul 2018 10:27:37 +0000 (15:57 +0530)
committersurya.kumar7 <surya.kumar7@samsung.com>
Thu, 5 Jul 2018 11:40:33 +0000 (17:10 +0530)
Somtimes RenderViews are created much before app_data's Initialize() was called
Moved Initialize() to resemble crosswalk's sequence

Cherry-picked from https://review.tizen.org/gerrit/#/c/183404/

Change-Id: Ib51b9f7028013bddca8cea0af010f311973539bd
Signed-off-by: surya.kumar7 <surya.kumar7@samsung.com>
atom/app/ui_runtime.cc
tizen/browser/tizen_browser_parts.cc

index 9bde160..b38b7ed 100644 (file)
@@ -56,6 +56,7 @@ void UiRuntime::SetParam(content::ContentMainParams *params) {
 
 bool UiRuntime::OnCreate() {
   auto appdata = common::ApplicationDataManager::GetCurrentAppData();
+  atom::Browser::Get()->Initialize();
   if(appdata->splash_screen_info()){
     atom::Browser* browser_model = atom::Browser::Get();
     browser_model->SetSplashScreen();
@@ -91,7 +92,6 @@ void UiRuntime::OnAppControl(app_control_h app_control) {
   if (browser_model->launched()) {
    browser_model->AppControl(std::move(appcontrol));
   } else {
-   browser_model->Initialize();
    browser_model->Launch(std::move(appcontrol));
   }
 }
index 231a9b3..d037cfc 100644 (file)
@@ -37,7 +37,7 @@ void TizenBrowserParts::Initialize() {
   resource_manager_->set_base_resource_path(app_data_->application_path());
 
   if (app_data_->csp_info() != NULL || app_data_->csp_report_info() != NULL ||
-    app_data_->allowed_navigation_info() != NULL) {
+      app_data_->allowed_navigation_info() != NULL) {
     security_model_version_ = 2;
     if (app_data_->csp_info() == NULL ||
         app_data_->csp_info()->security_rules().empty()) {
@@ -60,9 +60,10 @@ void TizenBrowserParts::GetCSP(std::string &csp_rule, std::string &csp_report_ru
 }
 
 void TizenBrowserParts::SetLongPollingTimeout(content::RenderViewHost* rvh) {
-  if (app_data_->setting_info() != NULL &&
-     app_data_->setting_info()->long_polling()) {
-    boost::optional <unsigned int> polling_val(app_data_->setting_info()->long_polling());
+  auto setting = app_data_->setting_info();
+  if (setting.get() != NULL &&
+      setting->long_polling()) {
+    boost::optional <unsigned int> polling_val(setting->long_polling());
     unsigned long *ptr =  reinterpret_cast <unsigned long *> (&polling_val.get());
     rvh->Send(new WrtViewMsg_SetLongPolling(rvh->GetRoutingID(), *ptr));
   }