summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
authorfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-02 23:50:57 +0000
committerfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-02 23:50:57 +0000
commitc7a94521acf01bdf519bb57801fdbc3c2a50616d (patch)
treeed86ab44ba8c9b7340557c3aba552385209efdfa /content/renderer
parentf4025f54e37ab902f71ba0e3690a11e5719b5d39 (diff)
downloadchromium_src-c7a94521acf01bdf519bb57801fdbc3c2a50616d.zip
chromium_src-c7a94521acf01bdf519bb57801fdbc3c2a50616d.tar.gz
chromium_src-c7a94521acf01bdf519bb57801fdbc3c2a50616d.tar.bz2
Revert 209776 "Revert 209761 "Fix BrowserPluginHostTest.PartialA..."
speculative revert was speculative; test passed once before revert landed, and failed once after revert landed, so these are not the droids we're looking for. > Revert 209761 "Fix BrowserPluginHostTest.PartialAutosizeAttribut..." > Speculative revert to deal with new WebViewInteractiveTest.PopupPositioning crash (e.g. http://build.chromium.org/p/chromium.memory/buildstatus?builder=Mac%20ASAN%20Tests%20%283%29&number=9207 and http://build.chromium.org/p/chromium.mac/buildstatus?builder=Mac10.6%20Tests%20%281%29&number=42192) > > > Fix BrowserPluginHostTest.PartialAutosizeAttributes flake > > > > The compositing path was exiting BrowserPlugin::OnUpdateRect early > > and so updated autosize parameters weren't making it to BrowserPluginGuest. > > > > BUG=255591 > > Test=BrowserPluginHostTest.PartialAutosizeAttributes no longer flakes locally > > > > Review URL: https://chromiumcodereview.appspot.com/18223004 > > TBR=fsamuel@chromium.org > > Review URL: https://codereview.chromium.org/18566005 TBR=fischman@chromium.org Review URL: https://codereview.chromium.org/18054026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209821 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r--content/renderer/browser_plugin/browser_plugin.cc71
-rw-r--r--content/renderer/browser_plugin/browser_plugin_browsertest.cc2
2 files changed, 39 insertions, 34 deletions
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index daea2c4..d7f9c84 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -717,6 +717,7 @@ void BrowserPlugin::OnUpdateRect(
browser_plugin_manager()->Send(new BrowserPluginHostMsg_UpdateRect_ACK(
render_view_routing_id_,
guest_instance_id_,
+ true,
auto_size_params,
resize_guest_params));
return;
@@ -745,49 +746,51 @@ void BrowserPlugin::OnUpdateRect(
}
}
- // No more work to do since the guest is no longer using a damage buffer.
- if (!UsesDamageBuffer(params))
- return;
-
- // If we are seeing damage buffers, HW compositing should be turned off.
- EnableCompositing(false);
-
- // If we are now using a new damage buffer, then that means that the guest
- // has updated its size state in response to a resize request. We change
- // the backing store's size to accomodate the new damage buffer size.
- if (use_new_damage_buffer) {
- int backing_store_width = auto_size ? GetAdjustedMaxWidth() : width();
- int backing_store_height = auto_size ? GetAdjustedMaxHeight(): height();
- backing_store_.reset(
- new BrowserPluginBackingStore(
- gfx::Size(backing_store_width, backing_store_height),
- params.scale_factor));
- }
+ if (UsesDamageBuffer(params)) {
+
+ // If we are seeing damage buffers, HW compositing should be turned off.
+ EnableCompositing(false);
+
+ // If we are now using a new damage buffer, then that means that the guest
+ // has updated its size state in response to a resize request. We change
+ // the backing store's size to accomodate the new damage buffer size.
+ if (use_new_damage_buffer) {
+ int backing_store_width = auto_size ? GetAdjustedMaxWidth() : width();
+ int backing_store_height = auto_size ? GetAdjustedMaxHeight(): height();
+ backing_store_.reset(
+ new BrowserPluginBackingStore(
+ gfx::Size(backing_store_width, backing_store_height),
+ params.scale_factor));
+ }
- // If we just transitioned from the compositing path to the software path
- // then we might not yet have a damage buffer.
- if (current_damage_buffer_) {
- // Update the backing store.
- if (!params.scroll_rect.IsEmpty()) {
- backing_store_->ScrollBackingStore(params.scroll_delta,
- params.scroll_rect,
- params.view_size);
+ // If we just transitioned from the compositing path to the software path
+ // then we might not yet have a damage buffer.
+ if (current_damage_buffer_) {
+ // Update the backing store.
+ if (!params.scroll_rect.IsEmpty()) {
+ backing_store_->ScrollBackingStore(params.scroll_delta,
+ params.scroll_rect,
+ params.view_size);
+ }
+ backing_store_->PaintToBackingStore(params.bitmap_rect,
+ params.copy_rects,
+ current_damage_buffer_->memory());
+ // Invalidate the container.
+ // If the BrowserPlugin is scheduled to be deleted, then container_ will
+ // be NULL so we shouldn't attempt to access it.
+ if (container_)
+ container_->invalidate();
}
- backing_store_->PaintToBackingStore(params.bitmap_rect,
- params.copy_rects,
- current_damage_buffer_->memory());
- // Invalidate the container.
- // If the BrowserPlugin is scheduled to be deleted, then container_ will be
- // NULL so we shouldn't attempt to access it.
- if (container_)
- container_->invalidate();
}
+ // BrowserPluginHostMsg_UpdateRect_ACK is used by both the compositing and
+ // software paths to piggyback updated autosize parameters.
if (auto_size)
PopulateAutoSizeParameters(&auto_size_params, auto_size);
browser_plugin_manager()->Send(new BrowserPluginHostMsg_UpdateRect_ACK(
render_view_routing_id_,
guest_instance_id_,
+ UsesDamageBuffer(params),
auto_size_params,
resize_guest_params));
}
diff --git a/content/renderer/browser_plugin/browser_plugin_browsertest.cc b/content/renderer/browser_plugin/browser_plugin_browsertest.cc
index 0bdcf6f..ccf82e3 100644
--- a/content/renderer/browser_plugin/browser_plugin_browsertest.cc
+++ b/content/renderer/browser_plugin/browser_plugin_browsertest.cc
@@ -705,10 +705,12 @@ TEST_F(BrowserPluginTest, AutoSizeAttributes) {
ASSERT_TRUE(auto_size_msg);
int instance_id = 0;
+ bool needs_ack = false;
BrowserPluginHostMsg_AutoSize_Params auto_size_params;
BrowserPluginHostMsg_ResizeGuest_Params resize_params;
BrowserPluginHostMsg_UpdateRect_ACK::Read(auto_size_msg,
&instance_id,
+ &needs_ack,
&auto_size_params,
&resize_params);
EXPECT_FALSE(auto_size_params.enable);