W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2014

Re: [whatwg] Proposal: Wake Lock API

From: Jonas Sicking <jonas@sicking.cc>
Date: Thu, 14 Aug 2014 00:07:55 -0700
Message-ID: <CA+c2ei-Z-DqoXfvXaXBPadUx=nec8xZ2+c0nusOTWvBmkH1NNA@mail.gmail.com>
To: Biju <bijumaillist@gmail.com>
Cc: WHAT Working Group <whatwg@lists.whatwg.org>
On Wed, Aug 13, 2014 at 9:46 PM, Biju <bijumaillist@gmail.com> wrote:
> On 13 August 2014 21:00, Jonas Sicking <jonas@sicking.cc> wrote:
>> An alternative design would be something like
>> x = new WakeLock("display");
>> x.request();
>> x.release();
>> Extra calls of either request() or release() are ignored, but pages
>> can create any number of WakeLocks of the same type.
> If application made a x.request() then "x" got garbage collected
> system should automatically do x.release();

No. We don't want authors to come to rely on GC to have their locks
released. That would cause very erratic behavior where sometimes the
lock would be held for 2 seconds after the last reference to 'x' was
removed, and sometimes the lock would be held for 30 minutes past that

In other words, it would make GC observable. Not always observable by
the page, but by the user which can be just as bad.

/ Jonas
Received on Thursday, 14 August 2014 07:08:54 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:22 UTC