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

Unified Diff: third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp

Issue 2781623010: Add DocumentMarker::clone() (Closed)
Patch Set: Remove dependency that's messing with trybots Created 3 years, 8 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: third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
index b18b3fd88304206850783d3ee5de7a20483edd5f..722597baebdf25ea60f01e998b4248403e757554 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
@@ -129,6 +129,19 @@ inline TextCompositionMarkerDetails* toTextCompositionMarkerDetails(
return nullptr;
}
+DocumentMarker* DocumentMarker::clone() const {
+ return new DocumentMarker(*this);
+}
+
+DocumentMarker* DocumentMarker::cloneWithNewOffsets(unsigned startOffset,
+ unsigned endOffset) const {
+ DocumentMarker* clonedMarker = clone();
+ clonedMarker->setStartOffset(startOffset);
+ clonedMarker->setEndOffset(endOffset);
+
+ return clonedMarker;
+}
+
DocumentMarker::DocumentMarker(MarkerType type,
unsigned startOffset,
unsigned endOffset,

Powered by Google App Engine
This is Rietveld 408576698