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

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

Issue 1041473002: Detach old frame on WebFrame::swap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tests and cleanup Created 5 years, 7 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/frame/Frame.cpp
diff --git a/Source/core/frame/Frame.cpp b/Source/core/frame/Frame.cpp
index 454c1dcd7e88c4286953280308cdc2aa6e983f2f..a16c9cb9d56cc35515b4584041319b6a034ee415 100644
--- a/Source/core/frame/Frame.cpp
+++ b/Source/core/frame/Frame.cpp
@@ -80,14 +80,14 @@ DEFINE_TRACE(Frame)
visitor->trace(m_owner);
}
-void Frame::detach()
+void Frame::detach(DetachType type)
{
ASSERT(m_client);
domWindow()->resetLocation();
disconnectOwnerElement();
// After this, we must no longer talk to the client since this clears
// its owning reference back to our owning LocalFrame.
- m_client->detached();
+ m_client->detached(type);
m_client = nullptr;
m_host = nullptr;
}
@@ -100,7 +100,7 @@ void Frame::detachChildren()
for (Frame* child = tree().firstChild(); child; child = child->tree().nextSibling())
childrenToDetach.append(child);
for (const auto& child : childrenToDetach)
- child->detach();
+ child->detach(DetachType::Remove);
}
void Frame::disconnectOwnerElement()
@@ -158,14 +158,15 @@ ChromeClient& Frame::chromeClient() const
return emptyChromeClient();
}
-void Frame::finishSwapFrom(Frame* old)
+void Frame::prepareSwapFrom(Frame* old)
{
WindowProxyManager* oldManager = old->windowProxyManager();
- // FIXME: In the future, the Blink API layer will be calling detach() on the
- // old frame prior to completing the swap. However, detach calls
- // clearForClose() instead of clearForNavigation(). Make sure this doesn't
- // become a no-op when that lands, since it's important to detach the global.
oldManager->clearForNavigation();
+}
+
+void Frame::finishSwapFrom(Frame* old)
+{
+ WindowProxyManager* oldManager = old->windowProxyManager();
windowProxyManager()->takeGlobalFrom(oldManager);
}

Powered by Google App Engine
This is Rietveld 408576698