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

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

Issue 2123893002: Introduce class RelocatablePosition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 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 tree changes even if the given |Position|'s original
14 // anchor node is moved out of document. The class is implemented by using a
15 // temporary |Range| object to keep track of the |Position|, and disposing the
16 // |Range| when out of scope.
17 class RelocatablePosition final {
18 STACK_ALLOCATED();
19 public:
20 explicit RelocatablePosition(const Position&);
21 ~RelocatablePosition();
22
23 Position position() const;
24
25 private:
26 const Member<Range> m_range;
27
28 DISALLOW_COPY_AND_ASSIGN(RelocatablePosition);
29 };
30
31 } // namespace blink
32
33 #endif // RelocatablePosition_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698