Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Initial implementation #2

wants to merge 2 commits into from

Conversation

aswan
Copy link
Collaborator

@aswan aswan commented Sep 30, 2016

This still needs tests but has been tested manually.

Copy link

@mixedpuppy mixedpuppy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+ from me after fixing or commenting the two code issues. Lets also plan down the road for a fix to webrtcui [given input from @Standard8 or someone more knowledgable with the webrtc code]

"resource:///modules/webrtcUI.jsm");

let origReceiveMessage = null;
let boundRecv = null;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused var?

XPCOMUtils.defineLazyModuleGetter(this, "webrtcUI",
"resource:///modules/webrtcUI.jsm");

let origReceiveMessage = null;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The underlying webrtcui.jsm makes this necessary, but doing a monkey patch like this is quite brittle. It feels like webrtcui should be fixed prior to moving this api beyond experiment phase. Maybe @Standard8 could give some input on this issue. https://dxr.mozilla.org/mozilla-central/source/browser/modules/webrtcUI.jsm#177

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only touched that module lightly. I think @fqueze is a better person to answer that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I had a separate conversation with @jan-ivar about making the fix in webrtcUI.jsm. He's on board with fixing it there and that's in my queue of things to do. That change will need to land in central and ride the trains though, I'll aim to get it done before 52 is cut.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, @aswan did you file a bug for that? I forget.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed https://bugzilla.mozilla.org/show_bug.cgi?id=1310355 and moved the blocking callback handling over there.

origReceiveMessage = webrtcUI.receiveMessage;
webrtcUI.receiveMessage = receiveMessage;
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if hookCount > 0 and webrtcUI.receiveMessage != receiveMessage?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If hookCount > 0 then we previously hooked our version of receiveMessage in. If webrtcUI.receiveMessage is not our receiveMessage then somebody else has also hooked receiveMessage. I think the only reasonable thing is to assume that the other hook is a good citizen and is passing incoming messages through to us when appropriate.
This of course can/will get cleaner if we improve the hooking facilities in webrtcUI.jsm as discussed in a previous comment.

This is the companion to the Firefox patches in
https://bugzilla.mozilla.org/show_bug.cgi?id=1310355

That patch moves the handling of blocking callbacks into webrtcUI.jsm
so the code here gets much simpler as a result.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants