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

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

Issue 2805553003: DocumentMarkerList refactor as an interface (Closed)
Patch Set: Rebase on renaming patch, respond to 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/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..535538e49da51d104bbf12f2ae8f863d0a5548ed
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.h
@@ -0,0 +1,60 @@
+// 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 DocumentMarkerListEditor {
+ public:
+ static DocumentMarkerVector::iterator
+ GetPosOfFirstMarkerNotEndingBeforeInSortedList(
+ DocumentMarkerVector* marker_list,
+ size_t start_offset);
+
+ static DocumentMarkerList::DidMoveMarkerOrNot MoveUnsortedMarkers(
+ DocumentMarkerVector* marker_list,
+ int length,
+ DocumentMarkerList* dst_list);
+ static DocumentMarkerList::DidMoveMarkerOrNot MoveSortedMarkers(
+ DocumentMarkerVector* marker_list,
+ int length,
+ DocumentMarkerList* dst_list);
+
+ static DocumentMarkerList::DidRemoveMarkerOrNot RemoveUnsortedMarkers(
+ DocumentMarkerVector* marker_list,
+ unsigned start_offset,
+ int length);
+ static DocumentMarkerList::DidRemoveMarkerOrNot RemoveSortedMarkers(
+ DocumentMarkerVector* marker_list,
+ unsigned start_offset,
+ int length);
+
+ static DocumentMarkerList::DidShiftMarkerOrNot ShiftUnsortedMarkers(
+ DocumentMarkerVector* marker_list,
+ unsigned offset,
+ unsigned old_length,
+ unsigned new_length);
+ static DocumentMarkerList::DidShiftMarkerOrNot ShiftSortedMarkers(
+ DocumentMarkerVector* marker_list,
+ unsigned offset,
+ unsigned old_length,
+ unsigned new_length);
+
+ private:
+ DocumentMarkerListEditor();
+
+ static DocumentMarkerList::DidMoveMarkerOrNot 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