BrowserPlugin: Reduce resize code repetition
BUG=none
Test=all tests pass.
Review URL: https://codereview.chromium.org/102243002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238456 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 6d28a5e..b869217 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -1428,15 +1428,10 @@
}
// Invalid damage buffer means we are in HW compositing mode,
// so just resize the WebContents and repaint if needed.
- if (!base::SharedMemory::IsHandleValid(params.damage_buffer_handle)) {
- if (!params.view_rect.size().IsEmpty())
- GetWebContents()->GetView()->SizeContents(params.view_rect.size());
- if (params.repaint)
- Send(new ViewMsg_Repaint(routing_id(), params.view_rect.size()));
- return;
- }
- SetDamageBuffer(params);
- GetWebContents()->GetView()->SizeContents(params.view_rect.size());
+ if (base::SharedMemory::IsHandleValid(params.damage_buffer_handle))
+ SetDamageBuffer(params);
+ if (!params.view_rect.size().IsEmpty())
+ GetWebContents()->GetView()->SizeContents(params.view_rect.size());
if (params.repaint)
Send(new ViewMsg_Repaint(routing_id(), params.view_rect.size()));
}