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

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
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..c3c87f27ebc1f767f9f2c31ce211762242e60717 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*);
+
+ static bool MoveMarkers(MarkerList* src_list,
+ int length,
+ MarkerList* dst_list);
+ static bool RemoveMarkers(MarkerList*, unsigned start_offset, int length);
+ 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);

Powered by Google App Engine
This is Rietveld 408576698