Closed Bug 161701 Opened 22 years ago Closed 22 years ago

move last-page-visited out of prefs.js

Categories

(Core :: Preferences: Backend, defect, P3)

x86
Windows 2000
defect

Tracking

()

RESOLVED FIXED
mozilla1.2alpha

People

(Reporter: alecf, Assigned: alecf)

References

Details

(Whiteboard: fix in hand)

Attachments

(1 file, 1 obsolete file)

After some discussion that fell out of bug 155080, we've decided to clamp down
on preferences that make prefs.js constantly dirty. The biggest offender, by
far, is browser.history.last_page_visited - we set that every time we visit a
page, which is just rediculous.

This bug is to store this value in history.dat instead. My initial idea is to
create a new table in the mork database which essentially stores name/value
pairs that have metainformation about the entire database - and one such value
will be "last_page_visited"

cc'ing bienvenu for mork advice in case there's another way of doing this - I
remember long ago mccusker talking about making a meta-properties API for mork
databases, but I'm not sure what became of that.. Also, since we'll be
constantly  writing out new journal data to disk as a result of this, I want to
make sure to do the absolute minimum change so that each journal change is small.

cc'ing bnesse because this will allow him to make prefs save on a timer, without
constantly writing prefs.js out to disk.
you can add meta row information to an existing table, or you can add a new
table. IIRC, history has one table, right, with a row for every history entry?

To get the meta row for a table,
		table->GetMetaRow(db->GetEnv(), nsnull, nsnull, &m_metaRow);

You can then get and set columns on that row to your heart's content.
yes! that's exactly what I'm looking for. Thanks.
Blocks: 161711
Guys, isn't the "last page visited" == "the page in history with the most recent
date"? Why separate item for it?
Guys, isn't the "last page visited" == "the page in history with the most recent
date"? Why separate item for it?
Summary: move last-page-visited out of prefs → move last-page-visited out of prefs.js
just guessing, but it's much faster to keep track of the last page than it is to
grovel through all the pages looking for the one with the latest last visited date.
Just save it as a very first record when saving history file...
Besides, it's a matter of good style. One of the DB rules saying, 
"Thu shalt not be able to retireve the same data record in more than a single
unique way, as desynchronization havoc might be caused otherwise". =^.^=
because there is no fast way to retrieve that entry - I'd have to go through
every entry in the file looking for the latest date.
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.2alpha
ok smart guy, lets see a patch then. :)
Sorry I can't, blocked by the bug 159723. :-b
Just think of it as an index of 1 - databases have indexes that allow you to
retrieve data quickly, right? :-)
Attached patch use mork's meta-row (obsolete) — Splinter Review
This turned out to be very easy. Here's a simple implementation using mork's
GetMetaRow()

can I get r=bnesse, sr=bienvenu?
Toldja! =^.^=
Keywords: review
no, you told me to fix it in another way, and said THAT would be easy :)
I think for consistency, you should clean up mMetaRow in nsGlobalHistory::CloseDB()
oops yeah - I discovered that without that, I crash on exit :)
Attachment #95332 - Attachment is obsolete: true
Comment on attachment 95414 [details] [diff] [review]
use mork's meta-row v1.01

consistency, not crashing, it's all good :-) sr=bienvenu
Attachment #95414 - Flags: superreview+
Comment on attachment 95414 [details] [diff] [review]
use mork's meta-row v1.01

r=bnesse.
Attachment #95414 - Flags: review+
Keywords: review
Whiteboard: fix in hand
cool thanks. fixed.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: