Closed Bug 1016196 Opened 11 years ago Closed 10 years ago

Add Promise support in BluetoothReplyRunnable

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: yrliou, Assigned: ben.tian)

References

Details

(Whiteboard: webbt-api)

Attachments

(2 files, 4 obsolete files)

Need to revise BluetoothReplyRunnable because we use Promise instead of DOM request in WebBluetoothAPIv2.
Whiteboard: webbt-api
Attached patch WIP patch (v1) (obsolete) — Splinter Review
Assignee: nobody → btian
Attached patch Dev patch (v1) (obsolete) — Splinter Review
Depends on: webbt-api-onoff
Attachment #8429962 - Attachment is obsolete: true
Attachment #8429964 - Attachment is obsolete: true
Attachment #8434634 - Flags: review?(echou)
Attachment #8434635 - Flags: review?(echou)
Blocks: 1006310
According to Bug1016560, Promise::MaybeReject() only accept nsresult and do not accept nsString anymore.
Rebase on Bug 1016560 to reject with NS_ERROR_DOM_OPERATION_ERR always.
Attachment #8434634 - Attachment is obsolete: true
Attachment #8434634 - Flags: review?(echou)
Attachment #8440549 - Flags: review?(echou)
Attachment #8434635 - Attachment is obsolete: true
Attachment #8434635 - Flags: review?(echou)
Attachment #8440551 - Flags: review?(echou)
Comment on attachment 8440549 [details] [diff] [review] Patch 1/2 (v2): Add Promise support in BluetoothReplyRunnable Review of attachment 8440549 [details] [diff] [review]: ----------------------------------------------------------------- r=me with questions answered. ::: dom/bluetooth2/BluetoothReplyRunnable.cpp @@ +110,5 @@ > > ReleaseMembers(); > MOZ_ASSERT(!mDOMRequest, > + "mDOMRequest is still alive! Deriving class should call " > + "BluetoothReplyRunnable::ReleaseMembers()!"); I don't really get this design. In fact we can just set mDOMRequest / mPromise to nullptr right before calling ReleaseMembers() instead of placing assertions here. Do I miss something?
Attachment #8440549 - Flags: review?(echou) → review+
(In reply to Eric Chou [:ericchou] [:echou] (GSMA MAE @ Shanghai, 6/10 ~ 6/13) from comment #8) > ::: dom/bluetooth2/BluetoothReplyRunnable.cpp > @@ +110,5 @@ > > > > ReleaseMembers(); > > MOZ_ASSERT(!mDOMRequest, > > + "mDOMRequest is still alive! Deriving class should call " > > + "BluetoothReplyRunnable::ReleaseMembers()!"); > > I don't really get this design. In fact we can just set mDOMRequest / > mPromise to nullptr right before calling ReleaseMembers() instead of placing > assertions here. Do I miss something? [1] still requires |ReleaseMembers| to revoke |BluetoothRequestParent::ReplyRunnable|. Let me check if we can bypass it. [1] http://dxr.mozilla.org/mozilla-central/source/dom/bluetooth/ipc/BluetoothParent.cpp#62
Attachment #8440551 - Flags: review?(echou) → review+
(In reply to Ben Tian [:btian] from comment #9) > http://dxr.mozilla.org/mozilla-central/source/dom/bluetooth/ipc/ > BluetoothParent.cpp#62 |ReleaseMember| is required as |Revoke| needs a function to reset member variables w/o destructing it. I'll keep the patch unchanged.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: