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

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

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Back out non-Oilpan experiment + tidy up by adding frame() ref accessors Created 6 years, 3 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/FrameSelection.cpp
diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp
index 393dc383bc01a8105cdbf4f50e93e13f0d5669c2..a435d7be8165790e8a302f29d77a2a5bbff1c92f 100644
--- a/Source/core/editing/FrameSelection.cpp
+++ b/Source/core/editing/FrameSelection.cpp
@@ -238,12 +238,12 @@ void FrameSelection::setSelection(const VisibleSelection& newSelection, SetSelec
if (s.base().anchorNode()) {
Document& document = *s.base().document();
if (document.frame() && document.frame() != m_frame && document != m_frame->document()) {
- RefPtr<LocalFrame> guard = document.frame();
+ RefPtrWillBeRawPtr<LocalFrame> guard(document.frame());
document.frame()->selection().setSelection(s, options, align, granularity);
// It's possible that during the above set selection, this FrameSelection has been modified by
// selectFrameElementInParentIfFullySelected, but that the selection is no longer valid since
// the frame is about to be destroyed. If this is the case, clear our selection.
- if (guard->hasOneRef() && !m_selection.isNonOrphanedCaretOrRange())
+ if (!guard->host() && !m_selection.isNonOrphanedCaretOrRange())
clear();
return;
}
@@ -1899,6 +1899,7 @@ void FrameSelection::showTreeForThis() const
void FrameSelection::trace(Visitor* visitor)
{
+ visitor->trace(m_frame);
visitor->trace(m_selection);
visitor->trace(m_originalBase);
visitor->trace(m_logicalRange);

Powered by Google App Engine
This is Rietveld 408576698