Send |WrtViewMsg_ResumeScheduledTasks| IPC only if webview is suspended. 16/188116/2
authork2.nagaraju <k2.nagaraju@samsung.com>
Fri, 31 Aug 2018 10:04:49 +0000 (15:34 +0530)
committerk2.nagaraju <k2.nagaraju@samsung.com>
Fri, 31 Aug 2018 10:47:08 +0000 (16:17 +0530)
With this patch approximately 100 to 150ms time is reducing.

Change-Id: I77404f90de3784b262fd3d9bc7239fe0d1b28bb9
Signed-off-by: k2.nagaraju <k2.nagaraju@samsung.com>
tizen/browser/tizen_browser_parts.cc
tizen/browser/tizen_browser_parts.h

index 41bf8d5..d7c882a 100644 (file)
@@ -57,7 +57,8 @@ static bool ProcessWellKnownScheme(const std::string& url) {
 } // namespace
 
 TizenBrowserParts::TizenBrowserParts()
-    : locale_manager_(new common::LocaleManager()) {
+    : locale_manager_(new common::LocaleManager()),
+      is_suspended_(false) {
 }
 
 void TizenBrowserParts::Initialize() {
@@ -123,16 +124,18 @@ void TizenBrowserParts::RenderViewCreated(content::RenderViewHost* render_view_h
 }
 
 void TizenBrowserParts::Suspend(content::RenderViewHost* rvh) {
-  if(!rvh)
+  if (is_suspended_ || !rvh)
     return;
 
+  is_suspended_ = true;
   rvh->Send(new WrtViewMsg_SuspendScheduledTask(rvh->GetRoutingID()));
 }
 
 void TizenBrowserParts::Resume(content::RenderViewHost* rvh) {
-  if(!rvh)
+  if (!is_suspended_ || !rvh)
     return;
 
+  is_suspended_ = false;
   rvh->Send(new WrtViewMsg_ResumeScheduledTasks(rvh->GetRoutingID()));
 }
 
index 3ef4c97..19b7072 100644 (file)
@@ -52,6 +52,7 @@ class TizenBrowserParts {
 
   common::ApplicationData* app_data_;
   int security_model_version_;
+  bool is_suspended_;
   std::string csp_rule_;
   std::string csp_report_rule_;
 };