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

Unified Diff: content/browser/android/synchronous_compositor_host.cc

Issue 2487713002: Resolves layering violation in SynchronousCompositorHost creation (Closed)
Patch Set: 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
Index: content/browser/android/synchronous_compositor_host.cc
diff --git a/content/browser/android/synchronous_compositor_host.cc b/content/browser/android/synchronous_compositor_host.cc
index c0d33fbc765cfa4305ed9054b46c57b0c434746b..d3db2947411a7f771dfefb10d583f55df43614df 100644
--- a/content/browser/android/synchronous_compositor_host.cc
+++ b/content/browser/android/synchronous_compositor_host.cc
@@ -32,41 +32,23 @@
namespace content {
// static
-void SynchronousCompositor::SetClientForWebContents(
- WebContents* contents,
- SynchronousCompositorClient* client) {
- DCHECK(contents);
- DCHECK(client);
- WebContentsAndroid* web_contents_android =
- static_cast<WebContentsImpl*>(contents)->GetWebContentsAndroid();
- DCHECK(!web_contents_android->synchronous_compositor_client());
- web_contents_android->set_synchronous_compositor_client(client);
-}
-
-// static
std::unique_ptr<SynchronousCompositorHost> SynchronousCompositorHost::Create(
- RenderWidgetHostViewAndroid* rwhva,
- WebContents* web_contents) {
- DCHECK(web_contents);
- WebContentsAndroid* web_contents_android =
- static_cast<WebContentsImpl*>(web_contents)->GetWebContentsAndroid();
- if (!web_contents_android->synchronous_compositor_client())
+ RenderWidgetHostViewAndroid* rwhva) {
+ if (!rwhva->synchronous_compositor_client())
return nullptr; // Not using sync compositing.
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
bool use_in_proc_software_draw =
command_line->HasSwitch(switches::kSingleProcess);
return base::WrapUnique(new SynchronousCompositorHost(
- rwhva, web_contents_android->synchronous_compositor_client(),
- use_in_proc_software_draw));
+ rwhva, use_in_proc_software_draw));
}
SynchronousCompositorHost::SynchronousCompositorHost(
RenderWidgetHostViewAndroid* rwhva,
- SynchronousCompositorClient* client,
bool use_in_proc_software_draw)
: rwhva_(rwhva),
- client_(client),
+ client_(rwhva->synchronous_compositor_client()),
ui_task_runner_(BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)),
process_id_(rwhva_->GetRenderWidgetHost()->GetProcess()->GetID()),
routing_id_(rwhva_->GetRenderWidgetHost()->GetRoutingID()),

Powered by Google App Engine
This is Rietveld 408576698