| OLD | NEW |
| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 return; | 266 return; |
| 267 FrameLoadRequest request = FrameLoadRequest( | 267 FrameLoadRequest request = FrameLoadRequest( |
| 268 nullptr, m_loader.resourceRequestForReload(loadType, KURL(), clientR
edirectPolicy)); | 268 nullptr, m_loader.resourceRequestForReload(loadType, KURL(), clientR
edirectPolicy)); |
| 269 request.setClientRedirect(clientRedirectPolicy); | 269 request.setClientRedirect(clientRedirectPolicy); |
| 270 m_loader.load(request, loadType); | 270 m_loader.load(request, loadType); |
| 271 } else { | 271 } else { |
| 272 m_navigationScheduler.scheduleReload(); | 272 m_navigationScheduler.scheduleReload(); |
| 273 } | 273 } |
| 274 } | 274 } |
| 275 | 275 |
| 276 void LocalFrame::detach(FrameDetachType type) | 276 void LocalFrame::detach() |
| 277 { | 277 { |
| 278 PluginScriptForbiddenScope forbidPluginDestructorScripting; | 278 PluginScriptForbiddenScope forbidPluginDestructorScripting; |
| 279 // A lot of the following steps can result in the current frame being | 279 // A lot of the following steps can result in the current frame being |
| 280 // detached, so protect a reference to it. | 280 // detached, so protect a reference to it. |
| 281 RefPtrWillBeRawPtr<LocalFrame> protect(this); | 281 RefPtrWillBeRawPtr<LocalFrame> protect(this); |
| 282 m_loader.stopAllLoaders(); | 282 m_loader.stopAllLoaders(); |
| 283 m_loader.dispatchUnloadEvent(); | 283 m_loader.dispatchUnloadEvent(); |
| 284 detachChildren(); | 284 detachChildren(); |
| 285 // stopAllLoaders() needs to be called after detachChildren(), because detac
hChildren() | 285 // stopAllLoaders() needs to be called after detachChildren(), because detac
hChildren() |
| 286 // will trigger the unload event handlers of any child frames, and those eve
nt | 286 // will trigger the unload event handlers of any child frames, and those eve
nt |
| 287 // handlers might start a new subresource load in this frame. | 287 // handlers might start a new subresource load in this frame. |
| 288 m_loader.stopAllLoaders(); | 288 m_loader.stopAllLoaders(); |
| 289 m_loader.detach(); | 289 m_loader.detach(); |
| 290 document()->detach(); | 290 document()->detach(); |
| 291 m_loader.clear(); | 291 m_loader.clear(); |
| 292 if (!client()) | 292 if (!client()) |
| 293 return; | 293 return; |
| 294 | 294 |
| 295 client()->willBeDetached(); | 295 client()->willBeDetached(); |
| 296 // Notify ScriptController that the frame is closing, since its cleanup ends
up calling | 296 // Notify ScriptController that the frame is closing, since its cleanup ends
up calling |
| 297 // back to FrameLoaderClient via WindowProxy. | 297 // back to FrameLoaderClient via WindowProxy. |
| 298 script().clearForClose(); | 298 script().clearForClose(); |
| 299 ScriptForbiddenScope forbidScript; | 299 ScriptForbiddenScope forbidScript; |
| 300 setView(nullptr); | 300 setView(nullptr); |
| 301 willDetachFrameHost(); | 301 willDetachFrameHost(); |
| 302 InspectorInstrumentation::frameDetachedFromParent(this); | 302 InspectorInstrumentation::frameDetachedFromParent(this); |
| 303 Frame::detach(type); | 303 Frame::detach(); |
| 304 | 304 |
| 305 // Signal frame destruction here rather than in the destructor. | 305 // Signal frame destruction here rather than in the destructor. |
| 306 // Main motivation is to avoid being dependent on its exact timing (Oilpan.) | 306 // Main motivation is to avoid being dependent on its exact timing (Oilpan.) |
| 307 LocalFrameLifecycleNotifier::notifyContextDestroyed(); | 307 LocalFrameLifecycleNotifier::notifyContextDestroyed(); |
| 308 m_supplements.clear(); | 308 m_supplements.clear(); |
| 309 WeakIdentifierMap<LocalFrame>::notifyObjectDestroyed(this); | 309 WeakIdentifierMap<LocalFrame>::notifyObjectDestroyed(this); |
| 310 } | 310 } |
| 311 | 311 |
| 312 bool LocalFrame::prepareForCommit() | |
| 313 { | |
| 314 return loader().prepareForCommit(); | |
| 315 } | |
| 316 | |
| 317 SecurityContext* LocalFrame::securityContext() const | 312 SecurityContext* LocalFrame::securityContext() const |
| 318 { | 313 { |
| 319 return document(); | 314 return document(); |
| 320 } | 315 } |
| 321 | 316 |
| 322 void LocalFrame::printNavigationErrorMessage(const Frame& targetFrame, const cha
r* reason) | 317 void LocalFrame::printNavigationErrorMessage(const Frame& targetFrame, const cha
r* reason) |
| 323 { | 318 { |
| 324 // URLs aren't available for RemoteFrames, so the error message uses their | 319 // URLs aren't available for RemoteFrames, so the error message uses their |
| 325 // origin instead. | 320 // origin instead. |
| 326 String targetFrameDescription = targetFrame.isLocalFrame() ? "with URL '" +
toLocalFrame(targetFrame).document()->url().string() + "'" : "with origin '" + t
argetFrame.securityContext()->securityOrigin()->toString() + "'"; | 321 String targetFrameDescription = targetFrame.isLocalFrame() ? "with URL '" +
toLocalFrame(targetFrame).document()->url().string() + "'" : "with origin '" + t
argetFrame.securityContext()->securityOrigin()->toString() + "'"; |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 , m_textZoomFactor(parentTextZoomFactor(this)) | 827 , m_textZoomFactor(parentTextZoomFactor(this)) |
| 833 , m_inViewSourceMode(false) | 828 , m_inViewSourceMode(false) |
| 834 { | 829 { |
| 835 if (isLocalRoot()) | 830 if (isLocalRoot()) |
| 836 m_instrumentingAgents = InstrumentingAgents::create(); | 831 m_instrumentingAgents = InstrumentingAgents::create(); |
| 837 else | 832 else |
| 838 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents; | 833 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents; |
| 839 } | 834 } |
| 840 | 835 |
| 841 } // namespace blink | 836 } // namespace blink |
| OLD | NEW |