[M71 Dev][EFL] Fix crashes at webview launch
authorChandan Padhi <c.padhi@samsung.com>
Fri, 11 Jan 2019 06:20:40 +0000 (22:20 -0800)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Wed, 13 Mar 2019 05:50:22 +0000 (05:50 +0000)
This commit fixes the crashes/hangs at webview launch.

Change-Id: I9f29b148a44cbe885b4287562ba91b4ca4fc0db0
Signed-off-by: Chandan Padhi <c.padhi@samsung.com>
content/browser/browser_main_loop.cc
tizen_src/ewk/efl_integration/ewk_global_data.cc

index 2d21f28..b6a94c0 100644 (file)
@@ -544,7 +544,7 @@ BrowserMainLoop::BrowserMainLoop(
   g_current_browser_main_loop = this;
 
   if (GetContentClient()->browser()->ShouldCreateTaskScheduler()) {
-    base::TaskScheduler::Create("Browser");
+    DCHECK(base::TaskScheduler::GetInstance());
   }
 }
 
index 118a549..bcb3306 100644 (file)
@@ -4,13 +4,17 @@
 
 #include "ewk_global_data.h"
 
+#include "base/base_switches.h"
 #include "base/cpu.h"
+#include "base/feature_list.h"
 #include "base/logging.h"
 #include "base/message_loop/message_loop.h"
 #include "base/path_service.h"
 #include "browser/autofill/personal_data_manager_factory.h"
 #include "content/browser/gpu/gpu_process_host.h"
 #include "content/browser/renderer_host/render_process_host_impl.h"
+#include "content/browser/scheduler/browser_task_executor.h"
+#include "content/browser/startup_helper.h"
 #include "content/browser/utility_process_host.h"
 #include "content/gpu/in_process_gpu_thread.h"
 #include "content/public/app/content_main.h"
@@ -59,8 +63,7 @@ std::unique_ptr<base::MessagePump> MessagePumpFactory() {
 }  // namespace
 
 EwkGlobalData::EwkGlobalData()
-    : content_main_runner_(ContentMainRunner::Create()),
-      browser_main_runner_(BrowserMainRunner::Create()) {}
+    : content_main_runner_(ContentMainRunner::Create()) {}
 
 EwkGlobalData::~EwkGlobalData() {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -142,6 +145,18 @@ EwkGlobalData* EwkGlobalData::GetInstance() {
   ui::OzonePlatform::InitializeForUI(init_params);
 #endif
 
+  const base::CommandLine* command_line =
+      base::CommandLine::ForCurrentProcess();
+  base::FeatureList::InitializeInstance(
+      command_line->GetSwitchValueASCII(switches::kEnableFeatures),
+      command_line->GetSwitchValueASCII(switches::kDisableFeatures));
+
+  // Start TaskScheduler before creating BrowserMainLoop.
+  base::TaskScheduler::Create("Browser");
+  content::StartBrowserTaskScheduler();
+  content::BrowserTaskExecutor::Create();
+
+  instance_->browser_main_runner_ = BrowserMainRunner::Create();
   instance_->browser_main_runner_->Initialize(main_funtion_params);
 
   base::ThreadRestrictions::SetIOAllowed(true);