Closed Bug 952907 Opened 11 years ago Closed 10 years ago

[Bluetooth] Remove unused event idl

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gyeh, Assigned: gyeh)

Details

Attachments

(1 file, 3 obsolete files)

Since event generator has supported WebIDL, it's time to remove those event IDLs. :)
Assignee: nobody → gyeh
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.
Attachment #8360286 - Attachment is obsolete: true
Attachment #8362482 - Flags: feedback?(bugs)
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.
https://hg.mozilla.org/mozilla-central/rev/7f40e1e33096
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: