nsGlobalHistory::OpenDB is not always called if accessed through rdf:history

RESOLVED FIXED

Status

()

Core
History: Global
--
minor
RESOLVED FIXED
15 years ago
14 years ago

People

(Reporter: Chase Tingley, Assigned: Chase Tingley)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

15 years ago
See 
news://news.mozilla.org:119/bigv4v$hms1@ripley.netscape.com
and followups, notably
news://news.mozilla.org:119/bij72s$m1p4@ripley.netscape.com
news://news.mozilla.org:119/bij7f4$m157@ripley.netscape.com

As a result of the delayed initialization of the history db, someone who tries
to access it as a "regular" datasource will see it as empty unless they happen
to call GetTargets().  Other nsIRDFDataSource methods -- or at least
GetAllResources() -- should probably call OpenDB() to prevent this.

Any fix for this will need to be looked at carefully to make sure we don't get a
startup time regression by opening the database too early.
Blake is not likely to work on this; a real owner is needed...

Comment 2

15 years ago
yeah, the reason for the delay was to speed up percieved startup. We can
probably just put the lazy OpenDB call in each nsIRDFDataSource method...but
like you say, we probably have to be careful to make sure none of these things
ARE called at startup (but if they are, we should probably fix the callers instead)
(Assignee)

Comment 3

15 years ago
Taking from Blake for now.
Assignee: blake → tingley
(Assignee)

Comment 4

14 years ago
Created attachment 140476 [details] [diff] [review]
patch

This implements alecf's suggestion of adding OpenDB calls to each of the
nsIRDFDataSource methods that touch the RDF arcs themselves (ie, not for
AddObserver, etc).

I've verified that this doesn't cause the history to be loaded on startup.
(Assignee)

Updated

14 years ago
Attachment #140476 - Flags: superreview?(alecf)
Attachment #140476 - Flags: review?(bz-vacation)
Comment on attachment 140476 [details] [diff] [review]
patch

r=bzbarsky, I guess... this isn't really code I know that well, though.
Attachment #140476 - Flags: review?(bz-vacation) → review+

Comment 6

14 years ago
Comment on attachment 140476 [details] [diff] [review]
patch

seems like the right thing. OpenDB is smart enough not to open the database
twice...

 sr=alecf
Attachment #140476 - Flags: superreview?(alecf) → superreview+
(Assignee)

Comment 7

14 years ago
Fix checked in.
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.