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

Unified Diff: content/browser/web_contents/web_contents_view_android.cc

Issue 2487713002: Resolves layering violation in SynchronousCompositorHost creation (Closed)
Patch Set: comments Created 4 years, 1 month 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 | « content/browser/web_contents/web_contents_view_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_android.cc
diff --git a/content/browser/web_contents/web_contents_view_android.cc b/content/browser/web_contents/web_contents_view_android.cc
index e3b9d4ad53631b2a91caa1b4e1aa2bd54264310e..6980ea6bd589428f3d38fb15774a8caf65979a06 100644
--- a/content/browser/web_contents/web_contents_view_android.cc
+++ b/content/browser/web_contents/web_contents_view_android.cc
@@ -46,6 +46,21 @@ void WebContentsView::GetDefaultScreenInfo(ScreenInfo* results) {
results->is_monochrome = display.is_monochrome();
}
+// static
+void SynchronousCompositor::SetClientForWebContents(
+ WebContents* contents,
+ SynchronousCompositorClient* client) {
+ DCHECK(contents);
+ DCHECK(client);
+ WebContentsViewAndroid* wcva = static_cast<WebContentsViewAndroid*>(
+ static_cast<WebContentsImpl*>(contents)->GetView());
+ DCHECK(!wcva->synchronous_compositor_client());
+ wcva->set_synchronous_compositor_client(client);
+ RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>(
boliu 2016/11/08 17:41:05 probably needs null check
Jinsuk Kim 2016/11/08 18:05:54 Done.
+ contents->GetRenderWidgetHostView());
+ rwhv->set_synchronous_compositor_client(client);
+}
+
WebContentsView* CreateWebContentsView(
WebContentsImpl* web_contents,
WebContentsViewDelegate* delegate,
@@ -61,7 +76,8 @@ WebContentsViewAndroid::WebContentsViewAndroid(
WebContentsViewDelegate* delegate)
: web_contents_(web_contents),
content_view_core_(NULL),
- delegate_(delegate) {
+ delegate_(delegate),
+ synchronous_compositor_client_(nullptr) {
}
WebContentsViewAndroid::~WebContentsViewAndroid() {
@@ -184,7 +200,10 @@ RenderWidgetHostViewBase* WebContentsViewAndroid::CreateViewForWidget(
// order to paint it. See ContentView::GetRenderWidgetHostViewAndroid for an
// example of how this is achieved for InterstitialPages.
RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(render_widget_host);
- return new RenderWidgetHostViewAndroid(rwhi, content_view_core_);
+ RenderWidgetHostViewAndroid* rwhv =
+ new RenderWidgetHostViewAndroid(rwhi, content_view_core_);
+ rwhv->set_synchronous_compositor_client(synchronous_compositor_client_);
+ return rwhv;
}
RenderWidgetHostViewBase* WebContentsViewAndroid::CreateViewForPopupWidget(
« no previous file with comments | « content/browser/web_contents/web_contents_view_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698