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

PR 5749 followup #5878

Merged
merged 2 commits into from
Mar 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions extensions/firefox/content/PdfStreamConverter.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ function getContainingBrowser(domWindow) {
.chromeEventHandler;
}

function getChromeWindow(domWindow) {
if (PdfjsContentUtils.isRemote) {
return PdfjsContentUtils.getChromeWindow(domWindow);
}
return getContainingBrowser(domWindow).ownerDocument.defaultView;
}

function getFindBar(domWindow) {
if (PdfjsContentUtils.isRemote) {
throw new Error('FindBar is not accessible from the content process.');
Expand Down
50 changes: 0 additions & 50 deletions extensions/firefox/content/PdfjsContentUtils.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -149,55 +149,5 @@ let PdfjsContentUtils = {
}
break;
}
},

/*
* CPOWs
*/

getChromeWindow: function (aWindow) {
let winmm = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell)
.sameTypeRootTreeItem
.QueryInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager);
// Sync calls don't support cpow wrapping of returned results, so we
// send over a small container for the object we want.
let suitcase = {
_window: null,
setChromeWindow: function (aObj) {
this._window = aObj;
}
};
if (!winmm.sendSyncMessage('PDFJS:Parent:getChromeWindow', {},
{ suitcase: suitcase })[0]) {
Cu.reportError('A request for a CPOW wrapped chrome window ' +
'failed for unknown reasons.');
return null;
}
return suitcase._window;
},

getFindBar: function (aWindow) {
let winmm = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell)
.sameTypeRootTreeItem
.QueryInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager);
let suitcase = {
_findbar: null,
setFindBar: function (aObj) {
this._findbar = aObj;
}
};
if (!winmm.sendSyncMessage('PDFJS:Parent:getFindBar', {},
{ suitcase: suitcase })[0]) {
Cu.reportError('A request for a CPOW wrapped findbar ' +
'failed for unknown reasons.');
return null;
}
return suitcase._findbar;
}
};