Closed Bug 1009347 Opened 11 years ago Closed 11 years ago

Create dom/bluetooth2 folder for API refinement implementation

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.0 S2 (23may)

People

(Reporter: ben.tian, Assigned: yrliou)

References

Details

(Whiteboard: [webbt-api])

Attachments

(6 files, 7 obsolete files)

(deleted), patch
shawnjohnjr
: feedback+
Details | Diff | Splinter Review
(deleted), patch
Details | Diff | Splinter Review
(deleted), patch
Details | Diff | Splinter Review
(deleted), patch
Details | Diff | Splinter Review
(deleted), patch
bzbarsky
: review+
Details | Diff | Splinter Review
(deleted), patch
Details | Diff | Splinter Review
1) Create dom/bluetooth2 folder for API refinement and copy dom/bluetooth to dom/bluetooth2. 2) Modify dom/webidl/Bluetooth*.webidl and moz.build to build dom/bluetooth2 folder based on additional build flag. Jocelyn, please help on this bug. Thanks.
Attachment #8421516 - Attachment is patch: true
Attachment #8421516 - Attachment mime type: message/rfc822 → text/plain
Attachment #8421517 - Attachment description: Bug 1009347 Patch3: Using dom/bluetooth2 based on bluetooth API version build flagnewapi3 → Bug 1009347 Patch3: Using dom/bluetooth2 based on bluetooth API version build flag
Attachment #8421515 - Flags: feedback?(btian)
Attachment #8421516 - Flags: feedback?(btian)
Attachment #8421517 - Flags: feedback?(btian)
Attachment #8421518 - Flags: feedback?(btian)
Comment on attachment 8421522 [details] [diff] [review] (local patch) Bug 1009347 Patch5: Set BT API version to V2 Hi Shuang, May I ask that is this patch looks ok to you? Or there's a more suitable point to insert this build flag? Please let me know if you have any feedback. Thanks, Jocelyn
Attachment #8421522 - Flags: feedback?(shuang)
Comment on attachment 8421515 [details] [diff] [review] Bug 1009347 Patch1: Make copy of dom/bluetooth for API refinement Review of attachment 8421515 [details] [diff] [review]: ----------------------------------------------------------------- LGTM.
Attachment #8421515 - Flags: review?(echou)
Attachment #8421515 - Flags: feedback?(btian)
Attachment #8421515 - Flags: feedback+
Comment on attachment 8421516 [details] [diff] [review] Bug 1009347 Patch2: Using new bluetooth webidls based on bluetooth API version build flag Review of attachment 8421516 [details] [diff] [review]: ----------------------------------------------------------------- LGTM.
Attachment #8421516 - Flags: review?(echou)
Attachment #8421516 - Flags: feedback?(btian)
Attachment #8421516 - Flags: feedback+
Comment on attachment 8421517 [details] [diff] [review] Bug 1009347 Patch3: Using dom/bluetooth2 based on bluetooth API version build flag Review of attachment 8421517 [details] [diff] [review]: ----------------------------------------------------------------- LGTM.
Attachment #8421517 - Flags: review?(echou)
Attachment #8421517 - Flags: feedback?(btian)
Attachment #8421517 - Flags: feedback+
Comment on attachment 8421518 [details] [diff] [review] Bug 1009347 Patch4: Change binding headers in bluetooth2 for using new webidls Review of attachment 8421518 [details] [diff] [review]: ----------------------------------------------------------------- LGTM.
Attachment #8421518 - Flags: review?(echou)
Attachment #8421518 - Flags: feedback?(btian)
Attachment #8421518 - Flags: feedback+
Comment on attachment 8421516 [details] [diff] [review] Bug 1009347 Patch2: Using new bluetooth webidls based on bluetooth API version build flag Marcos, can you help review our webidl patches for WebBluetooth API refinement? This bug is to create another folder dom/bluetooth2 for the new API and build it according to additional build flag MOZ_B2G_BT_API_V2 (by default OFF). Two patches for review: - Patch2 is to create webidl files for the new API and build them according to build flag, and - Patch3 is to build dom/bluetooth2 when the build flag is set. Let us know for any question. Thanks.
Attachment #8421516 - Flags: review?(echou) → review?(marcos)
Attachment #8421517 - Flags: review?(echou) → review?(marcos)
(In reply to jocelyn [:jocelyn] from comment #6) > Comment on attachment 8421522 [details] [diff] [review] > (local patch) Bug 1009347 Patch5: Set BT API version to V2 > > Hi Shuang, > > May I ask that is this patch looks ok to you? > Or there's a more suitable point to insert this build flag? > Please let me know if you have any feedback. Add API flag is a little unusual, please add explanation when requesting review to mwu or glandium. For now, I think it's ok to use it.
Comment on attachment 8421516 [details] [diff] [review] Bug 1009347 Patch2: Using new bluetooth webidls based on bluetooth API version build flag Review of attachment 8421516 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/webidl/BluetoothAdapter2.webidl @@ +27,5 @@ > + // current track length (ms) > + long long duration = -1; > + // playing time (ms) > + long long position = -1; > + // one of 'STOPPED'/'PLAYING'/'PAUSED'/'FWD_SEEK'/'REV_SEEK'/'ERROR' You should create an enum for the playStatus, maybe call it PlayState. Make sure the states are in lower-case. { PlayState playState; } enum PlayState { "stopped", "playing", ...}; @@ +46,5 @@ > + > + // array of type DOMString[] > + [GetterThrows] > + readonly attribute any uuids; > + I guess there is some reason why you can't use the types in the comments above. @@ +65,5 @@ > + // Fired when remote devices query current media play status > + attribute EventHandler onrequestmediaplaystatus; > + > + [NewObject, Throws] > + DOMRequest setName(DOMString name); Just wondering, but given that we now have Promises, can't we start deprecating the use of DOMRequest? @@ +81,5 @@ > + DOMRequest unpair(DOMString deviceAddress); > + [NewObject, Throws] > + DOMRequest getPairedDevices(); > + [NewObject, Throws] > + DOMRequest getConnectedDevices(unsigned short serviceUuid); Aren't UUIDs strings? Applies globally for other serviceUuids. ::: dom/webidl/BluetoothDevice2.webidl @@ +3,5 @@ > +/* This Source Code Form is subject to the terms of the Mozilla Public > + * License, v. 2.0. If a copy of the MPL was not distributed with this file, > + * You can obtain one at http://mozilla.org/MPL/2.0/. */ > + > +interface BluetoothDevice : EventTarget { It's a bit strange that this implements EventTarget but doesn't have any EventHandler attributes? I would have expected some "attribute EventHandler onfoo;" listed in the IDL. @@ +17,5 @@ > + readonly attribute any uuids; > + > + // array of type DOMString[] > + [Throws] > + readonly attribute any services; It's not clear what kind of services will be returned? Is it a bunch of IDs or actual service names? ::: dom/webidl/BluetoothManager2.webidl @@ +4,5 @@ > + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ > + > +interface BluetoothManager : EventTarget { > + [Throws] > + readonly attribute boolean enabled; Seems a bit mean to throw when checking an attribute. @@ +13,5 @@ > + > + [Throws] > + boolean isConnected(unsigned short aProfile); > + [NewObject, Throws] > + DOMRequest? getDefaultAdapter(); Why does this return null? I think this should always return a DOMRequest that results in an error if there is no default adapter.
Sorry Marcos I didn't say it clear. This patch only creates a copy of existing bluetooth API webidl files (BluetoothManager.webidl, BluetoothAdapter.webidl, BluetoothDevice.idl). What we want to do is fork them first in this bug and start the refinement [1] based on them. We'd like to request for your review as this patch modifies files under dom/webidl/ and dom/ folders. Please let us know for any suggestion. Thanks. [1] https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2 (In reply to Marcos Caceres [:marcosc] from comment #13) > Comment on attachment 8421516 [details] [diff] [review] > Bug 1009347 Patch2: Using new bluetooth webidls based on bluetooth API > version build flag > > Review of attachment 8421516 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: dom/webidl/BluetoothAdapter2.webidl > @@ +27,5 @@ > > + // current track length (ms) > > + long long duration = -1; > > + // playing time (ms) > > + long long position = -1; > > + // one of 'STOPPED'/'PLAYING'/'PAUSED'/'FWD_SEEK'/'REV_SEEK'/'ERROR' > > You should create an enum for the playStatus, maybe call it PlayState. Make > sure the states are in lower-case. > > { > PlayState playState; > } > > enum PlayState { "stopped", "playing", ...}; > > @@ +46,5 @@ > > + > > + // array of type DOMString[] > > + [GetterThrows] > > + readonly attribute any uuids; > > + > > I guess there is some reason why you can't use the types in the comments > above. > > @@ +65,5 @@ > > + // Fired when remote devices query current media play status > > + attribute EventHandler onrequestmediaplaystatus; > > + > > + [NewObject, Throws] > > + DOMRequest setName(DOMString name); > > Just wondering, but given that we now have Promises, can't we start > deprecating the use of DOMRequest? > > @@ +81,5 @@ > > + DOMRequest unpair(DOMString deviceAddress); > > + [NewObject, Throws] > > + DOMRequest getPairedDevices(); > > + [NewObject, Throws] > > + DOMRequest getConnectedDevices(unsigned short serviceUuid); > > Aren't UUIDs strings? Applies globally for other serviceUuids. > > ::: dom/webidl/BluetoothDevice2.webidl > @@ +3,5 @@ > > +/* This Source Code Form is subject to the terms of the Mozilla Public > > + * License, v. 2.0. If a copy of the MPL was not distributed with this file, > > + * You can obtain one at http://mozilla.org/MPL/2.0/. */ > > + > > +interface BluetoothDevice : EventTarget { > > It's a bit strange that this implements EventTarget but doesn't have any > EventHandler attributes? I would have expected some "attribute EventHandler > onfoo;" listed in the IDL. > > @@ +17,5 @@ > > + readonly attribute any uuids; > > + > > + // array of type DOMString[] > > + [Throws] > > + readonly attribute any services; > > It's not clear what kind of services will be returned? Is it a bunch of IDs > or actual service names? > > ::: dom/webidl/BluetoothManager2.webidl > @@ +4,5 @@ > > + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ > > + > > +interface BluetoothManager : EventTarget { > > + [Throws] > > + readonly attribute boolean enabled; > > Seems a bit mean to throw when checking an attribute. > > @@ +13,5 @@ > > + > > + [Throws] > > + boolean isConnected(unsigned short aProfile); > > + [NewObject, Throws] > > + DOMRequest? getDefaultAdapter(); > > Why does this return null? I think this should always return a DOMRequest > that results in an error if there is no default adapter.
Flags: needinfo?(marcos)
Flags: needinfo?(marcos)
Comment on attachment 8421516 [details] [diff] [review] Bug 1009347 Patch2: Using new bluetooth webidls based on bluetooth API version build flag Review of attachment 8421516 [details] [diff] [review]: ----------------------------------------------------------------- Sorry for the misunderstanding, I guess then LGTM.
Attachment #8421516 - Flags: review?(marcos) → review+
Comment on attachment 8421517 [details] [diff] [review] Bug 1009347 Patch3: Using dom/bluetooth2 based on bluetooth API version build flag Review of attachment 8421517 [details] [diff] [review]: ----------------------------------------------------------------- LGTM
Attachment #8421517 - Flags: review?(marcos) → review+
We need to change other moz.build files which import bluetooth headers
Accidentally include webidl changes in patch6 , remove it
Attachment #8423699 - Attachment is obsolete: true
Comment on attachment 8421515 [details] [diff] [review] Bug 1009347 Patch1: Make copy of dom/bluetooth for API refinement Review of attachment 8421515 [details] [diff] [review]: ----------------------------------------------------------------- r+ since this is just a copy of dom/bluetooth. Please ensure there won't be any build failure happening, and next time please write a short summary of the patch to explain what the patch is going to change.
Attachment #8421515 - Flags: review?(echou) → review+
Attachment #8421518 - Flags: review?(echou) → review+
Do "hg cp dom/bluetooth dom/bluetooth2" for making a development environment for new bluetooth API.
Attachment #8421515 - Attachment is obsolete: true
1. hg cp BluetoothManager, BluetoothDevice, BluetoothAdapter webidls for new api 2. conditionally adding webidls based on MOZ_B2G_BT_API_V2 flag
Attachment #8421516 - Attachment is obsolete: true
Attachment #8424653 - Attachment description: [Final] Bug 1009347 Patch2: Using new bluetooth webidls based on bluetooth API version build flag → [Final] Bug 1009347 Patch2: Using new bluetooth webidls based on bluetooth API version build flag, f=btian, r=echou
Attachment #8424653 - Attachment is patch: true
Attachment #8424653 - Attachment mime type: message/rfc822 → text/plain
Attachment #8424653 - Attachment description: [Final] Bug 1009347 Patch2: Using new bluetooth webidls based on bluetooth API version build flag, f=btian, r=echou → [Final] Bug 1009347 Patch2: Using new bluetooth webidls based on bluetooth API version build flag, f=btian, r=mcaceres
Switching dom/bluetooth and dom/bluetooth2 based on MOZ_B2G_BT_API_V2
Attachment #8421517 - Attachment is obsolete: true
Change included binding header files for BT manager, adapter, and device (ex: BluetoothAdapterBinding.h -> BluetoothAdapter2Binding.h)
Attachment #8421518 - Attachment is obsolete: true
update reviewer name in the commit log
Attachment #8424654 - Attachment is obsolete: true
Keywords: checkin-needed
Cancel the checkin request for running more build options on try server
Keywords: checkin-needed
Keywords: checkin-needed
Clean 'checkin-needed' as patch 2 requires DOM peer review.
Keywords: checkin-needed
Comment on attachment 8424683 [details] [diff] [review] [Final] Bug 1009347 Patch2: Using new bluetooth webidls based on bluetooth API version build flag, f=btian, r=marcosc, r=bz Boris, can you review our WEBIDL change for WebBluetooth API refinement? This patch creates a copy of existing bluetooth webidl files for us to work based on them. The whole bug intends to create another folder dom/bluetooth2 for the new API and build it according to additional build flag MOZ_B2G_BT_API_V2 (by default OFF).
Attachment #8424683 - Flags: review?(bzbarsky)
Comment on attachment 8424683 [details] [diff] [review] [Final] Bug 1009347 Patch2: Using new bluetooth webidls based on bluetooth API version build flag, f=btian, r=marcosc, r=bz r=me
Attachment #8424683 - Flags: review?(bzbarsky) → review+
Attachment #8424683 - Attachment description: [Final] Bug 1009347 Patch2: Using new bluetooth webidls based on bluetooth API version build flag, f=btian, r=marcosc → [Final] Bug 1009347 Patch2: Using new bluetooth webidls based on bluetooth API version build flag, f=btian, r=marcosc, r=bz
Keywords: checkin-needed
Keywords: checkin-needed
Target Milestone: --- → 2.0 S2 (23may)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: