Closed Bug 344860 Opened 18 years ago Closed 18 years ago

[SessionStore] Minor code cleanup

Categories

(Firefox :: Session Restore, defect)

defect
Not set
minor

Tracking

()

VERIFIED FIXED
Firefox 2

People

(Reporter: zeniko, Assigned: zeniko)

Details

(Keywords: fixed1.8.1)

Attachments

(2 files, 2 obsolete files)

Some details I've noticed while going through the code...
Attached patch clean upSplinter Review
Mainly white space nits, removing some obsolete comments of mine, lower-casing Cookies, removing the unneeded _readFile function and merging FileWriter into _writeFile (even if we want threaded IO back, I'd rather use it from saveFile so that the call to toSource can be moved into the thread as well).
Attachment #229400 - Flags: review?(dietrich)
Comment on attachment 229400 [details] [diff] [review]
clean up

This looks good, thanks very much Simon.
Attachment #229400 - Flags: review?(dietrich) → review+
Status: NEW → ASSIGNED
Whiteboard: [checkin needed]
Target Milestone: --- → Firefox 2 beta2
gavin_: dietrich: are you aware that Components.returnCode currently doesn't work, due to bug 287107?

Removing checkin note. Maybe create a const to use for now, and change it's value later once 287107 is fixed?
Whiteboard: [checkin needed]
I actually wasn't referring to this bug specifically when I said that - the session store component uses Components.returnCode in a bunch of places already. The fact that it's broken just means that those methods never throw.
Please go ahead with the checkin. If you want that we also throw errors as long as bug 287107 is pending, please file a new bug (either for SessionStore or for all callers).
Assignee: nobody → zeniko
Status: ASSIGNED → NEW
Whiteboard: [checkin needed]
Checked-in on trunk.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Attached patch more clean up (obsolete) — Splinter Review
More whitespace nits (there'd be many more: blank lines vs. space-only lines - should I fix these, too?), getting rid of the pointless _getSessionFile (Crash Recovery didn't cache the files, SessionStore does), of the unused _sessionFileBackup in nsSessionStartup and of most _loadState specifics in nsSessionStartup.

BTW: If you don't mind, I'll keep this bug open at least until beta 2 so that I don't have to file a new bug for each detail.
Attachment #229744 - Flags: review?(dietrich)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch more clean up (obsolete) — Splinter Review
The same as above and additionally some more references to .INI files removed.
Attachment #229744 - Attachment is obsolete: true
Attachment #229755 - Flags: review?(dietrich)
Attachment #229744 - Flags: review?(dietrich)
Comment on attachment 229400 [details] [diff] [review]
clean up

Drivers: These patches don't change any functionality and are thus of low risk.
Attachment #229400 - Flags: approval1.8.1?
Comment on attachment 229400 [details] [diff] [review]
clean up

a=mconnor on behalf of drivers for 1.8.1 checkin
Attachment #229400 - Flags: approval1.8.1? → approval1.8.1+
first patch checked-in on branch.
Dietrich: Could you please review these changes in a free minute? Or if you know that you won't get any any time soon, please tell me so (and I'll file two important bits of this clean up apart).
Attachment #229755 - Attachment is obsolete: true
Attachment #236437 - Flags: review?(dietrich)
Attachment #229755 - Flags: review?(dietrich)
Comment on attachment 236437 [details] [diff] [review]
more clean up (unbitrotted)

The changes look a-ok. I ran through a series of functional tests as well, and didn't find any problems.
Attachment #236437 - Flags: review?(dietrich) → review+
Thanks.
Status: REOPENED → NEW
Whiteboard: [checkin needed]
Simon, I've been getting "SessionStore: TypeError: aBrowser.currentURI has no properties" while middle-clicking last tab on a window. Should I file a bug on that (didn't find it), or you can check it here. Happens on branch and trunk versions:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b2) Gecko/20060902 BonEcho/2.0b2
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060901 Minefield/3.0a1
Pablo, yes, please do file a bug for that error.
(In reply to comment #15)
I've filed bug 351189 for that issue. Thanks for reporting it.
Target Milestone: Firefox 2 beta2 → Firefox 2
Status: NEW → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Comment on attachment 236437 [details] [diff] [review]
more clean up (unbitrotted)

Drivers: This low-risk patch (1) removes unneeded code, (2) reduces the privileges of the sandbox used to parse the session state at startup and (3) ensures that the session state backup created after crashes is always removed when the user clears all history data.
Attachment #236437 - Flags: approval1.8.1?
Comment on attachment 236437 [details] [diff] [review]
more clean up (unbitrotted)

a=schrep for drivers based on parts 2 and 3 of comment 18 since this addresses a few issues with session restore.
Attachment #236437 - Flags: approval1.8.1? → approval1.8.1+
Whiteboard: [checkin needed (1.8 branch): second patch]
Keywords: fixed1.8.1
Whiteboard: [checkin needed (1.8 branch): second patch]
Component: General → Session Restore
QA Contact: general → session.restore
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: