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

Unified Diff: Source/core/frame/Frame.cpp

Issue 419863004: Refactor frame detach to work for both local and remote frames. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix comment typo Created 6 years, 5 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/frame/Frame.h ('k') | Source/core/frame/LocalFrame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/Frame.cpp
diff --git a/Source/core/frame/Frame.cpp b/Source/core/frame/Frame.cpp
index 4b4894a999c34a8a5722a6e8ba17a18391c5a651..f647b3e5988b5ed202236a17a12183a39112612d 100644
--- a/Source/core/frame/Frame.cpp
+++ b/Source/core/frame/Frame.cpp
@@ -91,6 +91,18 @@ Frame::~Frame()
#endif
}
+void Frame::detachChildren()
+{
+ typedef Vector<RefPtr<Frame> > FrameVector;
+ FrameVector childrenToDetach;
+ childrenToDetach.reserveCapacity(tree().childCount());
+ for (Frame* child = tree().firstChild(); child; child = child->tree().nextSibling())
+ childrenToDetach.append(child);
+ FrameVector::iterator end = childrenToDetach.end();
+ for (FrameVector::iterator it = childrenToDetach.begin(); it != end; ++it)
+ (*it)->detach();
+}
+
FrameHost* Frame::host() const
{
return m_host;
« no previous file with comments | « Source/core/frame/Frame.h ('k') | Source/core/frame/LocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698