Chromium Code Reviews| 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..25dd4b07ee900c6018e62fa42c946b5104bb5e8d |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerList.h |
| @@ -0,0 +1,65 @@ |
| +// 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 DocumentMarkerController; |
| + |
| +class DocumentMarkerList : public GarbageCollected<DocumentMarkerList> { |
| + WTF_MAKE_NONCOPYABLE(DocumentMarkerList); |
|
Xiaocheng
2017/03/21 03:59:44
nit: It's a little bit weird to me to have both WT
|
| + |
| + public: |
| + explicit DocumentMarkerList(DocumentMarkerController*); |
| + using iterator = Member<DocumentMarker>*; |
| + using const_iterator = const Member<DocumentMarker>*; |
| + |
| + virtual DocumentMarker::MarkerType allowedMarkerType() const = 0; |
| + |
| + size_t size() const; |
| + bool empty() const; |
| + virtual DocumentMarker* at(size_t index); |
| + |
| + virtual void clear() = 0; |
| + |
| + iterator begin(); |
| + iterator end(); |
| + const_iterator begin() const; |
| + const_iterator end() const; |
| + |
| + void appendMarkersToInputList(DocumentMarkerVector* list) const; |
| + |
| + virtual bool copyMarkers(unsigned startOffset, |
| + int length, |
| + Node* dstNode, |
| + int delta) const = 0; |
| + virtual void removeMarkers(unsigned startOffset, |
| + int length, |
| + bool shouldRemovePartiallyOverlappingMarkers, |
| + bool* didRemoveMarker) = 0; |
| + virtual bool shiftMarkers(unsigned offset, |
| + unsigned oldLength, |
| + unsigned newLength) = 0; |
| + |
| + DECLARE_VIRTUAL_TRACE(); |
| + |
| + protected: |
| + HeapVector<Member<DocumentMarker>>::iterator |
| + getPosOfFirstMarkerNotEndingBefore(size_t startOffset); |
| + |
| + Member<DocumentMarkerController> m_documentMarkerController; |
| + HeapVector<Member<DocumentMarker>> m_markers; |
| + |
| + private: |
| + static bool endsBefore(size_t startOffset, const Member<DocumentMarker>& rhv); |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // DocumentMarkerList_h |