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

Side by Side 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: Rebase past r181764 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 if (!m_frame) { 231 if (!m_frame) {
232 m_selection = s; 232 m_selection = s;
233 return; 233 return;
234 } 234 }
235 235
236 // <http://bugs.webkit.org/show_bug.cgi?id=23464>: Infinite recursion at Fra meSelection::setSelection 236 // <http://bugs.webkit.org/show_bug.cgi?id=23464>: Infinite recursion at Fra meSelection::setSelection
237 // if document->frame() == m_frame we can get into an infinite loop 237 // if document->frame() == m_frame we can get into an infinite loop
238 if (s.base().anchorNode()) { 238 if (s.base().anchorNode()) {
239 Document& document = *s.base().document(); 239 Document& document = *s.base().document();
240 if (document.frame() && document.frame() != m_frame && document != m_fra me->document()) { 240 if (document.frame() && document.frame() != m_frame && document != m_fra me->document()) {
241 RefPtr<LocalFrame> guard = document.frame(); 241 RefPtrWillBeRawPtr<LocalFrame> guard(document.frame());
242 document.frame()->selection().setSelection(s, options, align, granul arity); 242 document.frame()->selection().setSelection(s, options, align, granul arity);
243 // It's possible that during the above set selection, this FrameSele ction has been modified by 243 // It's possible that during the above set selection, this FrameSele ction has been modified by
244 // selectFrameElementInParentIfFullySelected, but that the selection is no longer valid since 244 // selectFrameElementInParentIfFullySelected, but that the selection is no longer valid since
245 // the frame is about to be destroyed. If this is the case, clear ou r selection. 245 // the frame is about to be destroyed. If this is the case, clear ou r selection.
246 #if ENABLE(OILPAN)
247 if (guard->hasBeenClosed() && !m_selection.isNonOrphanedCaretOrRange ())
248 #else
246 if (guard->hasOneRef() && !m_selection.isNonOrphanedCaretOrRange()) 249 if (guard->hasOneRef() && !m_selection.isNonOrphanedCaretOrRange())
250 #endif
247 clear(); 251 clear();
248 return; 252 return;
249 } 253 }
250 } 254 }
251 255
252 m_granularity = granularity; 256 m_granularity = granularity;
253 257
254 if (closeTyping) 258 if (closeTyping)
255 TypingCommand::closeTyping(m_frame); 259 TypingCommand::closeTyping(m_frame);
256 260
(...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 1890
1887 void FrameSelection::showTreeForThis() const 1891 void FrameSelection::showTreeForThis() const
1888 { 1892 {
1889 m_selection.showTreeForThis(); 1893 m_selection.showTreeForThis();
1890 } 1894 }
1891 1895
1892 #endif 1896 #endif
1893 1897
1894 void FrameSelection::trace(Visitor* visitor) 1898 void FrameSelection::trace(Visitor* visitor)
1895 { 1899 {
1900 visitor->trace(m_frame);
1896 visitor->trace(m_selection); 1901 visitor->trace(m_selection);
1897 visitor->trace(m_originalBase); 1902 visitor->trace(m_originalBase);
1898 visitor->trace(m_logicalRange); 1903 visitor->trace(m_logicalRange);
1899 visitor->trace(m_previousCaretNode); 1904 visitor->trace(m_previousCaretNode);
1900 visitor->trace(m_typingStyle); 1905 visitor->trace(m_typingStyle);
1901 VisibleSelection::ChangeObserver::trace(visitor); 1906 VisibleSelection::ChangeObserver::trace(visitor);
1902 } 1907 }
1903 1908
1904 void FrameSelection::setCaretRectNeedsUpdate() 1909 void FrameSelection::setCaretRectNeedsUpdate()
1905 { 1910 {
(...skipping 19 matching lines...) Expand all
1925 sel.showTreeForThis(); 1930 sel.showTreeForThis();
1926 } 1931 }
1927 1932
1928 void showTree(const blink::FrameSelection* sel) 1933 void showTree(const blink::FrameSelection* sel)
1929 { 1934 {
1930 if (sel) 1935 if (sel)
1931 sel->showTreeForThis(); 1936 sel->showTreeForThis();
1932 } 1937 }
1933 1938
1934 #endif 1939 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698