Changeset 265160 in webkit
- Timestamp:
- Jul 31, 2020 3:14:04 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r265157 r265160 1 2020-07-31 Brady Eidson <beidson@apple.com> 2 3 Log a warning to the dev console when gamepads are accessed from an insecure context. 4 https://bugs.webkit.org/show_bug.cgi?id=214995 5 6 Reviewed by Tim Horton. 7 8 * http/tests/misc/gamepads-insecure-expected.txt: Added. 9 * http/tests/misc/gamepads-insecure.html: Added. 10 1 11 2020-07-31 Aditya Keerthi <akeerthi@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r265157 r265160 1 2020-07-31 Brady Eidson <beidson@apple.com> 2 3 Log a warning to the dev console when gamepads are accessed from an insecure context. 4 https://bugs.webkit.org/show_bug.cgi?id=214995 5 6 Reviewed by Tim Horton. 7 8 Test: http/tests/misc/gamepads-insecure.html 9 10 * Modules/gamepad/NavigatorGamepad.cpp: 11 (WebCore::NavigatorGamepad::getGamepads): Insecure contexts should log that getGamepads() will 12 be going away in a future release. Just do it once, because getGamepads() is called frequently. 13 1 14 2020-07-31 Aditya Keerthi <akeerthi@apple.com> 2 15 -
trunk/Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp
r248846 r265160 29 29 #if ENABLE(GAMEPAD) 30 30 31 #include "DOMWindow.h" 31 32 #include "Gamepad.h" 32 33 #include "GamepadManager.h" … … 74 75 const Vector<RefPtr<Gamepad>>& NavigatorGamepad::getGamepads(Navigator& navigator) 75 76 { 77 auto* domWindow = navigator.window(); 78 Document* document = domWindow ? domWindow->document() : nullptr; 79 if (!document) { 80 static NeverDestroyed<Vector<RefPtr<Gamepad>>> emptyGamepads; 81 return emptyGamepads; 82 } 83 84 if (!document->isSecureContext()) { 85 static std::once_flag onceFlag; 86 std::call_once(onceFlag, [document] { 87 document->addConsoleMessage(MessageSource::Security, MessageLevel::Warning, "Navigator.getGamepads() will be removed from insecure contexts in a future release"_s); 88 }); 89 90 } 91 76 92 return NavigatorGamepad::from(&navigator)->gamepads(); 77 93 }
Note: See TracChangeset
for help on using the changeset viewer.