Index: third_party/WebKit/Source/core/frame/RemoteFrame.cpp |
diff --git a/third_party/WebKit/Source/core/frame/RemoteFrame.cpp b/third_party/WebKit/Source/core/frame/RemoteFrame.cpp |
index f7eb7a08a368f0cd66401f2ba38e6a0867a15107..0c3c253a18989c5009bb8b7096b5c7f0d5847f40 100644 |
--- a/third_party/WebKit/Source/core/frame/RemoteFrame.cpp |
+++ b/third_party/WebKit/Source/core/frame/RemoteFrame.cpp |
@@ -196,4 +196,15 @@ void RemoteFrame::advanceFocus(WebFocusType type, LocalFrame* source) |
client()->advanceFocus(type, source); |
} |
+void RemoteFrame::detachChildren() |
+{ |
+ using FrameVector = HeapVector<Member<Frame>>; |
+ FrameVector childrenToDetach; |
+ childrenToDetach.reserveCapacity(tree().childCount()); |
+ for (Frame* child = tree().firstChild(); child; child = child->tree().nextSibling()) |
+ childrenToDetach.append(child); |
+ for (const auto& child : childrenToDetach) |
+ child->detach(FrameDetachType::Remove); |
+} |
+ |
} // namespace blink |