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

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

Issue 299353004: Oilpan: move editing objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make test wrapper class finalized Created 6 years, 7 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
« no previous file with comments | « Source/core/editing/VisibleSelection.h ('k') | Source/core/editing/VisibleSelectionTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/VisibleSelection.cpp
diff --git a/Source/core/editing/VisibleSelection.cpp b/Source/core/editing/VisibleSelection.cpp
index 6a79d0460bdb1014b6a2de6b0ee85b7dc1819002..02861aa623b198a65822b208a86936e18f8011d5 100644
--- a/Source/core/editing/VisibleSelection.cpp
+++ b/Source/core/editing/VisibleSelection.cpp
@@ -48,7 +48,7 @@ namespace WebCore {
VisibleSelection::VisibleSelection()
: m_affinity(DOWNSTREAM)
- , m_changeObserver(0)
+ , m_changeObserver(nullptr)
, m_selectionType(NoSelection)
, m_baseIsFirst(true)
, m_isDirectional(false)
@@ -59,7 +59,7 @@ VisibleSelection::VisibleSelection(const Position& pos, EAffinity affinity, bool
: m_base(pos)
, m_extent(pos)
, m_affinity(affinity)
- , m_changeObserver(0)
+ , m_changeObserver(nullptr)
, m_isDirectional(isDirectional)
{
validate();
@@ -69,7 +69,7 @@ VisibleSelection::VisibleSelection(const Position& base, const Position& extent,
: m_base(base)
, m_extent(extent)
, m_affinity(affinity)
- , m_changeObserver(0)
+ , m_changeObserver(nullptr)
, m_isDirectional(isDirectional)
{
validate();
@@ -79,7 +79,7 @@ VisibleSelection::VisibleSelection(const VisiblePosition& pos, bool isDirectiona
: m_base(pos.deepEquivalent())
, m_extent(pos.deepEquivalent())
, m_affinity(pos.affinity())
- , m_changeObserver(0)
+ , m_changeObserver(nullptr)
, m_isDirectional(isDirectional)
{
validate();
@@ -89,7 +89,7 @@ VisibleSelection::VisibleSelection(const VisiblePosition& base, const VisiblePos
: m_base(base.deepEquivalent())
, m_extent(extent.deepEquivalent())
, m_affinity(base.affinity())
- , m_changeObserver(0)
+ , m_changeObserver(nullptr)
, m_isDirectional(isDirectional)
{
validate();
@@ -99,7 +99,7 @@ VisibleSelection::VisibleSelection(const Range* range, EAffinity affinity, bool
: m_base(range->startPosition())
, m_extent(range->endPosition())
, m_affinity(affinity)
- , m_changeObserver(0)
+ , m_changeObserver(nullptr)
, m_isDirectional(isDirectional)
{
validate();
@@ -111,7 +111,7 @@ VisibleSelection::VisibleSelection(const VisibleSelection& other)
, m_start(other.m_start)
, m_end(other.m_end)
, m_affinity(other.m_affinity)
- , m_changeObserver(0) // Observer is associated with only one VisibleSelection, so this should not be copied.
+ , m_changeObserver(nullptr) // Observer is associated with only one VisibleSelection, so this should not be copied.
, m_selectionType(other.m_selectionType)
, m_baseIsFirst(other.m_baseIsFirst)
, m_isDirectional(other.m_isDirectional)
@@ -127,7 +127,7 @@ VisibleSelection& VisibleSelection::operator=(const VisibleSelection& other)
m_start = other.m_start;
m_end = other.m_end;
m_affinity = other.m_affinity;
- m_changeObserver = 0;
+ m_changeObserver = nullptr;
m_selectionType = other.m_selectionType;
m_baseIsFirst = other.m_baseIsFirst;
m_isDirectional = other.m_isDirectional;
@@ -136,7 +136,9 @@ VisibleSelection& VisibleSelection::operator=(const VisibleSelection& other)
VisibleSelection::~VisibleSelection()
{
+#if !ENABLE(OILPAN)
didChange();
+#endif
}
VisibleSelection VisibleSelection::selectionFromContentsOfNode(Node* node)
@@ -751,7 +753,7 @@ void VisibleSelection::setChangeObserver(ChangeObserver& observer)
void VisibleSelection::clearChangeObserver()
{
ASSERT(m_changeObserver);
- m_changeObserver = 0;
+ m_changeObserver = nullptr;
}
void VisibleSelection::didChange()
@@ -760,6 +762,15 @@ void VisibleSelection::didChange()
m_changeObserver->didChangeVisibleSelection();
}
+void VisibleSelection::trace(Visitor* visitor)
+{
+ visitor->trace(m_base);
+ visitor->trace(m_extent);
+ visitor->trace(m_start);
+ visitor->trace(m_end);
+ visitor->trace(m_changeObserver);
+}
+
#ifndef NDEBUG
void VisibleSelection::debugPosition() const
« no previous file with comments | « Source/core/editing/VisibleSelection.h ('k') | Source/core/editing/VisibleSelectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698