Summary: | Encapsulate document marker management into DocumentMarkerController | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Daniel Bates <dbates> | ||||
Component: | WebCore Misc. | Assignee: | Daniel Bates <dbates> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | abarth, eric | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
Description
Daniel Bates
2010-08-21 13:43:02 PDT
Created attachment 65035 [details]
Patch
I named the new class DocumentMarkerController and the accessor markerController() (in Document.cpp). I am open to name suggestions.
Comment on attachment 65035 [details]
Patch
Yay! Thank you Dan!
WebCore/dom/Document.h:1173
+ mutable DocumentMarkerController m_markerController;
It's better for build times if this is an OwnPtr instead. When its a mutable member you have to include the header in Document.h. The only reason (I know of) to make these mutable members is to avoid the pointer indirection in hot code paths. But I don't think DocumentMarkers are hot. This is not a deal breaker either way.
WebCore/dom/DocumentMarkerController.h:48
+ void copyMarkers(Node *srcNode, unsigned startOffset, int length, Node *dstNode, int delta, DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
Style.
WebCore/editing/Editor.cpp:1566
+ frame()->document()->markerController()->removeMarkers(selectedRange.get(), DocumentMarker::Spelling);
I might have called the markerController() just markers().
LGTM.
(In reply to comment #2) > (From update of attachment 65035 [details]) > Yay! Thank you Dan! > > WebCore/dom/Document.h:1173 > + mutable DocumentMarkerController m_markerController; > It's better for build times if this is an OwnPtr instead. When its a mutable member you have to include the header in Document.h. The only reason (I know of) to make these mutable members is to avoid the pointer indirection in hot code paths. But I don't think DocumentMarkers are hot. This is not a deal breaker either way. > Will change. > WebCore/dom/DocumentMarkerController.h:48 > + void copyMarkers(Node *srcNode, unsigned startOffset, int length, Node *dstNode, int delta, DocumentMarker::MarkerType = DocumentMarker::AllMarkers); > Style. > Will fix style. > WebCore/editing/Editor.cpp:1566 > + frame()->document()->markerController()->removeMarkers(selectedRange.get(), DocumentMarker::Spelling); > I might have called the markerController() just markers(). > Will rename. > LGTM. Committed r65787: <http://trac.webkit.org/changeset/65787> |