New issue
Advanced search Search tips

Issue 781886 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

ui::Gpu can't handle async to sync transition

Project Member Reported by kylec...@chromium.org, Nov 6 2017

Issue description

There is a bug in ui::Gpu when EstablishGpuChannel() is called and then before the response from the request arrives EstablishGpuChannelSync() is called. The desired behaviour is that EstablishGpuChannelSync() will block and when response arrives, the callback(s) from EstablishGpuChannel() will fire and then EstablishGpuChannelSync() will return. Instead, a second request is sent when EstablishGpuChannelSync() is called. This will crash later when the second GPU channel request finishes.
 

Comment 1 by laforge@google.com, Nov 8 2017

Components: -Internals>Viz Internals>Services>Viz
Migrating from Internals>Viz to Internals>Services>Viz.
Project Member

Comment 2 by bugdroid1@chromium.org, Nov 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d845f65b05de276ba9184f8ef66bf2f7d4049a70

commit d845f65b05de276ba9184f8ef66bf2f7d4049a70
Author: kylechar <kylechar@chromium.org>
Date: Fri Nov 10 21:44:14 2017

Fix ui::Gpu async to sync transition.

There is a bug in ui::Gpu when EstablishGpuChannel() is called and then
before the response from the request arrives EstablishGpuChannelSync()
is called. The desired behaviour is that EstablishGpuChannelSync() will
block and when response arrives, the callback(s) from
EstablishGpuChannel() will fire and then EstablishGpuChannelSync() will
return. Instead, a second request is sent when EstablishGpuChannelSync()
is called. This will crash later when the second GPU channel request
finishes.

In order to accomplish this async to sync transition, part of ui::Gpu
has to live on the IO thread. ui::mojom::Gpu is bound to the IO thread,
so that the response from EstablishGpuChannel() is received on the IO
thread. This allows the main thread to block waiting for a response.
This is similar to how BrowserGpuChannelHostFactory works.

This also means the synchronous mojo call is no longer used and can be
removed.

Bug:  781886 
Change-Id: I9b1f7c3c8f145dad6940e9338c50c1c14382fc31
Reviewed-on: https://chromium-review.googlesource.com/753938
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515693}
[modify] https://crrev.com/d845f65b05de276ba9184f8ef66bf2f7d4049a70/services/ui/public/cpp/gpu/gpu.cc
[modify] https://crrev.com/d845f65b05de276ba9184f8ef66bf2f7d4049a70/services/ui/public/cpp/gpu/gpu.h
[modify] https://crrev.com/d845f65b05de276ba9184f8ef66bf2f7d4049a70/services/ui/public/cpp/tests/gpu_unittest.cc
[modify] https://crrev.com/d845f65b05de276ba9184f8ef66bf2f7d4049a70/services/ui/public/interfaces/gpu.mojom

Status: Fixed (was: Started)

Sign in to add a comment