Upstream version 7.35.139.0
[platform/framework/web/crosswalk.git] / src / content / browser / renderer_host / render_widget_host_impl.cc
index a882acc..e2fd3f9 100644 (file)
@@ -792,16 +792,23 @@ void RenderWidgetHostImpl::PauseForPendingResizeOrRepaints() {
   TRACE_EVENT0("browser",
       "RenderWidgetHostImpl::PauseForPendingResizeOrRepaints");
 
+  if (!CanPauseForPendingResizeOrRepaints())
+    return;
+
+  // Waiting for a backing store will do the wait for us.
+  ignore_result(GetBackingStore(true));
+}
+
+bool RenderWidgetHostImpl::CanPauseForPendingResizeOrRepaints() {
   // Do not pause if the view is hidden.
   if (is_hidden())
-    return;
+    return false;
 
   // Do not pause if there is not a paint or resize already coming.
   if (!repaint_ack_pending_ && !resize_ack_pending_ && !view_being_painted_)
-    return;
+    return false;
 
-  // Waiting for a backing store will do the wait for us.
-  ignore_result(GetBackingStore(true));
+  return true;
 }
 
 bool RenderWidgetHostImpl::TryGetBackingStore(const gfx::Size& desired_size,