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

Unified Diff: Source/core/editing/VisibleUnits.cpp

Issue 330383004: Oilpan: Introduce TempRangeScope to avoid needless Range attaches on Document. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address review comments. Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/editing/VisibleUnits.cpp
diff --git a/Source/core/editing/VisibleUnits.cpp b/Source/core/editing/VisibleUnits.cpp
index fac20284ca2038f8f6218fba055432348cf62a63..fc4c3a56b149a0a5dd7149fdb7c0b3dc2ed5b28f 100644
--- a/Source/core/editing/VisibleUnits.cpp
+++ b/Source/core/editing/VisibleUnits.cpp
@@ -454,6 +454,8 @@ static VisiblePosition previousBoundary(const VisiblePosition& c, BoundarySearch
if (!boundary)
return VisiblePosition();
+ TemporaryRangeScope scope;
+
Document& d = boundary->document();
Position start = createLegacyEditingPosition(boundary, 0).parentAnchoredEquivalent();
Position end = pos.parentAnchoredEquivalent();
@@ -535,6 +537,8 @@ static VisiblePosition nextBoundary(const VisiblePosition& c, BoundarySearchFunc
if (!boundary)
return VisiblePosition();
+ TemporaryRangeScope scope;
+
Document& d = boundary->document();
RefPtrWillBeRawPtr<Range> searchRange(d.createRange());
Position start(pos.parentAnchoredEquivalent());

Powered by Google App Engine
This is Rietveld 408576698