Currently, there are 5 subclasses of PlatformEventController:
DeviceMotionController
DeviceOrientationController
BatteryManager
NavigatorGamepad
ScreenOrientationControllerImpl
Some of them get initialized with a nullptr Document*, which can lead to incorrect behaviour when the document is expected to have a valid frame.
Changes need to be made to initialize all the subclasses in a consistent way (https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/battery/navigator_battery.idl has an example of passing ScriptState which can then be used to get a frame).
Comment 1 by oksamyt@chromium.org
, Jun 22 2018