- From: Jonas Sicking <jonas@sicking.cc>
- Date: Thu, 14 Aug 2014 13:55:37 -0700
- To: Biju <bijumaillist@gmail.com>
- Cc: WHAT Working Group <whatwg@lists.whatwg.org>
On Thu, Aug 14, 2014 at 4:44 AM, Biju <bijumaillist@gmail.com> wrote: > So what happens when we have following function call. > How do we release the runaway lock request. > Another case is a page made lock and user navigate away from the page. > Do the browser keep the lock for ever ? > > function xyz(){ > > do_something_1(); > > x = new WakeLock("display"); > x.request(); > > do_something_2(); > > throw "some runtime error occurred"; > > do_something_3(); > > x.release(); > > do_something_4(); > } Same thing as function xyz(){ do_something_1(); navigator.wakeLock.request("display") do_something_2(); throw "some runtime error occurred"; do_something_3(); navigator.wakeLock.release("display") do_something_4(); } I.e. the lock is held forever. / Jonas
Received on Thursday, 14 August 2014 20:56:32 UTC