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

Unified Diff: third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h

Issue 2812423002: [DMC #1] Refactor DocumentMarkerController on top of new DocumentMarkerListEditor class (Closed)
Patch Set: Respond to comments Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h
index 67ea88da93bdc582fe9c7d140e271cca5d7e0510..ba19a6156a4d800dcc43f0c04eeaafec3d70ad48 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h
@@ -53,6 +53,25 @@ class MarkerRemoverPredicate final {
Vector<String> words_;
};
+class DocumentMarkerListEditor {
+ public:
+ using MarkerList = HeapVector<Member<RenderedDocumentMarker>>;
+
+ static void AddMarker(MarkerList*, const DocumentMarker*);
+
+ // Returns true if a marker was removed, false otherwise.
+ static bool RemoveMarkers(MarkerList*, unsigned start_offset, int length);
+
+ // Returns true if a marker was shifted or removed, false otherwise.
+ static bool ShiftMarkers(MarkerList*,
+ unsigned offset,
+ unsigned old_length,
+ unsigned new_length);
+
+ private:
+ static void MergeOverlapping(MarkerList*, RenderedDocumentMarker* to_insert);
+};
+
class CORE_EXPORT DocumentMarkerController final
: public GarbageCollected<DocumentMarkerController>,
public SynchronousMutationObserver {
@@ -133,7 +152,6 @@ class CORE_EXPORT DocumentMarkerController final
using MarkerLists =
HeapVector<Member<MarkerList>, DocumentMarker::kMarkerTypeIndexesCount>;
using MarkerMap = HeapHashMap<WeakMember<const Node>, Member<MarkerLists>>;
- void MergeOverlapping(MarkerList*, RenderedDocumentMarker*);
bool PossiblyHasMarkers(DocumentMarker::MarkerTypes);
void RemoveMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes);
void RemoveMarkers(TextIterator&, DocumentMarker::MarkerTypes);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698