Closed Bug 1100895 Opened 10 years ago Closed 10 years ago

[Telephony] add a promise attribute for ready event

Categories

(Firefox OS Graveyard :: RIL, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aknow, Assigned: aknow)

References

Details

Attachments

(3 files)

We now have a "ready" event on Telephony [1] to signal that the object is ready and the data inside is initialize properly.

I found that a better way to achieve the same purpose is to have a read only promise attribute.

interface Telephony {                                  
  [Throws]                                           
  readonly attribute Promise<void> ready; // or loaded
};    

Then we could use mozTelephony.ready.then(...)

AFAIK, ready event is not yet used in gaia code. Maybe now is a good chance to modify it.

[1] http://dxr.mozilla.org/mozilla-central/source/dom/webidl/Telephony.webidl?from=Telephony.webidl&case=true#50
Assignee: nobody → szchen
Attachment #8527516 - Flags: review?(htsai)
Comment on attachment 8527514 [details] [diff] [review]
Part 1: Replace 'ready' event by a readonly attribute 'ready'

Review of attachment 8527514 [details] [diff] [review]:
-----------------------------------------------------------------

The change makes much more sense, thank you!
Attachment #8527514 - Flags: review?(htsai) → review+
Comment on attachment 8527515 [details] [diff] [review]
Part 2: Implement ready attribute

Review of attachment 8527515 [details] [diff] [review]:
-----------------------------------------------------------------

Thank you!
Attachment #8527515 - Flags: review?(htsai) → review+
Comment on attachment 8527516 [details] [diff] [review]
Part 3: Modify test

Review of attachment 8527516 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!
Attachment #8527516 - Flags: review?(htsai) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: