Opened 5 years ago

Closed 11 months ago

#10573 closed defect (fixed)

`nsILocalFile` should be replaced with `nsIFile` in our extensions

Reported by: cypherpunks Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Minor Keywords: tbb-easy, TorBrowserTeam201712R
Cc: mcs Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Warning: Starting with Gecko 14, `nsILocalFile` inherits all functions and attributes from `nsIFile`, meaning that you no longer need to use `nsILocalFile`. If your add-on doesn't support versions older than 14, you should use `nsIFile` instead of `nsILocalFile`.

See bug https://bugzilla.mozilla.org/show_bug.cgi?id=682360 for more information.
components/tl-protocol.js
{
  var file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsILocalFile);
  file.initWithPath(aPath);

Child Tickets

Attachments (2)

Change History (24)

comment:1 Changed 5 years ago by mcs

Cc: mcs added

comment:2 Changed 5 years ago by mikeperry

Keywords: tbb-easy added

comment:3 Changed 4 years ago by gk

Component: Tor LauncherTor Browser
Owner: changed from brade to tbb-team
Summary: `nsILocalFile` should be replaced with `nsIFile``nsILocalFile` should be replaced with `nsIFile` in our extensions

This ticket includes the Torbutton related stuff, too, now (see #10574).

comment:4 Changed 12 months ago by aruna1234

Severity: Blocker

Hey!! I am a beginner ! Can I work on this?

comment:5 Changed 12 months ago by gk

Severity: BlockerMinor

Sure, go ahead!

comment:6 Changed 12 months ago by aruna1234

Actually, I am not able to find the block of code that needs editing. Could you help me through?

comment:7 in reply to:  6 Changed 12 months ago by cypherpunks

Replying to aruna1234:

Actually, I am not able to find the block of code that needs editing. Could you help me through?

https://gitweb.torproject.org/tor-launcher.git/tree/src/components/tl-protocol.js#n1354

comment:8 Changed 12 months ago by cypherpunks

Status: newneeds_review

comment:9 Changed 12 months ago by gk

Status: needs_reviewneeds_revision

Thanks aruna1234: Could you create a proper git patch for review? The commit message should contain the bug number and what you did, for instance "Bug 10573: Replace deprecated nsILocalFile with nsIFile".

You can start by cloning the code repositories we use, for Tor Launcher you could do
git clone https://git.torproject.org/tor-launcher and then you write your patch and commit it that repository. You can then create a properly formatted patch by running git format-patch -p -1 and attach that one for review.

It seems to me we have a similar issue in our Torbutton code. You can fix similarly by starting with cloning the Torbutton repository with git clone https://git.torproject.org/torbutton.

comment:10 Changed 12 months ago by gk

Seems you attached the wrong patch? Please have a look at the Torbutton code as well, there should be another instance of nsILocalFile.

comment:11 Changed 12 months ago by aruna1234

I know the files are these:
components/cookie-jar-selector.js
chrome/content/torbutton.js
Could you mention the line number.

Also will there be three .patch files then?

comment:12 in reply to:  11 Changed 12 months ago by mcs

Replying to aruna1234:

I know the files are these:
components/cookie-jar-selector.js
chrome/content/torbutton.js
Could you mention the line number.

You question confuses me. If you found the files you should be able to find the lines to change....

Also will there be three .patch files then?

We would like to receive one git format-patch file per git repository, in this case one for Torbutton and one for Tor Launcher. Thanks!

Last edited 12 months ago by mcs (previous) (diff)

comment:13 Changed 12 months ago by gk

Thanks! I think "Bug 10573: Replace deprecated nsILocalFile with nsIFile" would be a good commit message for both patches.

comment:14 Changed 12 months ago by gk

Keywords: TorBrowserTeam201712R added
Status: needs_revisionneeds_review

comment:15 Changed 12 months ago by mcs

aruna1234, can you please delete the attachments that are not needed so that only the ones that should be reviewed remain on this ticket? Thanks!

comment:16 Changed 12 months ago by aruna1234

actually I am unable to find where is the functionality for deleting an attachment.

comment:17 in reply to:  15 Changed 11 months ago by gk

Replying to mcs:

aruna1234, can you please delete the attachments that are not needed so that only the ones that should be reviewed remain on this ticket? Thanks!

I deleted them.

comment:18 Changed 11 months ago by aruna1234

thanks for the help!

comment:19 Changed 11 months ago by mcs

I think we are missing the Tor Launcher patch now. The two remaining attachments contain the same patch; the second has a corrected bug number in the commit message.

comment:20 in reply to:  19 Changed 11 months ago by gk

Keywords: TorBrowserTeam201712 added; TorBrowserTeam201712R removed
Status: needs_reviewneeds_revision

Replying to mcs:

I think we are missing the Tor Launcher patch now. The two remaining attachments contain the same patch; the second has a corrected bug number in the commit message.

Indeed, my bad. aruna1234: could you add the Tor Launcher patch again? Thanks!

comment:21 Changed 11 months ago by gk

Keywords: TorBrowserTeam201712R added; TorBrowserTeam201712 removed
Status: needs_revisionneeds_review

comment:22 Changed 11 months ago by gk

Resolution: fixed
Status: needs_reviewclosed

Thanks. This is commit d3c99991b207bb51dcaf477e2d879eb2234282a0 on master in Torbutton and commit e24ab106dffdf4f0504c2f60005e213ebd47d458 on master in Tor Launcher.

Note: See TracTickets for help on using tickets.