Crash in fast/dom/navigator-detached-nocrash.html
authorkubo@profusion.mobi <kubo@profusion.mobi@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2012 22:03:20 +0000 (22:03 +0000)
committerkubo@profusion.mobi <kubo@profusion.mobi@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2012 22:03:20 +0000 (22:03 +0000)
commitfe1e90d873c2cac2e38ba4e503e31d7dc956b9a9
tree0f92887e858cc4cc5ea25b676d1510b681adbccd
parente920e362cabce29e3c5bd616aae2ba59c1963cbb
Crash in fast/dom/navigator-detached-nocrash.html
https://bugs.webkit.org/show_bug.cgi?id=81773

Reviewed by Adam Barth.

BatteryManager::create() blindly assumes the Navigator* it
receives has a valid Frame, which is not always the case, as made
evident by the crashing test.

Follow abarth's suggestion and just stop
NavigatorBattery::webkitBattery() before it reaches the call to
BatteryManager::create() if that's the case.

No new tests, covered by fast/dom/navigator-detached-nocrash.html.

* Modules/battery/NavigatorBattery.cpp:
(WebCore::NavigatorBattery::webkitBattery):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111770 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/battery/NavigatorBattery.cpp