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

Unified Diff: third_party/WebKit/Source/core/editing/markers/DocumentMarkerListUtils.cpp

Issue 2805553003: DocumentMarkerList refactor as an interface (Closed)
Patch Set: 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/DocumentMarkerListUtils.cpp
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListUtils.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListUtils.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2ee7e43ee285c8dccac0d8874e67598bd744e9ed
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListUtils.cpp
@@ -0,0 +1,84 @@
+// 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/DocumentMarkerListUtils.h"
+
+namespace blink {
+
+DocumentMarkerList::iterator
+DocumentMarkerListUtils::getPosOfFirstMarkerNotEndingBeforeInSortedList(
+ MarkerList* markerList,
+ size_t startOffset) {
+ return std::upper_bound(
+ markerList->begin(), markerList->end(), startOffset,
+ [](size_t startOffset, const Member<DocumentMarker>& rhv) -> bool {
+ return startOffset < rhv->endOffset();
+ });
+}
+
+void DocumentMarkerListUtils::appendMarkersToInputList(
+ const MarkerList*,
+ DocumentMarkerVector* inputList) {
+ // TODO(rlanday): actually implement
+}
+
+DocumentMarkerList::DidCopyMarkerOrNot
+DocumentMarkerListUtils::copyUnsortedMarkers(MarkerList*,
+ unsigned startOffset,
+ int length,
+ DocumentMarkerList* dstList,
+ int delta) {
+ // TODO(rlanday): actually implement
+ return DocumentMarkerList::DidCopyMarkerOrNot::DidCopyMarker;
+}
+
+DocumentMarkerList::DidCopyMarkerOrNot
+DocumentMarkerListUtils::copySortedMarkers(MarkerList*,
+ unsigned startOffset,
+ int length,
+ DocumentMarkerList* dstList,
+ int delta) {
+ // TODO(rlanday): actually implement
+ return DocumentMarkerList::DidCopyMarkerOrNot::DidCopyMarker;
+}
+
+DocumentMarkerList::DidRemoveMarkerOrNot
+DocumentMarkerListUtils::removeUnsortedMarkers(
+ MarkerList*,
+ unsigned startOffset,
+ int length,
+ bool shouldRemovePartiallyOverlappingMarkers) {
+ // TODO(rlanday): actually implement
+ return DocumentMarkerList::DidRemoveMarkerOrNot::DidRemoveMarker;
+}
+
+DocumentMarkerList::DidRemoveMarkerOrNot
+DocumentMarkerListUtils::removeSortedMarkers(
+ MarkerList*,
+ unsigned startOffset,
+ int length,
+ bool shouldRemovePartiallyOverlappingMarkers) {
+ // TODO(rlanday): actually implement
+ return DocumentMarkerList::DidRemoveMarkerOrNot::DidRemoveMarker;
+}
+
+DocumentMarkerList::DidShiftMarkerOrNot
+DocumentMarkerListUtils::shiftUnsortedMarkers(MarkerList*,
+ unsigned offset,
+ unsigned oldLength,
+ unsigned newLength) {
+ // TODO(rlanday): actually implement
+ return DocumentMarkerList::DidShiftMarkerOrNot::DidShiftMarker;
+}
+
+DocumentMarkerList::DidShiftMarkerOrNot
+DocumentMarkerListUtils::shiftSortedMarkers(MarkerList*,
+ unsigned offset,
+ unsigned oldLength,
+ unsigned newLength) {
+ // TODO(rlanday): actually implement
+ return DocumentMarkerList::DidShiftMarkerOrNot::DidShiftMarker;
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698