Closed Bug 1153159 Opened 9 years ago Closed 9 years ago

[bluetooth2] Passing "promise" in the parameter list of |BT_ENSURE_TRUE_RESOLVE| and |BT_ENSURE_TRUE_REJECT|

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(firefox40 fixed)

RESOLVED FIXED
Tracking Status
firefox40 --- fixed

People

(Reporter: brsun, Assigned: brsun)

Details

Attachments

(1 file, 1 obsolete file)

|BT_ENSURE_TRUE_RESOLVE|[1] and |BT_ENSURE_TRUE_REJECT|[2] assume there is always has a variable named as "promise" on the stack. Passing the promise variable through the parameter list would be better than hard-coding the variable name within the macro.

[1] https://dxr.mozilla.org/mozilla-central/source/dom/bluetooth2/BluetoothCommon.h#122
[2] https://dxr.mozilla.org/mozilla-central/source/dom/bluetooth2/BluetoothCommon.h#134
Assignee: nobody → brsun
Attachment #8595728 - Flags: review?(btian)
Comment on attachment 8595728 [details] [diff] [review]
bug1153159_bluetooth2_pass_promise_in_macro.patch

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

r=me with comment addressed. Thanks!

::: dom/bluetooth/BluetoothCommon.h
@@ +130,5 @@
>    do {                                                               \
>      if (MOZ_UNLIKELY(!(x))) {                                        \
>        BT_API2_LOGR("BT_ENSURE_TRUE_RESOLVE(" #x ") failed");         \
>        promise->MaybeResolve(ret);                                    \
>        return promise.forget();                                       \

Add parentheses for |promise|.

@@ +142,5 @@
>    do {                                                               \
>      if (MOZ_UNLIKELY(!(x))) {                                        \
>        BT_API2_LOGR("BT_ENSURE_TRUE_REJECT(" #x ") failed");          \
>        promise->MaybeReject(ret);                                     \
>        return promise.forget();                                       \

Ditto.
Attachment #8595728 - Flags: review?(btian) → review+
Attachment #8595728 - Attachment is obsolete: true
Attachment #8596353 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/2537f573b7ab
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: