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

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

Issue 2820343004: [DMC #4] Add CompositionMarkerListImpl (Closed)
Patch Set: Add 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/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

Powered by Google App Engine
This is Rietveld 408576698