Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Unified Diff: content/browser/frame_host/render_widget_host_view_guest.cc

Issue 1473913003: Restore original WebView SurfaceId after showing interstitial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add clarifying comment. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_widget_host_view_guest.cc
diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc
index 8971b07fad35b9e8b6f6c4467791655b3e6c4115..a32fe9fbcd2152786015df267b5e68b9c1485ad1 100644
--- a/content/browser/frame_host/render_widget_host_view_guest.cc
+++ b/content/browser/frame_host/render_widget_host_view_guest.cc
@@ -95,8 +95,22 @@ void RenderWidgetHostViewGuest::Show() {
// The two sizes may fall out of sync if we switch RenderWidgetHostViews,
// resize, and then switch page, as is the case with interstitial pages.
// NOTE: |guest_| is NULL in unit tests.
- if (guest_)
+ if (guest_) {
SetSize(guest_->web_contents()->GetViewBounds().size());
+ // Since we were last shown, our renderer may have had a different surface
+ // set (e.g. showing an interstitial), so we resend our current surface to
+ // the renderer.
+ if (!surface_id_.is_null()) {
+ cc::SurfaceSequence sequence = cc::SurfaceSequence(
+ id_allocator_->id_namespace(), next_surface_sequence_++);
+ GetSurfaceManager()
+ ->GetSurfaceForId(surface_id_)
+ ->AddDestructionDependency(sequence);
+ guest_->SetChildFrameSurface(surface_id_, current_surface_size_,
+ current_surface_scale_factor_,
+ sequence);
+ }
+ }
host_->WasShown(ui::LatencyInfo());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698