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

Side by Side Diff: Source/core/html/HTMLFrameOwnerElement.cpp

Issue 419863004: Refactor frame detach to work for both local and remote frames. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix comment typo Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/RemoteFrame.cpp ('k') | Source/core/loader/FrameLoader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 137 }
138 138
139 void HTMLFrameOwnerElement::disconnectContentFrame() 139 void HTMLFrameOwnerElement::disconnectContentFrame()
140 { 140 {
141 // FIXME: Currently we don't do this in removedFrom because this causes an 141 // FIXME: Currently we don't do this in removedFrom because this causes an
142 // unload event in the subframe which could execute script that could then 142 // unload event in the subframe which could execute script that could then
143 // reach up into this document and then attempt to look back down. We should 143 // reach up into this document and then attempt to look back down. We should
144 // see if this behavior is really needed as Gecko does not allow this. 144 // see if this behavior is really needed as Gecko does not allow this.
145 if (Frame* frame = contentFrame()) { 145 if (Frame* frame = contentFrame()) {
146 RefPtr<Frame> protect(frame); 146 RefPtr<Frame> protect(frame);
147 if (frame->isLocalFrame()) 147 frame->detach();
148 toLocalFrame(frame)->loader().frameDetached();
149 frame->disconnectOwnerElement(); 148 frame->disconnectOwnerElement();
150 } 149 }
151 } 150 }
152 151
153 HTMLFrameOwnerElement::~HTMLFrameOwnerElement() 152 HTMLFrameOwnerElement::~HTMLFrameOwnerElement()
154 { 153 {
155 if (m_contentFrame) 154 if (m_contentFrame)
156 m_contentFrame->disconnectOwnerElement(); 155 m_contentFrame->disconnectOwnerElement();
157 } 156 }
158 157
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 // FIXME: In this case the LocalFrame will have finished loading before 271 // FIXME: In this case the LocalFrame will have finished loading before
273 // it's being added to the child list. It would be a good idea to 272 // it's being added to the child list. It would be a good idea to
274 // create the child first, then invoke the loader separately. 273 // create the child first, then invoke the loader separately.
275 if (childFrame->loader().state() == FrameStateComplete && !childFrame->loade r().policyDocumentLoader()) 274 if (childFrame->loader().state() == FrameStateComplete && !childFrame->loade r().policyDocumentLoader())
276 childFrame->loader().checkCompleted(); 275 childFrame->loader().checkCompleted();
277 return true; 276 return true;
278 } 277 }
279 278
280 279
281 } // namespace blink 280 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/RemoteFrame.cpp ('k') | Source/core/loader/FrameLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698