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

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

Issue 2723663002: Refactor DocumentMarkerController (Closed)
Patch Set: Rebase on https://codereview.chromium.org/2755013004 Created 3 years, 9 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/EditingMarkerList.h
diff --git a/third_party/WebKit/Source/core/editing/markers/EditingMarkerList.h b/third_party/WebKit/Source/core/editing/markers/EditingMarkerList.h
new file mode 100644
index 0000000000000000000000000000000000000000..ed193286988b3bfd16f72188f9a79eb37103ce07
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/EditingMarkerList.h
@@ -0,0 +1,59 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EditingMarkerList_h
+#define EditingMarkerList_h
+
+#include "core/editing/markers/DocumentMarkerList.h"
+
+namespace blink {
+
+class DocumentMarker;
+
+class EditingMarkerList : public DocumentMarkerList {
+ WTF_MAKE_NONCOPYABLE(EditingMarkerList);
+
+ public:
+ explicit EditingMarkerList(DocumentMarkerController*);
+
+ // DocumentMarkerList implementations
+ size_t size() const final;
+ bool empty() const final;
+ DocumentMarker* at(size_t index) final;
+
+ void clear() final;
+
+ iterator begin() final;
+ iterator end() final;
+ const_iterator begin() const final;
+ const_iterator end() const final;
+
+ void appendMarkersToInputList(DocumentMarkerVector* list) const final;
+ bool copyMarkers(unsigned startOffset,
+ int length,
+ Node* dstNode,
+ int delta) const final;
+ void removeMarkers(unsigned startOffset,
+ int length,
+ bool shouldRemovePartiallyOverlappingMarkers,
+ bool* didRemoveMarker) final;
+ bool shiftMarkers(unsigned offset,
+ unsigned oldLength,
+ unsigned newLength) final;
+
+ // EditingMarkerList-specific
+ virtual void insert(DocumentMarker*);
+
+ DECLARE_VIRTUAL_TRACE();
+
+ protected:
+ void sortMarkerList();
+
+ bool m_markersAreSorted;
+ HeapVector<Member<DocumentMarker>> m_markers;
+};
+
+} // namespace blink
+
+#endif // EditingMarkerList_h

Powered by Google App Engine
This is Rietveld 408576698