Comment 55 for bug 604635

Revision history for this message
In , Kchen-d (kchen-d) wrote :

(In reply to Justin Lebar [:jlebar] from comment #23)
> Sorry, I don't quite understand.
>
> There should be two DOM APIs, right?

But how do we separate the two APIs?

> One is the API which the power manager uses. It has things like "put the
> phone to sleep", and "reboot the phone" which are not exposed to content.
> Only the power manager ever calls these functions.
>
> The other API is the one which content uses. The only function in this API,
> as far as I know, is requestWakeLock. Content uses this function to request
> that the CPU stay on, that the screen stay on, etc.

So far, yes. This is what above PowerManager does.

> The first API needs to have a function so that the power manager can tell
> whether any wake locks are currently held for a given topic.

A bit confusing here. When we talked about the power manager, do we mean the DOM object or the one will be in Gaia?

> I don't think we want each app implementing its own power manager, if that's
> what you're suggesting here. Otherwise, if there's only one power manager,
> how does an app get a pointer to it so it can call PowerManager.lock()?

There is only one power manager. Please forgive my ignorance, I do not quite understand how Gecko is layered yet. Who will monitor the idle time and manage the power state of each peripherals? I thought it was a object living in Gaia "chrome" and listening to the idle event.