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

Side by Side Diff: third_party/WebKit/Source/core/editing/markers/TextMatchMarkerListImpl.h

Issue 2952953002: [MarkersIntersectingRange #1] Add DocumentMarkerList::MarkersIntersectingRange() (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
OLDNEW
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 HeapVector<Member<DocumentMarker>> MarkersIntersectingRange(
31 unsigned start_offset,
32 unsigned end_offset) const final;
30 33
31 bool MoveMarkers(int length, DocumentMarkerList* dst_list) final; 34 bool MoveMarkers(int length, DocumentMarkerList* dst_list) final;
32 bool RemoveMarkers(unsigned start_offset, int length) final; 35 bool RemoveMarkers(unsigned start_offset, int length) final;
33 bool ShiftMarkers(unsigned offset, 36 bool ShiftMarkers(unsigned offset,
34 unsigned old_length, 37 unsigned old_length,
35 unsigned new_length) final; 38 unsigned new_length) final;
36 DECLARE_VIRTUAL_TRACE(); 39 DECLARE_VIRTUAL_TRACE();
37 40
38 // TextMatchMarkerListImpl-specific 41 // TextMatchMarkerListImpl-specific
39 Vector<IntRect> LayoutRects(const Node&) const; 42 Vector<IntRect> LayoutRects(const Node&) const;
(...skipping 11 matching lines...) Expand all
51 54
52 DEFINE_TYPE_CASTS(TextMatchMarkerListImpl, 55 DEFINE_TYPE_CASTS(TextMatchMarkerListImpl,
53 DocumentMarkerList, 56 DocumentMarkerList,
54 list, 57 list,
55 list->MarkerType() == DocumentMarker::kTextMatch, 58 list->MarkerType() == DocumentMarker::kTextMatch,
56 list.MarkerType() == DocumentMarker::kTextMatch); 59 list.MarkerType() == DocumentMarker::kTextMatch);
57 60
58 } // namespace blink 61 } // namespace blink
59 62
60 #endif // TextMatchMarkerListImpl_h 63 #endif // TextMatchMarkerListImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698