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

RESOLVED WONTFIX

Status

Firefox OS
Bluetooth
RESOLVED WONTFIX
3 years ago
5 months ago

People

(Reporter: brsun, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(14 attachments)

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
(Reporter)

Description

3 years ago
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
(Reporter)

Updated

3 years ago
Blocks: 1204396
(Reporter)

Updated

3 years ago
Assignee: nobody → brsun
(Reporter)

Comment 2

3 years ago
Created attachment 8710832 [details] [diff] [review]
bug1238479_0001_add_moz_prefix_to_bluetooth_manager.patch
Attachment #8710832 - Flags: review?(btian)
(Reporter)

Comment 3

3 years ago
Created attachment 8710833 [details] [diff] [review]
bug1238479_0002_add_moz_prefix_to_bluetooth_adapter.patch
Attachment #8710833 - Flags: review?(btian)
(Reporter)

Comment 4

3 years ago
Created attachment 8710834 [details] [diff] [review]
bug1238479_0003_add_moz_prefix_to_bluetooth_device.patch
Attachment #8710834 - Flags: review?(btian)
(Reporter)

Comment 5

3 years ago
Created attachment 8710836 [details] [diff] [review]
bug1238479_0004_add_moz_prefix_to_bluetooth_gatt.patch
Attachment #8710836 - Flags: review?(btian)
(Reporter)

Comment 6

3 years ago
Created attachment 8710837 [details] [diff] [review]
bug1238479_0005_add_moz_prefix_to_bluetooth_gatt_server.patch
Attachment #8710837 - Flags: review?(btian)
(Reporter)

Comment 7

3 years ago
Created attachment 8710838 [details] [diff] [review]
bug1238479_0006_add_moz_prefix_to_bluetooth_gatt_service.patch
Attachment #8710838 - Flags: review?(btian)
(Reporter)

Comment 8

3 years ago
Created attachment 8710839 [details] [diff] [review]
bug1238479_0007_add_moz_prefix_to_bluetooth_gatt_characteristic.patch
Attachment #8710839 - Flags: review?(btian)
(Reporter)

Comment 9

3 years ago
Created attachment 8710840 [details] [diff] [review]
bug1238479_0008_add_moz_prefix_to_bluetooth_gatt_descriptor.patch
Attachment #8710840 - Flags: review?(btian)
(Reporter)

Comment 10

3 years ago
Created attachment 8710841 [details] [diff] [review]
bug1238479_0009_add_moz_prefix_to_bluetooth_pairing.patch
Attachment #8710841 - Flags: review?(btian)
(Reporter)

Comment 11

3 years ago
Created attachment 8710842 [details] [diff] [review]
bug1238479_0010_add_moz_prefix_to_bluetooth_pbap.patch
Attachment #8710842 - Flags: review?(btian)
(Reporter)

Comment 12

3 years ago
Created attachment 8710844 [details] [diff] [review]
bug1238479_0011_add_moz_prefix_to_bluetooth_map.patch
Attachment #8710844 - Flags: review?(btian)
(Reporter)

Comment 13

3 years ago
Created attachment 8710845 [details] [diff] [review]
bug1238479_0012_add_moz_prefix_to_bluetooth_attribute.patch
Attachment #8710845 - Flags: review?(btian)
(Reporter)

Comment 14

3 years ago
Created attachment 8710846 [details] [diff] [review]
bug1238479_0013_add_moz_prefix_to_bluetooth_status.patch
Attachment #8710846 - Flags: review?(btian)
(Reporter)

Comment 15

3 years ago
Created attachment 8710847 [details] [diff] [review]
bug1238479_0014_add_moz_prefix_to_bluetooth_marionette_test.patch
Attachment #8710847 - Flags: review?(btian)

Updated

3 years ago
See Also: → bug 1048776
(Reporter)

Comment 16

3 years ago
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)

Comment 18

2 years ago
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 19

2 years ago
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 20

2 years ago
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 21

2 years ago
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 22

2 years ago
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 23

2 years ago
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 24

2 years ago
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 25

2 years ago
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 26

2 years ago
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 27

2 years ago
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 28

2 years ago
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 29

2 years ago
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 30

2 years ago
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 31

2 years ago
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 32

2 years ago
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)
(Reporter)

Comment 33

2 years ago
Unassign myself due to not working on this bug anymore.
Assignee: brsun → nobody

Comment 34

5 months ago
Firefox OS is not being worked on
Status: NEW → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.