зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1207784 - skip permission hooks in createOffer when called from hiddenWindow (add-ons). r=mt
--HG-- extra : rebase_source : 333130dee7cf5bb44821f6280178e792da556018
This commit is contained in:
Родитель
5040c462d0
Коммит
dfbd8ea546
|
@ -95,6 +95,18 @@ function handlePCRequest(aSubject, aTopic, aData) {
|
|||
let { windowID, innerWindowID, callID, isSecure } = aSubject;
|
||||
let contentWindow = Services.wm.getOuterWindowWithId(windowID);
|
||||
|
||||
let mm = getMessageManagerForWindow(contentWindow);
|
||||
if (!mm) {
|
||||
// Workaround for Bug 1207784. To use WebRTC, add-ons right now use
|
||||
// hiddenWindow.mozRTCPeerConnection which is only privileged on OSX. Other
|
||||
// platforms end up here without a message manager.
|
||||
// TODO: Remove once there's a better way (1215591).
|
||||
|
||||
// Skip permission check in the absence of a message manager.
|
||||
Services.obs.notifyObservers(null, "PeerConnection:response:allow", callID);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!contentWindow.pendingPeerConnectionRequests) {
|
||||
setupPendingListsInitially(contentWindow);
|
||||
}
|
||||
|
@ -107,8 +119,6 @@ function handlePCRequest(aSubject, aTopic, aData) {
|
|||
documentURI: contentWindow.document.documentURI,
|
||||
secure: isSecure,
|
||||
};
|
||||
|
||||
let mm = getMessageManagerForWindow(contentWindow);
|
||||
mm.sendAsyncMessage("rtcpeer:Request", request);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче