| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef TextMatchMarkerListImpl_h | 5 #ifndef TextMatchMarkerListImpl_h |
| 6 #define TextMatchMarkerListImpl_h | 6 #define TextMatchMarkerListImpl_h |
| 7 | 7 |
| 8 #include "core/editing/markers/DocumentMarkerList.h" | 8 #include "core/editing/markers/DocumentMarkerList.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class IntRect; | 12 class IntRect; |
| 13 | 13 |
| 14 // Implementation of DocumentMarkerList for TextMatch markers. | 14 // Implementation of DocumentMarkerList for TextMatch markers. |
| 15 // Markers are kept sorted by start offset, under the assumption that | 15 // Markers are kept sorted by start offset, under the assumption that |
| 16 // TextMatch markers are typically inserted in an order. | 16 // TextMatch markers are typically inserted in an order. |
| 17 class CORE_EXPORT TextMatchMarkerListImpl final : public DocumentMarkerList { | 17 class CORE_EXPORT TextMatchMarkerListImpl final : public DocumentMarkerList { |
| 18 public: | 18 public: |
| 19 TextMatchMarkerListImpl() = default; | 19 TextMatchMarkerListImpl() = default; |
| 20 | 20 |
| 21 // DocumentMarkerList implementations | 21 // DocumentMarkerList implementations |
| 22 DocumentMarker::MarkerType MarkerType() const final; | 22 DocumentMarker::MarkerType MarkerType() const final; |
| 23 | 23 |
| 24 bool IsEmpty() const final; | 24 bool IsEmpty() const final; |
| 25 | 25 |
| 26 void Add(DocumentMarker*) final; | 26 void Add(DocumentMarker*) final; |
| 27 void Clear() final; | 27 void Clear() final; |
| 28 | 28 |
| 29 const HeapVector<Member<DocumentMarker>>& GetMarkers() const final; | 29 const HeapVector<Member<DocumentMarker>>& GetMarkers() const final; |
| 30 DocumentMarker* FirstMarkerIntersectingRange(unsigned start_offset, |
| 31 unsigned end_offset) const final; |
| 30 HeapVector<Member<DocumentMarker>> MarkersIntersectingRange( | 32 HeapVector<Member<DocumentMarker>> MarkersIntersectingRange( |
| 31 unsigned start_offset, | 33 unsigned start_offset, |
| 32 unsigned end_offset) const final; | 34 unsigned end_offset) const final; |
| 33 | 35 |
| 34 bool MoveMarkers(int length, DocumentMarkerList* dst_list) final; | 36 bool MoveMarkers(int length, DocumentMarkerList* dst_list) final; |
| 35 bool RemoveMarkers(unsigned start_offset, int length) final; | 37 bool RemoveMarkers(unsigned start_offset, int length) final; |
| 36 bool ShiftMarkers(unsigned offset, | 38 bool ShiftMarkers(unsigned offset, |
| 37 unsigned old_length, | 39 unsigned old_length, |
| 38 unsigned new_length) final; | 40 unsigned new_length) final; |
| 39 DECLARE_VIRTUAL_TRACE(); | 41 DECLARE_VIRTUAL_TRACE(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 54 | 56 |
| 55 DEFINE_TYPE_CASTS(TextMatchMarkerListImpl, | 57 DEFINE_TYPE_CASTS(TextMatchMarkerListImpl, |
| 56 DocumentMarkerList, | 58 DocumentMarkerList, |
| 57 list, | 59 list, |
| 58 list->MarkerType() == DocumentMarker::kTextMatch, | 60 list->MarkerType() == DocumentMarker::kTextMatch, |
| 59 list.MarkerType() == DocumentMarker::kTextMatch); | 61 list.MarkerType() == DocumentMarker::kTextMatch); |
| 60 | 62 |
| 61 } // namespace blink | 63 } // namespace blink |
| 62 | 64 |
| 63 #endif // TextMatchMarkerListImpl_h | 65 #endif // TextMatchMarkerListImpl_h |
| OLD | NEW |