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

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

Issue 2127503002: Use RelocatablePosition in CompositeEditCommand::moveParagraphs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use RelocatablePosition 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 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698