New issue
Advanced search Search tips

Issue 852517 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 802294



Sign in to add a comment

NavigatorGamepad::Gamepads() crashes on deleted page with UAv2

Project Member Reported by mustaq@chromium.org, Jun 13 2018

Issue description

When UAv2 is enabled, the function calls GetPage()->IsPageVisible() which is not accessible on a deleted page:
https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/gamepad/navigator_gamepad.cc?rcl=d86cdecad95e1a167095b1122b4c65f191731a48&l=209

We need to fix this.  This bug causes UAv2 test suite to fail for the following layout tests:
  fast/dom/navigator-detached-no-crash.html
  fast/dom/navigator-with-content-detached-no-crash.html
  gamepad/gamepad-detached-no-crash.html
  gamepad/gamepad-on-detached-navigator.html
  gamepad/gamepad-polling-access.html

 

Comment 1 by mustaq@chromium.org, Jun 13 2018

Blocking: 802294
Project Member

Comment 2 by bugdroid1@chromium.org, Jun 15 2018

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

commit d02b27dd39de3d62c9bf5e359636a2583bf8e7dd
Author: Matt Reynolds <mattreynolds@google.com>
Date: Fri Jun 15 18:28:29 2018

Avoid crash when checking gamepad user activation

The Gamepad API may be invoked after the frame has been detached, in
which case GetPage() and GetFrame() will be null. If the Gamepad API
was uninitialized before the frame was detached, the gamepads_ buffer
may also be null.

This CL adds more null checks to the user activation check to ensure
we do not try to access the page after it has been detached.

BUG= 852517 

Change-Id: I4d8152a9a16a027719d31150bd1b7687fdf991a0
Reviewed-on: https://chromium-review.googlesource.com/1101926
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567737}
[modify] https://crrev.com/d02b27dd39de3d62c9bf5e359636a2583bf8e7dd/third_party/blink/renderer/modules/gamepad/navigator_gamepad.cc

Status: Fixed (was: Assigned)
This change allows the layout tests in fast/dom and gamepad to pass with UserActivationV2 is enabled.
Project Member

Comment 4 by bugdroid1@chromium.org, Jun 25 2018

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

commit acd5edaad3c91b394d8fae3a2984880fc571f2a2
Author: Mustaq Ahmed <mustaq@google.com>
Date: Mon Jun 25 15:04:32 2018

[UAv2] Add a virtual suite for gamepad/, move an existing test here.

Change-Id: I6fb5914ede0c6741284b9962afb269a8c51ff175
Bug:  852517 , 855630
Reviewed-on: https://chromium-review.googlesource.com/1099602
Commit-Queue: Mustaq Ahmed <mustaq@chromium.org>
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570040}
[modify] https://crrev.com/acd5edaad3c91b394d8fae3a2984880fc571f2a2/third_party/WebKit/LayoutTests/VirtualTestSuites
[add] https://crrev.com/acd5edaad3c91b394d8fae3a2984880fc571f2a2/third_party/WebKit/LayoutTests/gamepad/full-screen-gamepad-expected.txt
[rename] https://crrev.com/acd5edaad3c91b394d8fae3a2984880fc571f2a2/third_party/WebKit/LayoutTests/gamepad/full-screen-gamepad.html
[modify] https://crrev.com/acd5edaad3c91b394d8fae3a2984880fc571f2a2/third_party/WebKit/LayoutTests/gamepad/gamepad-detached-no-crash-expected.txt
[modify] https://crrev.com/acd5edaad3c91b394d8fae3a2984880fc571f2a2/third_party/WebKit/LayoutTests/gamepad/gamepad-detached-no-crash.html
[modify] https://crrev.com/acd5edaad3c91b394d8fae3a2984880fc571f2a2/third_party/WebKit/LayoutTests/gamepad/gamepad-polling-access.html
[delete] https://crrev.com/413ffeb49b317213bb2350da21b19ec4607c50d0/third_party/WebKit/LayoutTests/user-activation-v2/full-screen-gamepad-expected.txt
[rename] https://crrev.com/acd5edaad3c91b394d8fae3a2984880fc571f2a2/third_party/WebKit/LayoutTests/virtual/user-activation-v2/gamepad/README.txt
[rename] https://crrev.com/acd5edaad3c91b394d8fae3a2984880fc571f2a2/third_party/WebKit/LayoutTests/virtual/user-activation-v2/gamepad/full-screen-gamepad-expected.txt

Sign in to add a comment