OSD700 – Release 0.7

Delayed and short. I’m disappointed in myself with this one but at the same time I’m excited for what I have planned for the rest of this semester.

I’ve progressed more with Bug 720768. I’ve bounced around a lot with this one because for a while I wasn’t sure how I would deal with how SmsManager handled this DispatchToSelf method different than the others because it attached a message to the event.

I’ve since talked with Mounir and he has given me suggestions on how I should approach this. Instead of using the message I’m going to have the method accepted an nsIDOMEvent pointer that will default to nsnull if not given. If this argument is nsnull then I will know that it isn’t coming from SmsManager and can construct the event myself. If it isn’t nsnull then I will know the call was coming from SmsManager and I can act accordingly.

// static
nsContentUtils::DispatchToSelf(const nsAString& aEventName, nsIDOMEvent* aEvent)
nsresult rv;
nsRefPtr event;
if (!aEvent) {
event = new nsDOMEvent(nsnull, nsnull);
rv = event->InitEvent(aEventName, false, false);

rv = event->SetTrusted(true);

bool dummy;
rv = nsDOMEventTargetHelper::DispatchEvent(event, &dummy);

return NS_OK;

That is the code thusfar for it. At this point I don’t know how I can go about converting the aEvent nsIDOMEvent pointer to a plain old nsDOMEvent. I can’t have the method accept an nsDOMEvent pointer instead either so I’m not sure where to go here. My attempts at various casts haven’t worked thusfar.

On top of all that I’m still trying to figure out the best way to use DispatchEvent in nsDOMEventTargetHelper. I have had the suggestion given to me to use nsIDOMEventTarget but I haven’t found a way to properly initialize it. Time to sprechen to the good folks in #introduction/#developers some more!

What has me most excited is the fact that by the end of this semester I’ll finally have some sort of feature done that I can show people. Don’t get me wrong, I have touched a lot of things in the code base as it is. Some of them were hard, some of them were easy. The important part was they all taught me different things. Now I need to piece them together and move towards a bigger goal, and that is the work I will be doing on Bug 686370 – Implement video playback statistics proposed in WHATWG; which will be done alongside with Dave Seifried and Chris De Cairos.

Looking forward to the coming weeks!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: