Closed Bug 338830 Opened 20 years ago Closed 19 years ago

Multiple license blocks in safe browsing JS components

Categories

(Toolkit :: Safe Browsing, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 3 alpha1

People

(Reporter: regis.caspar+bz, Assigned: regis.caspar+bz)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 4 obsolete files)

Since bug 338754 landing Safe Browsing js components are living in Firefox components directory, however, all these JS files are containing multiple license blocks (from 'grep -ce "/* ***** BEGIN LICENSE BLOCK *****" *.js'): nsSafebrowsingApplication.js:13 nsUrlClassifierLib.js:17 nsUrlClassifierListManager.js:3 nsUrlClassifierTable.js:6 According to bug 338754 one license block is ~1.7KB so here there are (13 + 17 + 3 + 6 - 4) * ~1.7 = ~59.5 useless KB. It would be good to have one license block per file at least. Kinda related to bug 309418. -> ALL/ALL (this is related to js components) -> making this one blocking bug 171082
We should preprocess out all the license blocks.
before: 143Ko / After: 124Ko
Assignee: nobody → regis.caspar+bz
Status: NEW → ASSIGNED
Attachment #222876 - Flags: review?(benjamin)
for nsUrlClassifier*.js before: 201Ko / after: 198Ko NB: toolkit.jar size is affected too The ~1.7Ko per license seems over-estimated
Attachment #222879 - Flags: review?(benjamin)
(In reply to comment #3) > The ~1.7Ko per license seems over-estimated Note that I made my comparison between a debug and a non debug (current nightly) build, this could explain the little amount of size gained.
(In reply to comment #1) > We should preprocess out all the license blocks. > that would be bug 309418 correct?
Attachment #222876 - Flags: review?(benjamin) → review+
Attachment #222879 - Flags: review?(benjamin) → review+
You might need to push a little bit harder for checkin, at least to the extent of adding "[checkin needed]" to the Status Whiteboard. I'm guessing this hasn't bitrotted, since it's only at the start of files?
Whiteboard: [checkin needed]
(In reply to comment #6) > You might need to push a little bit harder for checkin, at least to the > extent of adding "[checkin needed]" to the Status Whiteboard. OK, to be honnest, I kinda forgot about this bug. > I'm guessing this hasn't bitrotted, since it's only at the start of files? I will check that later today and submit modified patch if needed. Thanks.
Attachment #222876 - Attachment is obsolete: true
Updated patch including changes for "sb-loader.js" and corrections to changes for "globalstore.js" Checked against trunk tree (2006092816)
Attachment #240504 - Flags: review?
Attachment #240504 - Flags: review? → review?(benjamin)
I don't see license in nsSafeBrowsingApplication.js in either patch.
(In reply to comment #9) > I don't see license in nsSafeBrowsingApplication.js in either patch. 'nsSafeBrowsingApplication.js' doesn't have a license block, but include 13 files handled by part1 patch.
Comment on attachment 222879 [details] [diff] [review] part2 (nsUrlClassifier*.js) (checked in) Checked in on the trunk.
Attachment #222879 - Attachment is obsolete: true
Whiteboard: [checkin needed]
Target Milestone: --- → Firefox 3 alpha1
Version: unspecified → Trunk
Attachment #222879 - Attachment description: part2 (nsUrlClassifier*.js) → part2 (nsUrlClassifier*.js) (checked in)
Attachment #240504 - Flags: review?(benjamin) → review+
Is there any reason the nsSafeBrowsingApplication patch hasn't been checked in yet?
Not that I know of.
Whiteboard: [checkin needed]
The patch "part1 (nsSafeBrowsingApplication.js) revised" doesn't apply for me. One failed hunk and three missing files. Could someone update it?
While you're at it, why not doing it yourself? The missing files (eventregistrar.js, listdictionary.js, tabbedbrowserwatcher.js) have been permanently deleted from the tree and the failed hunk should just be due to the addition of a contributor name to the license block.
Here's the updated version. $ patch --dry-run -p0 < patch.patch patching file `browser/components/safebrowsing/content/application.js' patching file `browser/components/safebrowsing/content/browser-view.js' patching file `browser/components/safebrowsing/content/controller.js' patching file `browser/components/safebrowsing/content/firefox-commands.js' patching file `browser/components/safebrowsing/content/globalstore.js' patching file `browser/components/safebrowsing/content/list-warden.js' patching file `browser/components/safebrowsing/content/phishing-afterload-displayer.js' patching file `browser/components/safebrowsing/content/phishing-warden.js' patching file `browser/components/safebrowsing/content/reporter.js' patching file `browser/components/safebrowsing/content/sb-loader.js' patching file `browser/components/safebrowsing/content/tr-fetcher.js' Removed 3 obsolete files, and added Simon in the contributor list of controller.js.
Attachment #240504 - Attachment is obsolete: true
This patch causes an error in the JS console: Error: illegal character Source File: chrome://browser/content/safebrowsing/sb-loader.js Line: 1 Source Code: # ***** BEGIN LICENSE BLOCK ***** sb-loader.js is not going through the preprocessor.
I made the change to jar.mn so sb-loader.js would go through the preprocessor. Checking in browser/components/safebrowsing/jar.mn; /cvsroot/mozilla/browser/components/safebrowsing/jar.mn,v <-- jar.mn new revision: 1.5; previous revision: 1.4 done Checking in browser/components/safebrowsing/content/application.js; /cvsroot/mozilla/browser/components/safebrowsing/content/application.js,v <-- application.js new revision: 1.12; previous revision: 1.11 done Checking in browser/components/safebrowsing/content/browser-view.js; /cvsroot/mozilla/browser/components/safebrowsing/content/browser-view.js,v <-- browser-view.js new revision: 1.6; previous revision: 1.5 done Checking in browser/components/safebrowsing/content/controller.js; /cvsroot/mozilla/browser/components/safebrowsing/content/controller.js,v <-- controller.js new revision: 1.10; previous revision: 1.9 done Checking in browser/components/safebrowsing/content/firefox-commands.js; /cvsroot/mozilla/browser/components/safebrowsing/content/firefox-commands.js,v <-- firefox-commands.js new revision: 1.3; previous revision: 1.2 done Checking in browser/components/safebrowsing/content/globalstore.js; /cvsroot/mozilla/browser/components/safebrowsing/content/globalstore.js,v <-- globalstore.js new revision: 1.16; previous revision: 1.15 done Checking in browser/components/safebrowsing/content/list-warden.js; /cvsroot/mozilla/browser/components/safebrowsing/content/list-warden.js,v <-- list-warden.js new revision: 1.13; previous revision: 1.12 done Checking in browser/components/safebrowsing/content/phishing-afterload-displayer.js; /cvsroot/mozilla/browser/components/safebrowsing/content/phishing-afterload-displayer.js,v <-- phishing-afterload-displayer.js new revision: 1.16; previous revision: 1.15 done Checking in browser/components/safebrowsing/content/phishing-warden.js; /cvsroot/mozilla/browser/components/safebrowsing/content/phishing-warden.js,v <-- phishing-warden.js new revision: 1.23; previous revision: 1.22 done Checking in browser/components/safebrowsing/content/reporter.js; /cvsroot/mozilla/browser/components/safebrowsing/content/reporter.js,v <-- reporter.js new revision: 1.5; previous revision: 1.4 done Checking in browser/components/safebrowsing/content/sb-loader.js; /cvsroot/mozilla/browser/components/safebrowsing/content/sb-loader.js,v <-- sb-loader.js new revision: 1.17; previous revision: 1.16 done Checking in browser/components/safebrowsing/content/tr-fetcher.js; /cvsroot/mozilla/browser/components/safebrowsing/content/tr-fetcher.js,v <-- tr-fetcher.js new revision: 1.11; previous revision: 1.10 done
Attachment #268744 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Thanks Michael.
Flags: in-testsuite-
Blocks: 339030
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: