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

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

Issue 2811083005: Add DocumentMarkerListEditor (Closed)
Patch Set: Fix test 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/DocumentMarkerListEditor.h
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.h
new file mode 100644
index 0000000000000000000000000000000000000000..9f4189b7724bbd51dfdb3b23f009d18a1d3d4f20
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.h
@@ -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.
+
+#ifndef DocumentMarkerListEditor_h
+#define DocumentMarkerListEditor_h
+
+#include "core/editing/markers/DocumentMarkerList.h"
+
+namespace blink {
+
+class CORE_EXPORT DocumentMarkerListEditor {
+ public:
+ static DocumentMarkerVector::iterator
+ GetPosOfFirstMarkerNotEndingBeforeInSortedList(
+ DocumentMarkerVector* marker_list,
+ size_t start_offset);
+
+ static bool MoveUnsortedMarkers(DocumentMarkerVector* marker_list,
+ int length,
+ DocumentMarkerList* dst_list);
+ static bool MoveSortedMarkers(DocumentMarkerVector* marker_list,
+ int length,
+ DocumentMarkerList* dst_list);
+
+ static bool RemoveUnsortedMarkers(DocumentMarkerVector* marker_list,
+ unsigned start_offset,
+ int length);
+ static bool RemoveSortedMarkers(DocumentMarkerVector* marker_list,
+ unsigned start_offset,
+ int length);
+
+ static bool ShiftUnsortedMarkers(DocumentMarkerVector* marker_list,
+ unsigned offset,
+ unsigned old_length,
+ unsigned new_length);
+ static bool ShiftSortedMarkers(DocumentMarkerVector* marker_list,
+ unsigned offset,
+ unsigned old_length,
+ unsigned new_length);
+
+ private:
+ DocumentMarkerListEditor();
+
+ static bool MoveMarkersHelper(DocumentMarkerVector* marker_list,
+ int length,
+ DocumentMarkerList* dst_list,
+ bool is_sorted);
+};
+
+} // namespace blink
+
+#endif // DocumentMarkerListEditor_h

Powered by Google App Engine
This is Rietveld 408576698