Closed Bug 217620 Opened 21 years ago Closed 21 years ago

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

Categories

(Core Graveyard :: History: Global, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: tingley, Assigned: tingley)

Details

Attachments

(1 file)

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...
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)
Taking from Blake for now.
Assignee: blake → tingley
Attached patch patchSplinter Review
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.
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 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+
Fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: