Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Crash when visiting a webpage that uses Gamepads in a new WebProcess …
…after a previous page has used gamepads..

https://bugs.webkit.org/show_bug.cgi?id=167033

Reviewed by Alex Christensen.

* UIProcess/Gamepad/UIGamepadProvider.cpp:
(WebKit::UIGamepadProvider::processPoolStartedUsingGamepads): Don't schedule a state update here.
(WebKit::UIGamepadProvider::processPoolStoppedUsingGamepads): Ditto.
* UIProcess/Gamepad/UIGamepadProvider.h:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::startedUsingGamepads): Populate the WebProcess with initial gamepads.


Canonical link: https://commits.webkit.org/184134@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210761 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
beidson committed Jan 14, 2017
1 parent 3618a7a commit 20ed7c3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
15 changes: 15 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,18 @@
2017-01-13 Brady Eidson <beidson@apple.com>

Crash when visiting a webpage that uses Gamepads in a new WebProcess after a previous page has used gamepads..
https://bugs.webkit.org/show_bug.cgi?id=167033

Reviewed by Alex Christensen.

* UIProcess/Gamepad/UIGamepadProvider.cpp:
(WebKit::UIGamepadProvider::processPoolStartedUsingGamepads): Don't schedule a state update here.
(WebKit::UIGamepadProvider::processPoolStoppedUsingGamepads): Ditto.
* UIProcess/Gamepad/UIGamepadProvider.h:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::startedUsingGamepads): Populate the WebProcess with initial gamepads.

2017-01-11 Darin Adler <darin@apple.com>

Remove PassRefPtr from more of "platform"
Expand Down
4 changes: 0 additions & 4 deletions Source/WebKit2/UIProcess/Gamepad/UIGamepadProvider.cpp
Expand Up @@ -151,8 +151,6 @@ void UIGamepadProvider::processPoolStartedUsingGamepads(WebProcessPool& pool)

if (!m_isMonitoringGamepads && platformWebPageProxyForGamepadInput())
startMonitoringGamepads();

scheduleGamepadStateSync();
}

void UIGamepadProvider::processPoolStoppedUsingGamepads(WebProcessPool& pool)
Expand All @@ -162,8 +160,6 @@ void UIGamepadProvider::processPoolStoppedUsingGamepads(WebProcessPool& pool)

if (m_isMonitoringGamepads && !platformWebPageProxyForGamepadInput())
platformStopMonitoringInput();

scheduleGamepadStateSync();
}

void UIGamepadProvider::viewBecameActive(WebPageProxy& page)
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit2/UIProcess/Gamepad/UIGamepadProvider.h
Expand Up @@ -56,6 +56,8 @@ class UIGamepadProvider : public WebCore::GamepadProviderClient {
static void setUsesGameControllerFramework();
#endif

Vector<GamepadData> snapshotGamepads();

private:
friend NeverDestroyed<UIGamepadProvider>;
UIGamepadProvider();
Expand All @@ -77,8 +79,6 @@ class UIGamepadProvider : public WebCore::GamepadProviderClient {
void scheduleGamepadStateSync();
void gamepadSyncTimerFired();

Vector<GamepadData> snapshotGamepads();

HashSet<WebProcessPool*> m_processPoolsUsingGamepads;

Vector<std::unique_ptr<UIGamepad>> m_gamepads;
Expand Down
2 changes: 2 additions & 0 deletions Source/WebKit2/UIProcess/WebProcessPool.cpp
Expand Up @@ -1273,6 +1273,8 @@ void WebProcessPool::startedUsingGamepads(IPC::Connection& connection)

if (!wereAnyProcessesUsingGamepads)
UIGamepadProvider::singleton().processPoolStartedUsingGamepads(*this);

proxy->send(Messages::WebProcess::SetInitialGamepads(UIGamepadProvider::singleton().snapshotGamepads()), 0);
}

void WebProcessPool::stoppedUsingGamepads(IPC::Connection& connection)
Expand Down

0 comments on commit 20ed7c3

Please sign in to comment.