OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef DocumentMarkerList_h | |
6 #define DocumentMarkerList_h | |
7 | |
8 #include "core/editing/markers/DocumentMarker.h" | |
9 #include "platform/heap/Handle.h" | |
10 | |
11 namespace blink { | |
12 | |
13 class DocumentMarkerController; | |
14 | |
15 class CORE_EXPORT DocumentMarkerList | |
16 : public GarbageCollected<DocumentMarkerList> { | |
17 public: | |
18 explicit DocumentMarkerList(DocumentMarkerController*); | |
19 using iterator = Member<DocumentMarker>*; | |
20 using const_iterator = const Member<DocumentMarker>*; | |
21 | |
22 virtual DocumentMarker::MarkerType allowedMarkerType() const = 0; | |
23 virtual bool isEditingMarkerList() const; | |
24 virtual bool isSpellCheckMarkerList() const; | |
25 | |
26 size_t size() const; | |
Xiaocheng
2017/03/24 03:57:47
These getters should be inlined for efficiency.
rlanday
2017/03/24 17:45:48
Ok
| |
27 bool empty() const; | |
28 virtual DocumentMarker* at(size_t index); | |
Xiaocheng
2017/03/24 03:57:47
I guess this function no longer needs to be virtua
rlanday
2017/03/24 17:45:48
Oh, good catch!
| |
29 | |
30 virtual void clear() = 0; | |
31 | |
32 iterator begin(); | |
33 iterator end(); | |
34 const_iterator begin() const; | |
35 const_iterator end() const; | |
36 | |
37 void appendMarkersToInputList(DocumentMarkerVector* list) const; | |
38 | |
39 bool copyMarkers(unsigned startOffset, | |
40 int length, | |
41 Node* dstNode, | |
42 int delta) const; | |
43 virtual void removeMarkers(unsigned startOffset, | |
44 int length, | |
45 bool shouldRemovePartiallyOverlappingMarkers, | |
46 bool* didRemoveMarker) = 0; | |
47 virtual bool shiftMarkers(unsigned offset, | |
48 unsigned oldLength, | |
49 unsigned newLength) = 0; | |
50 | |
51 DECLARE_VIRTUAL_TRACE(); | |
52 | |
53 protected: | |
54 HeapVector<Member<DocumentMarker>>::iterator | |
Xiaocheng
2017/03/24 03:57:47
Is it just |iterator|?
rlanday
2017/03/24 17:45:48
Yep!
| |
55 getPosOfFirstMarkerNotEndingBefore(size_t startOffset); | |
56 | |
57 Member<DocumentMarkerController> m_documentMarkerController; | |
58 HeapVector<Member<DocumentMarker>> m_markers; | |
59 | |
60 private: | |
61 static bool endsBefore(size_t startOffset, const Member<DocumentMarker>& rhv); | |
Xiaocheng
2017/03/24 03:57:47
This should be just a local function hidden in an
rlanday
2017/03/24 17:45:48
Ah ok, I wasn't sure what the rule was, I'll remem
Xiaocheng
2017/03/24 19:43:49
I'm not sure if there's a coding style rule about
| |
62 | |
63 DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList); | |
64 }; | |
65 | |
66 } // namespace blink | |
67 | |
68 #endif // DocumentMarkerList_h | |
OLD | NEW |