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

API changes for newChannel #5620

Closed
wants to merge 1 commit into from
Closed
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
9 changes: 8 additions & 1 deletion extensions/firefox/content/PdfRedirector.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,14 @@ PdfRedirector.prototype = {

// Create a new channel that is viewer loaded as a resource.
var ioService = Services.io;
var channel = ioService.newChannel(pdfUrl, null, null);
var channel = ioService.newChannel2(pdfUrl,
null,
null,
domWindow,
nullptr, // aLoadingPrincipal
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks like a typo, shouldn't nullptr be replaced by null?

null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER);

channel.loadGroup = aRequest.loadGroup;

Expand Down
21 changes: 17 additions & 4 deletions extensions/firefox/content/PdfStreamConverter.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,19 @@ ChromeActions.prototype = {
getService(Ci.nsIWindowWatcher).activeWindow;

var docIsPrivate = this.isInPrivateBrowsing();
var netChannel = NetUtil.newChannel(blobUri);
var netChannel = NetUtil.newChannel2(blobUri,
null,
null,
frontWindow,
null, // aLoadingPrincipal
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER);
if ('nsIPrivateBrowsingChannel' in Ci &&
netChannel instanceof Ci.nsIPrivateBrowsingChannel) {
netChannel.setPrivate(docIsPrivate);
}
NetUtil.asyncFetch(netChannel, function(aInputStream, aResult) {
NetUtil.asyncFetch2(netChannel, function(aInputStream, aResult) {
if (!Components.isSuccessCode(aResult)) {
if (sendResponse) {
sendResponse(true);
Expand Down Expand Up @@ -956,8 +963,14 @@ PdfStreamConverter.prototype = {

// Create a new channel that is viewer loaded as a resource.
var ioService = Services.io;
var channel = ioService.newChannel(
PDF_VIEWER_WEB_PAGE, null, null);
var channel = ioService.newChannel2(PDF_VIEWER_WEB_PAGE,
null,
null,
null, // aLoadingNode
Services.scriptSecurityManager.getSystemPrincipal(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

As pointed out by Travis, this line is too long.

null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER);

var listener = this.listener;
var dataListener = this.dataListener;
Expand Down