Closed Bug 952907 Opened 7 years ago Closed 7 years ago
[Bluetooth] Remove unused event idl
Since event generator has supported WebIDL, it's time to remove those event IDLs. :)
Smaug, could you review the patch? Not sure if the superreview is required for this change and who I should ask for. Please let me know if you have any suggestions. Thanks.
Attachment #8360286 - Flags: review?(bugs)
Comment on attachment 8360286 [details] [diff] [review] Patch 1(v1): Use WebIDL codegen to implement Bluetooth events >+ BluetoothDeviceEventInit init; >+ init.mBubbles = false; >+ init.mCancelable = false; >+ init.mDevice = device; >+ nsRefPtr<BluetoothDeviceEvent> event = >+ BluetoothDeviceEvent::Constructor(this, NS_LITERAL_STRING("devicefound"), init); >+ event->SetTrusted(true); > DispatchTrustedEvent(event); DispatchTrustedEvent makes the event trusted, so no need to call event->SetTrusted(true); >+ nsRefPtr<BluetoothStatusChangedEvent> event = >+ BluetoothStatusChangedEvent::Constructor(this, aData.name(), init); >+ event->SetTrusted(true); > DispatchTrustedEvent(event); ditto, remove event->SetTrusted(true); > > NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(BluetoothDevice) >- NS_INTERFACE_MAP_ENTRY(nsIDOMBluetoothDevice) >- NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(BluetoothDevice) > NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper) So we don't need this stuff here at all anymore. I think you could remove this and NS_DECL_ISUPPORTS_INHERITED from .h > NS_IMPL_ADDREF_INHERITED(BluetoothDevice, nsDOMEventTargetHelper) > NS_IMPL_RELEASE_INHERITED(BluetoothDevice, nsDOMEventTargetHelper) and then also these.
Attachment #8360286 - Flags: review?(bugs) → review+
Thanks for your comments, smaug.
The patch is refined based on the comments from smaug. I also removed some macros in BluetoothAdapter.cpp and BluetoothDevice.cpp. However, I'm not quite sure if it's alright. Could you give me a hand, smaug? Please let me know if there's a better candidate. Thanks.
Comment on attachment 8362482 [details] [diff] [review] Patch 1: Use WebIDL codegen to implement Bluetooth events Bah, sorry, the previous patch didn't have context enough to show that there is special tracing. So the cycle collection stuff can't be removed after all.
Attachment #8362482 - Flags: feedback?(bugs) → feedback-
Let me add them back. Thanks.
Attachment #8362482 - Attachment is obsolete: true
Attachment #8362777 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.