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

Unified Diff: third_party/WebKit/Source/core/editing/markers/DocumentMarkerList.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/DocumentMarkerList.h
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerList.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerList.h
new file mode 100644
index 0000000000000000000000000000000000000000..1138656fbcc8d10ac6ba010cb6ea6d01aaea9a53
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerList.h
@@ -0,0 +1,49 @@
+// 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 DocumentMarkerList_h
+#define DocumentMarkerList_h
+
+#include "core/editing/markers/DocumentMarker.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class CORE_EXPORT DocumentMarkerList
+ : public GarbageCollectedFinalized<DocumentMarkerList> {
+ public:
+ DocumentMarkerList();
+
+ virtual ~DocumentMarkerList();
+
+ virtual DocumentMarker::MarkerType GetAllowedMarkerType() const = 0;
+
+ virtual bool Empty() const = 0;
+ virtual DocumentMarker* At(size_t index) = 0;
+
+ virtual void Add(DocumentMarker*) = 0;
+ virtual void Clear() = 0;
+
+ virtual void AppendMarkersToInputList(DocumentMarkerVector* list) const = 0;
+
+ enum class DidMoveMarkerOrNot { kDidNotMoveMarker, kDidMoveMarker };
+ virtual DidMoveMarkerOrNot MoveMarkers(int length,
+ DocumentMarkerList* dst_list) = 0;
+
+ enum class DidRemoveMarkerOrNot { kDidNotRemoveMarker, kDidRemoveMarker };
+ virtual DidRemoveMarkerOrNot RemoveMarkers(unsigned start_offset,
+ int length) = 0;
+
+ enum class DidShiftMarkerOrNot { kDidNotShiftMarker, kDidShiftMarker };
+ virtual DidShiftMarkerOrNot ShiftMarkers(unsigned offset,
+ unsigned old_length,
+ unsigned new_length) = 0;
+
+ DEFINE_INLINE_VIRTUAL_TRACE() {}
+ DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList);
+};
+
+} // namespace blink
+
+#endif // DocumentMarkerList_h

Powered by Google App Engine
This is Rietveld 408576698