Closed
Bug 161701
Opened 23 years ago
Closed 22 years ago
move last-page-visited out of prefs.js
Categories
(Core :: Preferences: Backend, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla1.2alpha
People
(Reporter: alecf, Assigned: alecf)
References
Details
(Whiteboard: fix in hand)
Attachments
(1 file, 1 obsolete file)
3.65 KB,
patch
|
bnesse
:
review+
Bienvenu
:
superreview+
|
Details | Diff | Splinter Review |
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.
Comment 1•23 years ago
|
||
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.
Assignee | ||
Comment 2•23 years ago
|
||
yes! that's exactly what I'm looking for. Thanks.
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
Comment 5•23 years ago
|
||
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.
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". =^.^=
Assignee | ||
Comment 8•23 years ago
|
||
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
Assignee | ||
Comment 9•23 years ago
|
||
ok smart guy, lets see a patch then. :)
Comment 10•23 years ago
|
||
Sorry I can't, blocked by the bug 159723. :-b
Comment 11•23 years ago
|
||
Just think of it as an index of 1 - databases have indexes that allow you to
retrieve data quickly, right? :-)
Assignee | ||
Comment 12•22 years ago
|
||
This turned out to be very easy. Here's a simple implementation using mork's
GetMetaRow()
can I get r=bnesse, sr=bienvenu?
Assignee | ||
Comment 14•22 years ago
|
||
no, you told me to fix it in another way, and said THAT would be easy :)
Comment 15•22 years ago
|
||
I think for consistency, you should clean up mMetaRow in nsGlobalHistory::CloseDB()
Assignee | ||
Comment 16•22 years ago
|
||
oops yeah - I discovered that without that, I crash on exit :)
Attachment #95332 -
Attachment is obsolete: true
Comment 17•22 years ago
|
||
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 18•22 years ago
|
||
Comment on attachment 95414 [details] [diff] [review]
use mork's meta-row v1.01
r=bnesse.
Attachment #95414 -
Flags: review+
Assignee | ||
Comment 19•22 years ago
|
||
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.
Description
•