Index: third_party/WebKit/Source/core/editing/markers/CompositionMarkerList.cpp |
diff --git a/third_party/WebKit/Source/core/editing/markers/CompositionMarkerList.cpp b/third_party/WebKit/Source/core/editing/markers/CompositionMarkerList.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1188eb702d8cc23f4841e64fc5272a7af9825725 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/editing/markers/CompositionMarkerList.cpp |
@@ -0,0 +1,53 @@ |
+// 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. |
+ |
+#include "core/editing/markers/CompositionMarkerList.h" |
+ |
+#include "core/editing/markers/DocumentMarkerListEditor.h" |
+ |
+namespace blink { |
+ |
+CompositionMarkerList::CompositionMarkerList() = default; |
+ |
+bool CompositionMarkerList::Empty() const { |
+ return markers_.IsEmpty(); |
+} |
+ |
+void CompositionMarkerList::Add(DocumentMarker* marker) { |
+ markers_.push_back(marker); |
+} |
+ |
+void CompositionMarkerList::Clear() { |
+ markers_.Clear(); |
+} |
+ |
+void CompositionMarkerList::AppendMarkersToInputList( |
+ DocumentMarkerVector* list) const { |
+ list->AppendVector(markers_); |
+} |
+ |
+bool CompositionMarkerList::MoveMarkers(int length, |
+ DocumentMarkerList* dst_list) { |
+ return DocumentMarkerListEditor::MoveUnsortedMarkers(&markers_, length, |
+ dst_list); |
+} |
+ |
+bool CompositionMarkerList::RemoveMarkers(unsigned start_offset, int length) { |
+ return DocumentMarkerListEditor::RemoveUnsortedMarkers(&markers_, |
+ start_offset, length); |
+} |
+ |
+bool CompositionMarkerList::ShiftMarkers(unsigned offset, |
+ unsigned old_length, |
+ unsigned new_length) { |
+ return DocumentMarkerListEditor::ShiftUnsortedMarkers(&markers_, offset, |
+ old_length, new_length); |
+} |
+ |
+DEFINE_TRACE(CompositionMarkerList) { |
+ visitor->Trace(markers_); |
+ DocumentMarkerList::Trace(visitor); |
+} |
+ |
+} // namespace blink |