Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Side by Side Diff: Source/core/dom/DocumentMarkerController.h

Issue 23728006: addMarker() optimizations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Compilation fix Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/dom/DocumentMarker.h ('k') | Source/core/dom/DocumentMarkerController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 Vector<IntRect> renderedRectsForMarkers(DocumentMarker::MarkerType); 80 Vector<IntRect> renderedRectsForMarkers(DocumentMarker::MarkerType);
81 81
82 #ifndef NDEBUG 82 #ifndef NDEBUG
83 void showMarkers() const; 83 void showMarkers() const;
84 #endif 84 #endif
85 85
86 private: 86 private:
87 void addMarker(Node*, const DocumentMarker&); 87 void addMarker(Node*, const DocumentMarker&);
88 88
89 typedef Vector<RenderedDocumentMarker> MarkerList; 89 typedef Vector<RenderedDocumentMarker> MarkerList;
90 typedef HashMap<RefPtr<Node>, OwnPtr<MarkerList> > MarkerMap; 90 typedef Vector<OwnPtr<MarkerList>, DocumentMarker::MarkerTypeIndexesCount> M arkerLists;
91 typedef HashMap<RefPtr<Node>, OwnPtr<MarkerLists> > MarkerMap;
92 void mergeOverlapping(MarkerList*, DocumentMarker&);
91 bool possiblyHasMarkers(DocumentMarker::MarkerTypes); 93 bool possiblyHasMarkers(DocumentMarker::MarkerTypes);
92 void removeMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes) ; 94 void removeMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes) ;
93 95
94 MarkerMap m_markers; 96 MarkerMap m_markers;
95 // Provide a quick way to determine whether a particular marker type is abse nt without going through the map. 97 // Provide a quick way to determine whether a particular marker type is abse nt without going through the map.
96 DocumentMarker::MarkerTypes m_possiblyExistingMarkerTypes; 98 DocumentMarker::MarkerTypes m_possiblyExistingMarkerTypes;
97 }; 99 };
98 100
99 } // namespace WebCore 101 } // namespace WebCore
100 102
101 #ifndef NDEBUG 103 #ifndef NDEBUG
102 void showDocumentMarkers(const WebCore::DocumentMarkerController*); 104 void showDocumentMarkers(const WebCore::DocumentMarkerController*);
103 #endif 105 #endif
104 106
105 #endif // DocumentMarkerController_h 107 #endif // DocumentMarkerController_h
OLDNEW
« no previous file with comments | « Source/core/dom/DocumentMarker.h ('k') | Source/core/dom/DocumentMarkerController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698