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 CORE_EXPORT DocumentMarkerList | |
14 : public GarbageCollectedFinalized<DocumentMarkerList> { | |
15 public: | |
16 DocumentMarkerList(); | |
17 using iterator = Member<DocumentMarker>*; | |
Xiaocheng
2017/04/07 23:42:24
These iterator types are unused.
rlanday
2017/04/11 01:12:36
They're used in some of the subclass implementatio
Xiaocheng
2017/04/11 01:26:01
I'm not sure if any class (DMC?) needs to know tha
yosin_UTC9
2017/04/11 01:39:37
Yes, we should not have |iterator| in an interface
| |
18 using const_iterator = const Member<DocumentMarker>*; | |
19 | |
20 virtual ~DocumentMarkerList(); | |
21 | |
22 virtual DocumentMarker::MarkerType allowedMarkerType() const = 0; | |
yosin_UTC9
2017/04/11 01:39:37
Do we really need this?
We should avoid dynamic ty
rlanday
2017/04/11 02:02:49
We can get rid of this if we're OK with the casts
| |
23 | |
24 virtual bool empty() const = 0; | |
25 virtual DocumentMarker* at(size_t index) = 0; | |
yosin_UTC9
2017/04/11 01:39:37
We don't want to expose random access of DocumentM
rlanday
2017/04/11 02:02:49
To me, "set" makes this sound like it's a hash set
| |
26 | |
27 virtual void add(DocumentMarker*) = 0; | |
yosin_UTC9
2017/04/11 01:39:37
Should we call |addInternal()| or another to indic
rlanday
2017/04/11 02:02:49
What do you mean by "not for generic use"? All the
| |
28 virtual void clear() = 0; | |
29 | |
30 virtual void appendMarkersToInputList(DocumentMarkerVector* list) const = 0; | |
yosin_UTC9
2017/04/11 01:39:37
We don't need this as API. We can implement this b
rlanday
2017/04/11 02:02:49
This is for getting the markers out, not putting t
| |
31 | |
32 enum class DidCopyMarkerOrNot { kDidNotCopyMarker, kDidCopyMarker }; | |
33 virtual DidCopyMarkerOrNot copyMarkers(unsigned startOffset, | |
Xiaocheng
2017/04/07 23:42:24
Since we don't want to keep a clone-ish method for
yosin_UTC9
2017/04/11 01:39:37
It is OK to use |bool| return value. Since we shou
| |
34 int length, | |
35 DocumentMarkerList* dstList, | |
36 int delta) = 0; | |
37 | |
38 enum class DidRemoveMarkerOrNot { kDidNotRemoveMarker, kDidRemoveMarker }; | |
39 virtual DidRemoveMarkerOrNot removeMarkers( | |
yosin_UTC9
2017/04/11 01:39:37
It is OK to use |bool| return value. Since we shou
| |
40 unsigned startOffset, | |
41 int length, | |
42 bool shouldRemovePartiallyOverlappingMarkers) = 0; | |
yosin_UTC9
2017/04/11 01:39:37
Please use |enum class| instead of |bool|.
rlanday
2017/04/11 02:02:49
I think this is a moot point, we're getting rid of
| |
43 | |
44 enum class DidShiftMarkerOrNot { kDidNotShiftMarker, kDidShiftMarker }; | |
45 virtual DidShiftMarkerOrNot shiftMarkers(unsigned offset, | |
46 unsigned oldLength, | |
47 unsigned newLength) = 0; | |
48 | |
49 DEFINE_INLINE_VIRTUAL_TRACE() {} | |
50 DISALLOW_COPY_AND_ASSIGN(DocumentMarkerList); | |
51 }; | |
52 | |
53 } // namespace blink | |
54 | |
55 #endif // DocumentMarkerList_h | |
OLD | NEW |