Index: third_party/WebKit/Source/core/editing/markers/CompositionMarkerListImpl.h |
diff --git a/third_party/WebKit/Source/core/editing/markers/CompositionMarkerListImpl.h b/third_party/WebKit/Source/core/editing/markers/CompositionMarkerListImpl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0c790e95aa89d06712d9328a0ebd25a9ea71c76c |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/editing/markers/CompositionMarkerListImpl.h |
@@ -0,0 +1,42 @@ |
+// 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 CompositionMarkerListImpl_h |
+#define CompositionMarkerListImpl_h |
+ |
+#include "core/editing/markers/DocumentMarkerList.h" |
+ |
+namespace blink { |
+ |
+// Implementation of DocumentMarkerList for Composition markers. |
+// Markers are kept sorted by start offset, under the assumption that |
+// Composition markers are typically inserted in an order. |
Xiaocheng
2017/04/26 14:17:53
Is MoveMarkers() the only site making out-of-order
rlanday
2017/04/26 20:33:24
The implication is supposed to be that we can keep
|
+class CORE_EXPORT CompositionMarkerListImpl : public DocumentMarkerList { |
Xiaocheng
2017/04/26 14:17:53
nit: final
|
+ public: |
+ CompositionMarkerListImpl() = default; |
+ |
+ // DocumentMarkerList implementations |
+ bool IsEmpty() const final; |
+ |
+ void Add(DocumentMarker*) final; |
+ void Clear() final; |
+ |
+ const HeapVector<Member<RenderedDocumentMarker>>& GetMarkers() const final; |
+ |
+ bool MoveMarkers(int length, DocumentMarkerList* dst_list) final; |
+ bool RemoveMarkers(unsigned start_offset, int length) final; |
+ bool ShiftMarkers(unsigned offset, |
+ unsigned old_length, |
+ unsigned new_length) final; |
+ DECLARE_TRACE(); |
+ |
+ private: |
+ HeapVector<Member<RenderedDocumentMarker>> markers_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(CompositionMarkerListImpl); |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // CompositionMarkerListImpl_h |