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

Issue 1254883006: Bubble scroll events from WebView guest to embedder. (Closed)

Created:
5 years, 4 months ago by wjmaclean
Modified:
5 years, 3 months ago
CC:
chromium-reviews, tdresser, Ian Vollick
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Bubble scroll events from WebView guest to embedder. This CL implements a synchronous scroll-bubbling pathway between an embedder and its guest. For scroll events (currently MouseWheel and GestureScrollBegin/Update/End), it passes relevant events to the guest, and waits to receive the event status (consumed, not consumed) back from the guest before BrowserPlugin indicates whether the event was handled or not. Although this blocks the embedder's main thread for scrolls, it is simpler to do this, and when OOPIF scrolling is implemented and WebView switches to use it, this pathway will disappear. For more details on scrolling event flow between embedder and guest, and for the rationale for implementing a synchronous solution, please refer to the "WebView" section at the end of: https://docs.google.com/document/d/1s6zuJaxet0fYs9isRnfS9Karad12GjxcgpT3ppbTjUQ/edit BUG=491940

Patch Set 1 #

Patch Set 2 : Complete test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+332 lines, -16 lines) Patch
M chrome/browser/apps/guest_view/web_view_browsertest.cc View 1 3 chunks +95 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/platform_apps/web_view/scrollable_embedder_and_guest/guest.html View 1 chunk +16 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/platform_apps/web_view/scrollable_embedder_and_guest/guest.js View 1 chunk +25 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/platform_apps/web_view/scrollable_embedder_and_guest/main.html View 1 chunk +13 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/platform_apps/web_view/scrollable_embedder_and_guest/main.js View 2 chunks +9 lines, -14 lines 0 comments Download
A chrome/test/data/extensions/platform_apps/web_view/scrollable_embedder_and_guest/manifest.json View 1 chunk +23 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/platform_apps/web_view/scrollable_embedder_and_guest/test.js View 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/browser_plugin/browser_plugin_guest.h View 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/browser_plugin/browser_plugin_guest.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_widget_host_view_guest.h View 1 chunk +6 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_widget_host_view_guest.cc View 1 chunk +25 lines, -0 lines 0 comments Download
M content/common/browser_plugin/browser_plugin_messages.h View 1 chunk +5 lines, -0 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin.h View 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin.cc View 2 chunks +20 lines, -1 line 0 comments Download
M content/renderer/browser_plugin/browser_plugin_manager.h View 4 chunks +12 lines, -0 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_manager.cc View 1 4 chunks +69 lines, -0 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 chunk +1 line, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 9 (2 generated)
wjmaclean
creis@ I still need to refine the issue description to make it clearer, but could ...
5 years, 4 months ago (2015-08-10 14:31:20 UTC) #2
Fady Samuel
This approach will not work. It will result in potential deadlocks. The guest can block ...
5 years, 4 months ago (2015-08-10 14:58:19 UTC) #4
wjmaclean
On 2015/08/10 14:58:19, Fady Samuel wrote: > This approach will not work. It will result ...
5 years, 4 months ago (2015-08-11 07:56:40 UTC) #5
Fady Samuel
On 2015/08/11 07:56:40, wjmaclean (OOO Aug 4-7) wrote: > On 2015/08/10 14:58:19, Fady Samuel wrote: ...
5 years, 4 months ago (2015-08-11 12:31:39 UTC) #6
Fady Samuel
On 2015/08/11 12:31:39, Fady Samuel wrote: > On 2015/08/11 07:56:40, wjmaclean (OOO Aug 4-7) wrote: ...
5 years, 4 months ago (2015-08-11 12:41:59 UTC) #7
wjmaclean
On 2015/08/11 12:41:59, Fady Samuel wrote: > On 2015/08/11 12:31:39, Fady Samuel wrote: > > ...
5 years, 4 months ago (2015-08-11 13:05:23 UTC) #8
wjmaclean
5 years, 3 months ago (2015-09-15 20:48:43 UTC) #9
On 2015/08/11 13:05:23, wjmaclean wrote:
> On 2015/08/11 12:41:59, Fady Samuel wrote:
> > On 2015/08/11 12:31:39, Fady Samuel wrote:
> > > On 2015/08/11 07:56:40, wjmaclean (OOO Aug 4-7) wrote:
> > > > On 2015/08/10 14:58:19, Fady Samuel wrote:
> > > > > This approach will not work. It will result in potential deadlocks.
The
> > > guest
> > > > > can block on the embedder (dialog API). If the embedder can also block
> on
> > > the
> > > > > guest, then we introduce the risk of deadlocks. Scroll bubbling must
be
> > > async.
> > > > 
> > > > Can you elaborate a bit on how the deadlocks would happen? You mention
> > dialog
> > > > API ... would the deadlock occur when a dialog in the embedder is
> triggered
> > on
> > > > some event that the guest is also expected to handle?
> > > > 
> > > > It would help me to rethink this if you could suggest some specific
> examples
> > > > (that I could eventually use as test cases).
> > > 
> > > It would deadlock when a dialog (alert/confirm/prompt) is initiated from
the
> > > guest. It would also lock up the embedder if the guest crashes. I had a
> > similar
> > > approach to this 4 years ago, and Darin and Rob asked me to drop it.
> > 
> > The exact deadlock situation with the dialog API is this.
> > 
> > 1. The guest sends out a FrameHostMsg_RunJavaScriptMessage.
> > 2. A scroll begins on the guest in the embedder before the embedder handles
> the
> > message above, and starts waiting on scroll response from the guest.
> > 3. DEADLOCK.
> > 
> > There are likely other deadlocks around plugin support. This is a
fundamental
> > issue of the web platform, modal dialogs are bad...
> 
> Thanks for the clarification ... that certainly is an undesirable scenario.
> 
> Unfortunately the ideas we've explored to date to allow asynchronous scroll
> bubbling all have challenges that appear to require major changes in the
current
> messaging system. With the re-design we'll need to do for OOPIF scrolling, it
> seems unattractive to do a big overhaul now that would be throw away work when
> the OOPIF changes land.
> 
> I'll continue to see if I can devise something both safe and lightweight for
the
> interim; it might be good if we arranged a time to chat about this (possibly
> early next week?)

Closing this issue as the approach is obsolete.

Powered by Google App Engine
This is Rietveld 408576698