void FrameLoaderClientImpl::detached(FrameDetachType type) { // Alert the client that the frame is being detached. This is the last // chance we have to communicate with the client. WebFrameClient* client = m_webFrame->client(); if (!client) return; m_webFrame->willDetachParent(); // Signal that no further communication with WebFrameClient should take // place at this point since we are no longer associated with the Page. m_webFrame->setClient(0); client->frameDetached(m_webFrame, static_cast<WebFrameClient::DetachType>(type)); // Clear our reference to LocalFrame at the very end, in case the client // refers to it. m_webFrame->setCoreFrame(nullptr); }
void FrameLoaderClientImpl::detachedFromParent() { // Alert the client that the frame is being detached. This is the last // chance we have to communicate with the client. RefPtr<WebLocalFrameImpl> protector(m_webFrame); WebFrameClient* client = m_webFrame->client(); if (!client) return; m_webFrame->willDetachParent(); // Signal that no further communication with WebFrameClient should take // place at this point since we are no longer associated with the Page. m_webFrame->setClient(0); client->frameDetached(m_webFrame); // Clear our reference to WebCore::LocalFrame at the very end, in case the client // refers to it. m_webFrame->setWebCoreFrame(nullptr); }