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..bcc977b31cfa1cfad23c7ec9acfcf124f33ad542 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerList.h |
| @@ -0,0 +1,63 @@ |
| +// 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 CORE_EXPORT DocumentMarkerList |
| + : public GarbageCollected<DocumentMarkerList> { |
| + public: |
| + explicit DocumentMarkerList(DocumentMarkerController*); |
| + using iterator = Member<DocumentMarker>*; |
| + using const_iterator = const Member<DocumentMarker>*; |
| + |
| + virtual DocumentMarker::MarkerType allowedMarkerType() const = 0; |
| + virtual bool isEditingMarkerList() const; |
| + virtual bool isSpellCheckMarkerList() const; |
| + |
| + size_t size() const { return m_markers.size(); } |
| + bool empty() const { return m_markers.isEmpty(); } |
| + DocumentMarker* at(size_t index) { return m_markers[index].get(); } |
| + |
| + virtual void clear() = 0; |
| + |
| + iterator begin(); |
|
Xiaocheng
2017/03/24 19:43:49
These four should also be inlined.
|
| + iterator end(); |
| + const_iterator begin() const; |
| + const_iterator end() const; |
| + |
| + void appendMarkersToInputList(DocumentMarkerVector* list) const; |
| + |
| + bool copyMarkers(unsigned startOffset, |
| + int length, |
| + Node* dstNode, |
| + int delta) const; |
| + void removeMarkers(unsigned startOffset, |
| + int length, |
| + bool shouldRemovePartiallyOverlappingMarkers, |
| + bool* didRemoveMarker); |
| + bool shiftMarkers(unsigned offset, unsigned oldLength, unsigned newLength); |
| + |
| + DECLARE_VIRTUAL_TRACE(); |
| + |
| + protected: |
| + iterator getPosOfFirstMarkerNotEndingBefore(size_t startOffset); |
| + virtual bool markerListIsSorted() const = 0; |
| + |
| + Member<DocumentMarkerController> m_documentMarkerController; |
| + HeapVector<Member<DocumentMarker>> m_markers; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList); |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // DocumentMarkerList_h |