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

Side by Side 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: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 return client; 142 return client;
143 } 143 }
144 144
145 ChromeClient& Frame::chromeClient() const 145 ChromeClient& Frame::chromeClient() const
146 { 146 {
147 if (Page* page = this->page()) 147 if (Page* page = this->page())
148 return page->chrome().client(); 148 return page->chrome().client();
149 return emptyChromeClient(); 149 return emptyChromeClient();
150 } 150 }
151 151
152 void Frame::prepareSwapFrom(Frame* old)
153 {
154 WindowProxyManager* oldManager = old->windowProxyManager();
155 oldManager->clearForNavigation();
156 }
157
152 void Frame::finishSwapFrom(Frame* old) 158 void Frame::finishSwapFrom(Frame* old)
153 { 159 {
154 WindowProxyManager* oldManager = old->windowProxyManager(); 160 WindowProxyManager* oldManager = old->windowProxyManager();
155 // FIXME: In the future, the Blink API layer will be calling detach() on the
156 // old frame prior to completing the swap. However, detach calls
157 // clearForClose() instead of clearForNavigation(). Make sure this doesn't
158 // become a no-op when that lands, since it's important to detach the global .
159 oldManager->clearForNavigation();
160 windowProxyManager()->takeGlobalFrom(oldManager); 161 windowProxyManager()->takeGlobalFrom(oldManager);
161 } 162 }
162 163
163 Frame* Frame::findFrameForNavigation(const AtomicString& name, Frame& activeFram e) 164 Frame* Frame::findFrameForNavigation(const AtomicString& name, Frame& activeFram e)
164 { 165 {
165 Frame* frame = tree().find(name); 166 Frame* frame = tree().find(name);
166 if (!frame || !activeFrame.canNavigate(*frame)) 167 if (!frame || !activeFrame.canNavigate(*frame))
167 return nullptr; 168 return nullptr;
168 return frame; 169 return frame;
169 } 170 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 297
297 if (m_owner) { 298 if (m_owner) {
298 if (m_owner->isLocal()) 299 if (m_owner->isLocal())
299 toHTMLFrameOwnerElement(m_owner)->setContentFrame(*this); 300 toHTMLFrameOwnerElement(m_owner)->setContentFrame(*this);
300 } else { 301 } else {
301 page()->setMainFrame(this); 302 page()->setMainFrame(this);
302 } 303 }
303 } 304 }
304 305
305 } // namespace blink 306 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/Frame.h ('k') | Source/web/WebFrame.cpp » ('j') | Source/web/WebFrame.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698