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

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

Issue 2723663002: Refactor DocumentMarkerController (Closed)
Patch Set: Make requested changes, rebase (HashMap::remove() => HashMap::erase()) Created 3 years, 9 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
(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 DocumentMarkerList : public GarbageCollected<DocumentMarkerList> {
16 public:
17 explicit DocumentMarkerList(DocumentMarkerController*);
18 using iterator = Member<DocumentMarker>*;
19 using const_iterator = const Member<DocumentMarker>*;
20
21 virtual DocumentMarker::MarkerType allowedMarkerType() const = 0;
22
23 size_t size() const;
24 bool empty() const;
25 virtual DocumentMarker* at(size_t index);
26
27 virtual void clear() = 0;
28
29 iterator begin();
30 iterator end();
31 const_iterator begin() const;
32 const_iterator end() const;
33
34 void appendMarkersToInputList(DocumentMarkerVector* list) const;
35
36 virtual bool copyMarkers(unsigned startOffset,
37 int length,
38 Node* dstNode,
39 int delta) const = 0;
40 virtual void removeMarkers(unsigned startOffset,
41 int length,
42 bool shouldRemovePartiallyOverlappingMarkers,
43 bool* didRemoveMarker) = 0;
44 virtual bool shiftMarkers(unsigned offset,
45 unsigned oldLength,
46 unsigned newLength) = 0;
47
48 DECLARE_VIRTUAL_TRACE();
49
50 protected:
51 HeapVector<Member<DocumentMarker>>::iterator
52 getPosOfFirstMarkerNotEndingBefore(size_t startOffset);
53
54 Member<DocumentMarkerController> m_documentMarkerController;
55 HeapVector<Member<DocumentMarker>> m_markers;
56
57 private:
58 static bool endsBefore(size_t startOffset, const Member<DocumentMarker>& rhv);
59
60 DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList);
61 };
62
63 } // namespace blink
64
65 #endif // DocumentMarkerList_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698