Closed
Bug 815397
Opened 12 years ago
Closed 12 years ago
Update Accessibility cycle collector traverse/unlink definitions
Categories
(Core :: Disability Access APIs, defect)
Core
Disability Access APIs
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: mccr8, Assigned: mccr8)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
17.44 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•12 years ago
|
||
There are a few categories of changes here: - A number of cases with ambiguous bases can be handled automatically now. - Similarly with nsTArrays - Removed a null check that isn't really needed - I added automated CC support for AccessibleHashtable, and made these fields use the generic definitions. - After the other changes, a number of the Traverse/Unlink definitions are very generic and can be replaced with a single macro call. Plus, some existing ones can now be replaced, because INHERITED is supported. It seems a little odd to me that mDependentIDsHash and mNodeToAccessibleMap are cleared in the Unlink of DocAccessible, but aren't Traversed. Not knowing anything about this code, I'd have expected that either these tables be added to the Traverse, or be moved to the destructor. I left that alone. I haven't actually tested this patch yet.
Assignee: nobody → continuation
Comment 2•12 years ago
|
||
> - I added automated CC support for AccessibleHashtable, and made these > fields use the generic definitions. do we have automated support for generic hash tables? if so we might well want to just get rid of the accessible cache thing all together, if not hopefully someday I'll get around to templating that stuff harder so we can cache things as types other than Accessible* > It seems a little odd to me that mDependentIDsHash and mNodeToAccessibleMap > are cleared in the Unlink of DocAccessible, but aren't Traversed. Not > knowing anything about this code, I'd have expected that either these tables > be added to the Traverse, or be moved to the destructor. I left that alone. as I remember it they don't hold any refs, so moving the calls to Shutdown() seems like the right thing to do.
Assignee | ||
Comment 3•12 years ago
|
||
(In reply to Trevor Saunders (:tbsaunde) from comment #2) > do we have automated support for generic hash tables? if so we might well > want to just get rid of the accessible cache thing all together, if not > hopefully someday I'll get around to templating that stuff harder so we can > cache things as types other than Accessible* No, we don't. Hash tables are pretty common, so it would be nice to have, though that won't help with PLDHashTables that don't have templated types. > as I remember it they don't hold any refs, so moving the calls to Shutdown() > seems like the right thing to do. Okay, great, I'll look into that.
Assignee | ||
Comment 4•12 years ago
|
||
mDependentIDsHash has type nsClassHashtable<nsStringHashKey, AttrRelProviderArray>. The latter is defined like this: typedef nsTArray<nsAutoPtr<AttrRelProvider> > AttrRelProviderArray; AttrRelProvider is not a cycle collected class, though it does contain a field: nsCOMPtr<nsIContent> mContent; So maybe it should be cycle collected? mNodeToAccessibleMap has type nsDataHashtable<nsPtrHashKey<const nsINode>, Accessible*>, so it doesn't own anything and should be okay.
Comment 5•12 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #4) > mDependentIDsHash has type nsClassHashtable<nsStringHashKey, > AttrRelProviderArray>. > > The latter is defined like this: > typedef nsTArray<nsAutoPtr<AttrRelProvider> > AttrRelProviderArray; > > AttrRelProvider is not a cycle collected class, though it does contain a > field: > nsCOMPtr<nsIContent> mContent; > So maybe it should be cycle collected? I guess so though I don't see how that member could ever point to something that isn't certainly alive, those nsIContent*s should only be things where IsInDoc() is true.
Assignee | ||
Comment 6•12 years ago
|
||
Okay, great, I'll just leave it alone then.
Comment 7•12 years ago
|
||
Could we assert that the mContent is always in a document which is certainly alive?
Assignee | ||
Updated•12 years ago
|
Attachment #685366 -
Flags: review?(bugs)
Assignee | ||
Comment 8•12 years ago
|
||
I can file a followup for that.
Assignee | ||
Comment 9•12 years ago
|
||
Filed bug 815837.
Comment 10•12 years ago
|
||
Comment on attachment 685366 [details] [diff] [review] update them >+inline void >+ImplCycleCollectionUnlink(AccessibleHashtable &aCache) AccessibleHashtable& aCache > >+#define NS_IMPL_CYCLE_COLLECTION_NATIVE_0(_class) \ >+ NS_IMPL_CYCLE_COLLECTION_NATIVE_CLASS(_class) \ >+ NS_IMPL_CYCLE_COLLECTION_UNLINK_0(_class) \ >+ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class) \ >+ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END I don't see any need for _0 And _0 case should be also very odd case which means probably a bug elsewhere. Perhaps better to not add it.
Attachment #685366 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 11•12 years ago
|
||
True. I'll not add it, and then put a little comment about why.
Assignee | ||
Comment 12•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/95afbeaf4fe9
Comment 13•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/95afbeaf4fe9
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in
before you can comment on or make changes to this bug.
Description
•