| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #include "core/svg/SVGDocumentExtensions.h" | 66 #include "core/svg/SVGDocumentExtensions.h" |
| 67 #include "platform/DragImage.h" | 67 #include "platform/DragImage.h" |
| 68 #include "platform/PluginScriptForbiddenScope.h" | 68 #include "platform/PluginScriptForbiddenScope.h" |
| 69 #include "platform/RuntimeEnabledFeatures.h" | 69 #include "platform/RuntimeEnabledFeatures.h" |
| 70 #include "platform/ScriptForbiddenScope.h" | 70 #include "platform/ScriptForbiddenScope.h" |
| 71 #include "platform/graphics/GraphicsContext.h" | 71 #include "platform/graphics/GraphicsContext.h" |
| 72 #include "platform/graphics/StaticBitmapImage.h" | 72 #include "platform/graphics/StaticBitmapImage.h" |
| 73 #include "platform/graphics/paint/ClipRecorder.h" | 73 #include "platform/graphics/paint/ClipRecorder.h" |
| 74 #include "platform/graphics/paint/SkPictureBuilder.h" | 74 #include "platform/graphics/paint/SkPictureBuilder.h" |
| 75 #include "platform/text/TextStream.h" | 75 #include "platform/text/TextStream.h" |
| 76 #include "public/platform/WebFrameHostScheduler.h" |
| 77 #include "public/platform/WebFrameScheduler.h" |
| 78 #include "public/platform/WebSecurityOrigin.h" |
| 76 #include "third_party/skia/include/core/SkImage.h" | 79 #include "third_party/skia/include/core/SkImage.h" |
| 77 #include "wtf/PassOwnPtr.h" | 80 #include "wtf/PassOwnPtr.h" |
| 78 #include "wtf/StdLibExtras.h" | 81 #include "wtf/StdLibExtras.h" |
| 79 | 82 |
| 80 namespace blink { | 83 namespace blink { |
| 81 | 84 |
| 82 using namespace HTMLNames; | 85 using namespace HTMLNames; |
| 83 | 86 |
| 84 namespace { | 87 namespace { |
| 85 | 88 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 278 |
| 276 void LocalFrame::detach(FrameDetachType type) | 279 void LocalFrame::detach(FrameDetachType type) |
| 277 { | 280 { |
| 278 PluginScriptForbiddenScope forbidPluginDestructorScripting; | 281 PluginScriptForbiddenScope forbidPluginDestructorScripting; |
| 279 // A lot of the following steps can result in the current frame being | 282 // A lot of the following steps can result in the current frame being |
| 280 // detached, so protect a reference to it. | 283 // detached, so protect a reference to it. |
| 281 RefPtrWillBeRawPtr<LocalFrame> protect(this); | 284 RefPtrWillBeRawPtr<LocalFrame> protect(this); |
| 282 m_loader.stopAllLoaders(); | 285 m_loader.stopAllLoaders(); |
| 283 m_loader.dispatchUnloadEvent(); | 286 m_loader.dispatchUnloadEvent(); |
| 284 detachChildren(); | 287 detachChildren(); |
| 288 m_frameScheduler.clear(); |
| 285 | 289 |
| 286 // All done if detaching the subframes brought about a detach of this frame
also. | 290 // All done if detaching the subframes brought about a detach of this frame
also. |
| 287 if (!client()) | 291 if (!client()) |
| 288 return; | 292 return; |
| 289 | 293 |
| 290 // stopAllLoaders() needs to be called after detachChildren(), because detac
hChildren() | 294 // stopAllLoaders() needs to be called after detachChildren(), because detac
hChildren() |
| 291 // will trigger the unload event handlers of any child frames, and those eve
nt | 295 // will trigger the unload event handlers of any child frames, and those eve
nt |
| 292 // handlers might start a new subresource load in this frame. | 296 // handlers might start a new subresource load in this frame. |
| 293 m_loader.stopAllLoaders(); | 297 m_loader.stopAllLoaders(); |
| 294 m_loader.detach(); | 298 m_loader.detach(); |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 , m_pageZoomFactor(parentPageZoomFactor(this)) | 855 , m_pageZoomFactor(parentPageZoomFactor(this)) |
| 852 , m_textZoomFactor(parentTextZoomFactor(this)) | 856 , m_textZoomFactor(parentTextZoomFactor(this)) |
| 853 , m_inViewSourceMode(false) | 857 , m_inViewSourceMode(false) |
| 854 { | 858 { |
| 855 if (isLocalRoot()) | 859 if (isLocalRoot()) |
| 856 m_instrumentingAgents = InstrumentingAgents::create(); | 860 m_instrumentingAgents = InstrumentingAgents::create(); |
| 857 else | 861 else |
| 858 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents; | 862 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents; |
| 859 } | 863 } |
| 860 | 864 |
| 865 WebFrameScheduler* LocalFrame::frameScheduler() |
| 866 { |
| 867 if (!m_frameScheduler.get()) |
| 868 m_frameScheduler = adoptPtr(host()->frameHostScheduler()->createFrameSch
eduler()); |
| 869 |
| 870 ASSERT(m_frameScheduler.get()); |
| 871 return m_frameScheduler.get(); |
| 872 } |
| 873 |
| 874 void LocalFrame::updateFrameSecurityOrigin() |
| 875 { |
| 876 SecurityContext* context = securityContext(); |
| 877 if (!context) |
| 878 return; |
| 879 |
| 880 WebSecurityOrigin securityOrigin(context->securityOrigin()); |
| 881 frameScheduler()->setFrameOrigin(&securityOrigin); |
| 882 } |
| 883 |
| 861 DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame); | 884 DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame); |
| 862 | 885 |
| 863 } // namespace blink | 886 } // namespace blink |
| OLD | NEW |