OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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 RelocatablePosition_h | |
6 #define RelocatablePosition_h | |
7 | |
8 #include "core/dom/Range.h" | |
9 | |
10 namespace blink { | |
11 | |
12 // |RelocatablePosition| is a helper class for keeping track of a |Position| in | |
13 // a document upon DOM changes even if the given |Position|'s anchor node is | |
14 // moved out of document. The class is implemented by using a temporary |Range| | |
15 // object to keep track of the |Position|, and disposing the |Range| when out | |
16 // of scope. | |
17 class RelocatablePosition final { | |
18 public: | |
19 RelocatablePosition(); | |
yosin_UTC9
2016/07/06 06:50:30
Do we really need default ctor?
Since, |Relocatabl
| |
20 explicit RelocatablePosition(const Position&); | |
21 ~RelocatablePosition(); | |
22 | |
23 Position position() const; | |
24 | |
25 private: | |
26 const Member<Range> m_range; | |
27 | |
28 STACK_ALLOCATED(); | |
yosin_UTC9
2016/07/06 06:50:30
nit: It seems |STACK_ALLOCATED()| usually at top.
| |
29 DISALLOW_COPY_AND_ASSIGN(RelocatablePosition); | |
30 }; | |
31 | |
32 } // namespace blink | |
33 | |
34 #endif // RelocatablePosition_h | |
OLD | NEW |