Closed
Bug 612455
Opened 14 years ago
Closed 14 years ago
History.cpp should finalize statementCache on the background thread
Categories
(Toolkit :: Places, defect)
Toolkit
Places
Tracking
()
RESOLVED
FIXED
mozilla2.0b9
Tracking | Status | |
---|---|---|
blocking2.0 | --- | betaN+ |
People
(Reporter: mak, Assigned: sdwilsh)
References
Details
(Whiteboard: [fixed-in-places])
Attachments
(2 files, 1 obsolete file)
(deleted),
patch
|
mak
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review |
Title says it all, we could use the proxy runnable I added to Helpers.h in bug 599973
Reporter | ||
Updated•14 years ago
|
blocking2.0: --- → ?
Assignee | ||
Comment 1•14 years ago
|
||
Correctness fix that is important, but not too important.
blocking2.0: ? → final+
Assignee | ||
Comment 3•14 years ago
|
||
Reporter | ||
Comment 4•14 years ago
|
||
2 things we should figure out:
FinalizeStatementCacheProxy uses references, if we call it in destructor it's possible it will end up working on null and iirc History could do that. FaviconService shutdown is called by history thus there it's not a problem.
We probably need to build a new cache and migrate statements to it (a special copy contructor?) so we destroy an empty entity and we can finalize with all quiet.
StatementCache seem to allow asking for more statements after it has been finalized... well, is it possible we finalize the cache at places-shutdown when there is still some runnable queued up to be executed? then it would create never finalized statements. Maybe the cache should return null after it has been finalized?
Assignee | ||
Comment 5•14 years ago
|
||
(In reply to comment #4)
> FinalizeStatementCacheProxy uses references, if we call it in destructor it's
> possible it will end up working on null and iirc History could do that.
> FaviconService shutdown is called by history thus there it's not a problem.
> We probably need to build a new cache and migrate statements to it (a special
> copy contructor?) so we destroy an empty entity and we can finalize with all
> quiet.
Naw, we can just tack on strong reference to the object that owns it and we don't have to worry about it.
> StatementCache seem to allow asking for more statements after it has been
> finalized... well, is it possible we finalize the cache at places-shutdown when
> there is still some runnable queued up to be executed? then it would create
> never finalized statements. Maybe the cache should return null after it has
> been finalized?
It's not an issue if there are still runnables that are queued. This is added at the end of the queue, and then we set the shutting down flag which means we won't add anything else to the queue.
Reporter | ||
Comment 6•14 years ago
|
||
(In reply to comment #5)
> It's not an issue if there are still runnables that are queued. This is added
> at the end of the queue, and then we set the shutting down flag which means we
> won't add anything else to the queue.
to sum up irc discussion, favicons are more complicated and involve more runnables that are queued up later. thus this won't work for them.
Assignee | ||
Comment 7•14 years ago
|
||
per comments, + more correct
Attachment #491225 -
Attachment is obsolete: true
Attachment #491385 -
Flags: review?(mak77)
Attachment #491225 -
Flags: review?(mak77)
Assignee | ||
Comment 8•14 years ago
|
||
Comment on attachment 491385 [details] [diff] [review]
v1.1
omponents/places/src/History.cpp
>+++ b/toolkit/components/places/src/History.cpp
>@@ -863,10 +863,6 @@ History::~History()
> "Not all Links were removed before we disappear!");
> }
> #endif
>-
>- // Places shutdown event may not occur, but we *must* clean up before History
>- // goes away.
>- Shutdown();
This is safe because we used to have to tear down a hashtable. We don't do that anymore, so we don't need to call shutdown in our destructor (which we don't want to do anyway).
>+++ b/toolkit/components/places/src/nsFaviconService.cpp
>@@ -942,7 +942,7 @@ nsFaviconService::FinalizeStatements() {
>
> // Finalize the statementCache on the correct thread.
> nsRefPtr<FinalizeStatementCacheProxy<mozIStorageStatement> > event =
>- new FinalizeStatementCacheProxy<mozIStorageStatement>(mSyncStatements);
>+ new FinalizeStatementCacheProxy<mozIStorageStatement>(mSyncStatements, this);
This is safe because we'll never call this method in our destructor.
Reporter | ||
Updated•14 years ago
|
Attachment #491385 -
Flags: review?(mak77) → review+
Assignee | ||
Comment 9•14 years ago
|
||
With commit message. Can land! Yay!
Reporter | ||
Comment 10•14 years ago
|
||
Whiteboard: [fixed-in-places]
Reporter | ||
Comment 11•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b9
You need to log in
before you can comment on or make changes to this bug.
Description
•