Closed Bug 1041440 Opened 5 years ago Closed 5 years ago

[Bluetooth] Call to private constructor of Promise

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
2.1 S1 (1aug)

People

(Reporter: tzimmermann, Assigned: tzimmermann)

Details

Attachments

(1 file)

When trying to build bluetooth2/, I get this:

In file included from ../../../../mozilla-central/dom/bluetooth2/BluetoothAdapter.h:13:0,
                 from ../../../../mozilla-central/dom/bluetooth2/BluetoothAdapter.cpp:22:
../../dist/include/mozilla/dom/Promise.h: In member function 'already_AddRefed<mozilla::dom::Promise> mozilla::dom::bluetooth::BluetoothAdapter::StopDiscovery(mozilla::ErrorResult&)':
../../dist/include/mozilla/dom/Promise.h:165:3: error: 'mozilla::dom::Promise::Promise(nsIGlobalObject*)' is private
../../../../mozilla-central/dom/bluetooth2/BluetoothAdapter.cpp:460:49: error: within this context
Assignee: nobody → tzimmermann
Status: NEW → ASSIGNED
Attachment #8459469 - Flags: review?(btian)
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #1)
> Created attachment 8459469 [details] [diff] [review]
> [01] Bug 1041440: Create Promise using |Promise::Create|

It's weird since many other places use |new Promise| [1] to create a promise. If that's the problem we should also revise other functions in bluetooth2/BluetoothAdapter.cpp (e.g., EnableDisable, SetName, SetDiscoverable, and startDiscovery).
[1] http://dxr.mozilla.org/mozilla-central/search?q=%22new+Promise%28%22+ext%3A.cpp&case=true&redirect=true 

Do you build bluetooth2 with bug 1039187 comment 2 change? Let me try to reproduce this bug.
Flags: needinfo?(tzimmermann)
> It's weird since many other places use |new Promise| [1] to create a
> promise. If that's the problem we should also revise other functions in
> bluetooth2/BluetoothAdapter.cpp (e.g., EnableDisable, SetName,
> SetDiscoverable, and startDiscovery).
> [1]
> http://dxr.mozilla.org/mozilla-central/search?q=%22new+Promise%28%22+ext%3A.
> cpp&case=true&redirect=true 

Wait I got it. Bug 1040263 patch missed promise in |stopDiscovery|. Thanks for finding this.
Flags: needinfo?(tzimmermann)
Comment on attachment 8459469 [details] [diff] [review]
[01] Bug 1041440: Create Promise using |Promise::Create|

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

LGTM.
Attachment #8459469 - Flags: review?(btian) → review+
https://hg.mozilla.org/mozilla-central/rev/753d801d019a
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S1 (1aug)
You need to log in before you can comment on or make changes to this bug.