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

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

Issue 594483002: Oilpan: extend tracing over WebFrame trees. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Improve weak callback registration Created 6 years, 2 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 | « no previous file | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/LocalFrame.cpp
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp
index 34698bdd1486c398a563d46c2803a8c97185bd94..78ff0151ab40a17215a1953a520b3f65e7cf37f7 100644
--- a/Source/core/frame/LocalFrame.cpp
+++ b/Source/core/frame/LocalFrame.cpp
@@ -274,12 +274,21 @@ FloatSize LocalFrame::resizePageRectsKeepingRatio(const FloatSize& originalSize,
void LocalFrame::setDOMWindow(PassRefPtrWillBeRawPtr<LocalDOMWindow> domWindow)
{
+ // Oilpan: setDOMWindow() cannot be used when finalizing. Which
+ // is acceptable as its actions are either not needed or handled
+ // by other means --
+ //
+ // - FrameDestructionObserver::willDetachFrameHost() will have
+ // signalled the Inspector frameWindowDiscarded() notifications.
+ // We assume that all LocalFrames are detached, where that notification
+ // will have been done.
+ //
+ // - Calling LocalDOMWindow::reset() is not needed (called from
+ // Frame::setDOMWindow().) The Member references it clears will now
+ // die with the window. And the registered DOMWindowProperty instances that don't,
+ // only keep a weak reference to this frame, so there's no need to be
+ // explicitly notified that this frame is going away.
if (m_domWindow) {
- // Oilpan: the assumption is that FrameDestructionObserver::willDetachFrameHost()
- // on LocalWindow will have signalled these frameWindowDiscarded() notifications.
- //
- // It is not invoked when finalizing the LocalFrame, as setDOMWindow() isn't
- // performed (accessing the m_domWindow heap object is unsafe then.)
console().messageStorage()->frameWindowDiscarded(m_domWindow.get());
InspectorInstrumentation::frameWindowDiscarded(this, m_domWindow.get());
}
« no previous file with comments | « no previous file | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698