Message from discussion
Alarm API proposals
Received: by 10.68.230.98 with SMTP id sx2mr13891244pbc.1.1336414851545;
Mon, 07 May 2012 11:20:51 -0700 (PDT)
Path: pr3ni15273pbb.0!nntp.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.mozilla.org!news.mozilla.org.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 07 May 2012 13:20:50 -0500
Return-Path: <mou...@lamouri.fr>
X-Original-To: dev-web...@lists.mozilla.org
Delivered-To: dev-web...@lists.mozilla.org
X-Virus-Scanned: amavisd-new at mozilla.org
Authentication-Results: notorious.mozilla.org (amavisd-new); dkim=pass
header...@messagingengine.com
Received-SPF: none (lamouri.fr: No applicable sender policy available)
receiver=notorious.mozilla.org; identity=mailfrom;
envelope-from="mou...@lamouri.fr";
helo=out3-smtp.messagingengine.com; client-ip=66.111.4.27
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
messagingengine.com; h=message-id:date:from:mime-version:to
:subject:references:in-reply-to:content-type
:content-transfer-encoding; s=smtpout; bh=Y3kIvXJaM37GJyeqQn8AaE
Zq6w4=; b=ddPxT/Gm7M9/kZuuADolLp3lBwBFjq/qgz+w7z9eV7aSrP9KDJWmhj
enRgLfOXi+sLBS3lrkJOPNOI2stNrfUmNefb1yKbdVkxzSr401dhGApVnaQP5Ut8
HVS3SiZ6//gZemiT94JSFer6HjfT20DaSnsKhtL1phat6+T0L2LkE=
X-Sasl-enc: 2smxr+HrYs+8QzwToByxBt7OgW5KmnW8utcaJ0hNVKMX 1336414834
Date: Mon, 07 May 2012 11:20:31 -0700
From: Mounir Lamouri <mou...@lamouri.fr>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
rv:10.0.1) Gecko/20120309 Thunderbird/10.0.1
MIME-Version: 1.0
To: dev-web...@lists.mozilla.org
Subject: Re: Alarm API proposals
References: <mailman.23950.1335527564.31724.dev-webapi@lists.mozilla.org>
<8762chlxwi.fsf@kanru-mozilla.corp.tpe1.mozilla.com>
<mailman.25565.1336155351.31724.dev-webapi@lists.mozilla.org>
<89bb3610-a780-49a5-8854-331a81c31ab4@ot8g2000pbb.googlegroups.com>
In-Reply-To: <89bb3610-a780-49a5-8854-331a81c31ab4@ot8g2000pbb.googlegroups.com>
X-BeenThere: dev-web...@lists.mozilla.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Development of APIs exposed to web pages as part of the B2G effort
<dev-webapi.lists.mozilla.org>
List-Unsubscribe: <https://lists.mozilla.org/options/dev-webapi>,
<mailto:dev-webapi-requ...@lists.mozilla.org?subject=unsubscribe>
List-Post: <mailto:dev-web...@lists.mozilla.org>
List-Help: <mailto:dev-webapi-requ...@lists.mozilla.org?subject=help>
List-Subscribe: <https://lists.mozilla.org/listinfo/dev-webapi>,
<mailto:dev-webapi-requ...@lists.mozilla.org?subject=subscribe>
Approved: dev-web...@lists.mozilla.org
Newsgroups: mozilla.dev.webapi
Message-ID: <mailman.26037.1336414850.31724.dev-web...@lists.mozilla.org>
Lines: 44
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 63.245.208.166
X-AuthenticatedUsername: NoAuthUser
X-Trace: sv3-0JiizxrOJJgZ5SZe8EbFPjdGwX7eQKMMpZsHsTxcZQ+5jsA+xNeBNOwriYNUURVJY3uKianMcpokK1J!qyENTwtWYdQNvdKB7yVWBmm1qm6VvbVPi2TF4te212a62dbcBTIZlcZ+W5/GrU4LqYo87Autehku!bQ1rQfrek/PrMRPRszSs2HK8oT+ekFHKHw==
X-Complaints-To: ab...@mozilla.org
X-DMCA-Complaints-To: ab...@mozilla.org
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 4887
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
On 05/07/2012 08:22 AM, Gene wrote:
> Mounir,
>
> You're right we could probably remove the "exact" since your suggested
> "respectTimezone" already implies the same meaning. Also, the "wakeup"
> can be removed since the alarm should always wake the device up in any
> way when it goes off. I'd like to have some quick questions based on
> your suggested interfaces:
>
> 1. I don't quite understand how to associate a new-added alarm with
> the AlarmsManager if we don't want to use navigator.alarm.save(new
> Alarm()) as Kanru originally suggested? Could you please elaborate
> more on this with a quick example in the JavaScript layer?
navigator.alarms.get(); // returns no alarm.
var a = new Alarm(/* set a date here */);
a.set();
navigator.alarms.get(); // returns |a| now.
> 2. What is the AlarmEvent used for? Is it just used for the
> association between AlarmsManager and Alarm addressed in #1?
It's to prevent the developers to keep a reference to the alarm objects
created. Actually, it might or might not be useful to get the alarm
object when the alarm is fired. It would probably be more useful if we
have a |data| attribute on |Alarm|.
> 3. Do the isSet()/set()/unset() functions within Alarm mean the
> current alarm is already attached to the AlarmsManager? Or all the
> created Alarm must be attached to the AlarmsManager by default and the
> "set" functions here mean if the attached alarm is enabled for go-off?
Alarms are not attached by default and set() (or .set = true;) should be
used to make it attached.
> 4. What is the expected return when calling navigator.alarms.get()?
A DOMRequest object with |.result| containing whether an iterator or a
|Alarm[]|.
--
Mounir