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

Unified Diff: Source/core/editing/VisibleSelectionTest.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.cpp ('k') | Source/core/editing/WrapContentsInDummySpanCommand.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/VisibleSelectionTest.cpp
diff --git a/Source/core/editing/VisibleSelectionTest.cpp b/Source/core/editing/VisibleSelectionTest.cpp
index 94bb5f5ea12176136ca0067ba85b6e60236b7371..3ea9ff44c5a1779d69d0e0155beaf7c43a5bb46d 100644
--- a/Source/core/editing/VisibleSelectionTest.cpp
+++ b/Source/core/editing/VisibleSelectionTest.cpp
@@ -26,9 +26,20 @@ class VisibleSelectionTest : public ::testing::Test {
protected:
virtual void SetUp() OVERRIDE;
+ // Oilpan: wrapper object needed to be able to trace VisibleSelection.
+ class VisibleSelectionWrapper : public NoBaseWillBeGarbageCollectedFinalized<VisibleSelectionWrapper> {
+ public:
+ void trace(Visitor* visitor)
+ {
+ visitor->trace(m_selection);
+ }
+
+ VisibleSelection m_selection;
+ };
+
Document& document() const { return m_dummyPageHolder->document(); }
Text* textNode() const { return m_textNode.get(); }
- VisibleSelection& selection() { return m_selection; }
+ VisibleSelection& selection() { return m_wrap->m_selection; }
// Helper function to set the VisibleSelection base/extent.
void setSelection(int base) { setSelection(base, base); }
@@ -36,20 +47,21 @@ protected:
// Helper function to set the VisibleSelection base/extent.
void setSelection(int base, int extend)
{
- m_selection.setBase(Position(textNode(), base));
- m_selection.setExtent(Position(textNode(), extend));
+ m_wrap->m_selection.setBase(Position(textNode(), base));
+ m_wrap->m_selection.setExtent(Position(textNode(), extend));
}
private:
OwnPtr<DummyPageHolder> m_dummyPageHolder;
- RefPtr<Text> m_textNode;
- VisibleSelection m_selection;
+ RefPtrWillBePersistent<Text> m_textNode;
+ OwnPtrWillBePersistent<VisibleSelectionWrapper> m_wrap;
};
void WebCore::VisibleSelectionTest::SetUp()
{
m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600));
m_textNode = document().createTextNode(LOREM_IPSUM);
+ m_wrap = adoptPtrWillBeNoop(new VisibleSelectionWrapper());
document().body()->appendChild(m_textNode.get());
}
« no previous file with comments | « Source/core/editing/VisibleSelection.cpp ('k') | Source/core/editing/WrapContentsInDummySpanCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698