Closed Bug 1238479 Opened 8 years ago Closed 6 years ago

[web-bluetooth] Solve naming conflicts of classes between W3C ones and Gecko ones.

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: brsun, Unassigned)

References

Details

Attachments

(14 files)

30.44 KB, patch
Details | Diff | Splinter Review
109.08 KB, patch
Details | Diff | Splinter Review
88.82 KB, patch
Details | Diff | Splinter Review
42.06 KB, patch
Details | Diff | Splinter Review
64.70 KB, patch
Details | Diff | Splinter Review
60.99 KB, patch
Details | Diff | Splinter Review
72.97 KB, patch
Details | Diff | Splinter Review
41.66 KB, patch
Details | Diff | Splinter Review
41.06 KB, patch
Details | Diff | Splinter Review
59.48 KB, patch
Details | Diff | Splinter Review
61.51 KB, patch
Details | Diff | Splinter Review
17.59 KB, patch
Details | Diff | Splinter Review
13.23 KB, patch
Details | Diff | Splinter Review
32.55 KB, patch
Details | Diff | Splinter Review
Gecko has its own APIs to interact with a remote device through GATT of Bluetooth[1] on B2G. Now we are going to align our implementation with W3C spec[2].

Because there are many existing classes conflicting with W3C ones (ex. BlueoothDevice, BluetoothGattService, BluetoothGattCharacteristic, BluetoothGattDescriptor) , we should rename our classes first before starting the development.

Adding a |Moz| prefix to each existing Bluetooth class would be a possible solution to this problem.

[1] Bug 933357
[2] Bug 1204396
Blocks: 1204396
Assignee: nobody → brsun
See Also: → 1048776
Hi Boris,

We are currently going to align our Bluetooth implementation[1] to W3C ones[2]. But due to the naming conflict (ex. |BluetoothDevice|), some our existing interfaces should be renamed. We might have at least two options here.

Option 1: Add |Moz| prefix to all of our existing Bluetooth interfaces.
 - Argument: Our current Bluetooth implementation is for FirefoxOS only, and probably they are unlikely being followed by Firefox and other browsers. Adding |Moz| prefix to our existing interfaces could let Web/Gaia developers know exactly which interfaces are W3C ones and others are not. Besides, most interfaces are not constructable; almost all instances of Bluetooth related interface are accessible through attributes of some existing objects only. The impact to Gaia due to this change might not be so big if names of interfaces are not used directly (ex. using |instanceof| for some checking) in too many places.
 - Debate: All existing Bluetooth interfaces have to be renamed. The change itself in Gecko is huge because we have many existing Bluetooth interfaces already. Gecko/Gaia have to be extensively scanned to make sure all existing Blueooth features work properly.

Option 2: Only rename our |BluetoothDevice| to some other name.
 - Argument: Althrough there seems some interfaces conflict between W3C ones and our ones, there is only one conflict (i.e. |BluetoothDevice|) if we are (upper/lower) case sensitive on the naming. Change the name of one interface (i.e. |BluetoothDevice|) could solve the conflict already. No huge impact in Gecko/Gaia.
 - Debate: Because W3C interfaces and our own interfaces are not compatible, Web/Gaia developers who want to use Bluetooth interfaces should be able to distinguish W3C ones and mozilla ones carefully. The naming style is not self descriptive for such differentiation enough, so the naming of interfaces cannot help on the confusion (if any) here.

There are guiding principles and special cases on the wiki[3], but we are not sure which rules would apply for our cases more properly. Would you mind share your comments regarding on the naming of interfaces? Any comments are appreciated.

[1] https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2#Interfaces
[2] https://webbluetoothcg.github.io/web-bluetooth/#idl-index
[3] https://wiki.mozilla.org/WebAPI/ExposureGuidelines
Flags: needinfo?(bzbarsky)
> The change itself in Gecko is huge

You can defer this by sprinkling some nativeType annotations in Bindings.conf, right?

My gut feeling here is that if we don't plan to evolve our existing bluetooth APIs to standardization we should prefix them with Moz.
Flags: needinfo?(bzbarsky)
We decide to not phase these interface changes with risk of breaking gecko, given WebBluetooth API is regarded low-priority now. I'll remove the r? flags but keep the bug open to track.
Comment on attachment 8710832 [details] [diff] [review]
bug1238479_0001_add_moz_prefix_to_bluetooth_manager.patch

Remove r? per comment 18.
Attachment #8710832 - Flags: review?(btian)
Comment on attachment 8710833 [details] [diff] [review]
bug1238479_0002_add_moz_prefix_to_bluetooth_adapter.patch

Remove r? per comment 18.
Attachment #8710833 - Flags: review?(btian)
Comment on attachment 8710834 [details] [diff] [review]
bug1238479_0003_add_moz_prefix_to_bluetooth_device.patch

Remove r? per comment 18.
Attachment #8710834 - Flags: review?(btian)
Comment on attachment 8710836 [details] [diff] [review]
bug1238479_0004_add_moz_prefix_to_bluetooth_gatt.patch

Remove r? per comment 18.
Attachment #8710836 - Flags: review?(btian)
Comment on attachment 8710837 [details] [diff] [review]
bug1238479_0005_add_moz_prefix_to_bluetooth_gatt_server.patch

Remove r? per comment 18.
Attachment #8710837 - Flags: review?(btian)
Comment on attachment 8710838 [details] [diff] [review]
bug1238479_0006_add_moz_prefix_to_bluetooth_gatt_service.patch

Remove r? per comment 18.
Attachment #8710838 - Flags: review?(btian)
Comment on attachment 8710839 [details] [diff] [review]
bug1238479_0007_add_moz_prefix_to_bluetooth_gatt_characteristic.patch

Remove r? per comment 18.
Attachment #8710839 - Flags: review?(btian)
Comment on attachment 8710840 [details] [diff] [review]
bug1238479_0008_add_moz_prefix_to_bluetooth_gatt_descriptor.patch

Remove r? per comment 18.
Attachment #8710840 - Flags: review?(btian)
Comment on attachment 8710841 [details] [diff] [review]
bug1238479_0009_add_moz_prefix_to_bluetooth_pairing.patch

Remove r? per comment 18.
Attachment #8710841 - Flags: review?(btian)
Comment on attachment 8710842 [details] [diff] [review]
bug1238479_0010_add_moz_prefix_to_bluetooth_pbap.patch

Remove r? per comment 18.
Attachment #8710842 - Flags: review?(btian)
Comment on attachment 8710844 [details] [diff] [review]
bug1238479_0011_add_moz_prefix_to_bluetooth_map.patch

Remove r? per comment 18.
Attachment #8710844 - Flags: review?(btian)
Comment on attachment 8710845 [details] [diff] [review]
bug1238479_0012_add_moz_prefix_to_bluetooth_attribute.patch

Remove r? per comment 18.
Attachment #8710845 - Flags: review?(btian)
Comment on attachment 8710846 [details] [diff] [review]
bug1238479_0013_add_moz_prefix_to_bluetooth_status.patch

Remove r? per comment 18.
Attachment #8710846 - Flags: review?(btian)
Comment on attachment 8710847 [details] [diff] [review]
bug1238479_0014_add_moz_prefix_to_bluetooth_marionette_test.patch

Remove r? per comment 18.
Attachment #8710847 - Flags: review?(btian)
Unassign myself due to not working on this bug anymore.
Assignee: brsun → nobody
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: