| OLD | NEW |
| 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 20 matching lines...) Expand all Loading... |
| 31 #include "core/loader/FrameLoader.h" | 31 #include "core/loader/FrameLoader.h" |
| 32 #include "core/loader/FrameLoaderClient.h" | 32 #include "core/loader/FrameLoaderClient.h" |
| 33 #include "core/plugins/PluginView.h" | 33 #include "core/plugins/PluginView.h" |
| 34 #include "core/rendering/RenderLayer.h" | 34 #include "core/rendering/RenderLayer.h" |
| 35 #include "core/rendering/RenderPart.h" | 35 #include "core/rendering/RenderPart.h" |
| 36 #include "core/rendering/compositing/RenderLayerCompositor.h" | 36 #include "core/rendering/compositing/RenderLayerCompositor.h" |
| 37 #include "platform/weborigin/SecurityOrigin.h" | 37 #include "platform/weborigin/SecurityOrigin.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 typedef WillBeHeapHashMap<RefPtrWillBeMember<Widget>, RawPtrWillBeMember<FrameVi
ew> > WidgetToParentMap; | 41 typedef WillBeHeapHashMap<RefPtrWillBeMember<Widget>, RawPtrWillBeMember<FrameVi
ew>> WidgetToParentMap; |
| 42 static WidgetToParentMap& widgetNewParentMap() | 42 static WidgetToParentMap& widgetNewParentMap() |
| 43 { | 43 { |
| 44 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WidgetToParentMap>, map, (adoptPt
rWillBeNoop(new WidgetToParentMap()))); | 44 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WidgetToParentMap>, map, (adoptPt
rWillBeNoop(new WidgetToParentMap()))); |
| 45 return *map; | 45 return *map; |
| 46 } | 46 } |
| 47 | 47 |
| 48 WillBeHeapHashCountedSet<RawPtrWillBeMember<Node> >& SubframeLoadingDisabler::di
sabledSubtreeRoots() | 48 WillBeHeapHashCountedSet<RawPtrWillBeMember<Node>>& SubframeLoadingDisabler::dis
abledSubtreeRoots() |
| 49 { | 49 { |
| 50 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WillBeHeapHashCountedSet<RawPtrWi
llBeMember<Node> > >, nodes, (adoptPtrWillBeNoop(new WillBeHeapHashCountedSet<Ra
wPtrWillBeMember<Node> >()))); | 50 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WillBeHeapHashCountedSet<RawPtrWi
llBeMember<Node>>>, nodes, (adoptPtrWillBeNoop(new WillBeHeapHashCountedSet<RawP
trWillBeMember<Node>>()))); |
| 51 return *nodes; | 51 return *nodes; |
| 52 } | 52 } |
| 53 | 53 |
| 54 static unsigned s_updateSuspendCount = 0; | 54 static unsigned s_updateSuspendCount = 0; |
| 55 | 55 |
| 56 HTMLFrameOwnerElement::UpdateSuspendScope::UpdateSuspendScope() | 56 HTMLFrameOwnerElement::UpdateSuspendScope::UpdateSuspendScope() |
| 57 { | 57 { |
| 58 ++s_updateSuspendCount; | 58 ++s_updateSuspendCount; |
| 59 } | 59 } |
| 60 | 60 |
| 61 void HTMLFrameOwnerElement::UpdateSuspendScope::performDeferredWidgetTreeOperati
ons() | 61 void HTMLFrameOwnerElement::UpdateSuspendScope::performDeferredWidgetTreeOperati
ons() |
| 62 { | 62 { |
| 63 WidgetToParentMap map; | 63 WidgetToParentMap map; |
| 64 widgetNewParentMap().swap(map); | 64 widgetNewParentMap().swap(map); |
| 65 WidgetToParentMap::iterator end = map.end(); | 65 for (const auto& widget : map) { |
| 66 for (WidgetToParentMap::iterator it = map.begin(); it != end; ++it) { | 66 Widget* child = widget.key.get(); |
| 67 Widget* child = it->key.get(); | |
| 68 FrameView* currentParent = toFrameView(child->parent()); | 67 FrameView* currentParent = toFrameView(child->parent()); |
| 69 FrameView* newParent = it->value; | 68 FrameView* newParent = widget.value; |
| 70 if (newParent != currentParent) { | 69 if (newParent != currentParent) { |
| 71 if (currentParent) | 70 if (currentParent) |
| 72 currentParent->removeChild(child); | 71 currentParent->removeChild(child); |
| 73 if (newParent) | 72 if (newParent) |
| 74 newParent->addChild(child); | 73 newParent->addChild(child); |
| 75 #if ENABLE(OILPAN) | 74 #if ENABLE(OILPAN) |
| 76 if (currentParent && !newParent) | 75 if (currentParent && !newParent) |
| 77 child->dispose(); | 76 child->dispose(); |
| 78 #endif | 77 #endif |
| 79 } | 78 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 110 , m_widget(nullptr) | 109 , m_widget(nullptr) |
| 111 , m_sandboxFlags(SandboxNone) | 110 , m_sandboxFlags(SandboxNone) |
| 112 { | 111 { |
| 113 } | 112 } |
| 114 | 113 |
| 115 RenderPart* HTMLFrameOwnerElement::renderPart() const | 114 RenderPart* HTMLFrameOwnerElement::renderPart() const |
| 116 { | 115 { |
| 117 // HTMLObjectElement and HTMLEmbedElement may return arbitrary renderers | 116 // HTMLObjectElement and HTMLEmbedElement may return arbitrary renderers |
| 118 // when using fallback content. | 117 // when using fallback content. |
| 119 if (!renderer() || !renderer()->isRenderPart()) | 118 if (!renderer() || !renderer()->isRenderPart()) |
| 120 return 0; | 119 return nullptr; |
| 121 return toRenderPart(renderer()); | 120 return toRenderPart(renderer()); |
| 122 } | 121 } |
| 123 | 122 |
| 124 void HTMLFrameOwnerElement::setContentFrame(Frame& frame) | 123 void HTMLFrameOwnerElement::setContentFrame(Frame& frame) |
| 125 { | 124 { |
| 126 // Make sure we will not end up with two frames referencing the same owner e
lement. | 125 // Make sure we will not end up with two frames referencing the same owner e
lement. |
| 127 ASSERT(!m_contentFrame || m_contentFrame->owner() != this); | 126 ASSERT(!m_contentFrame || m_contentFrame->owner() != this); |
| 128 // Disconnected frames should not be allowed to load. | 127 // Disconnected frames should not be allowed to load. |
| 129 ASSERT(inDocument()); | 128 ASSERT(inDocument()); |
| 130 m_contentFrame = &frame; | 129 m_contentFrame = &frame; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 void HTMLFrameOwnerElement::dispatchLoad() | 194 void HTMLFrameOwnerElement::dispatchLoad() |
| 196 { | 195 { |
| 197 dispatchEvent(Event::create(EventTypeNames::load)); | 196 dispatchEvent(Event::create(EventTypeNames::load)); |
| 198 } | 197 } |
| 199 | 198 |
| 200 Document* HTMLFrameOwnerElement::getSVGDocument(ExceptionState& exceptionState)
const | 199 Document* HTMLFrameOwnerElement::getSVGDocument(ExceptionState& exceptionState)
const |
| 201 { | 200 { |
| 202 Document* doc = contentDocument(); | 201 Document* doc = contentDocument(); |
| 203 if (doc && doc->isSVGDocument()) | 202 if (doc && doc->isSVGDocument()) |
| 204 return doc; | 203 return doc; |
| 205 return 0; | 204 return nullptr; |
| 206 } | 205 } |
| 207 | 206 |
| 208 void HTMLFrameOwnerElement::setWidget(PassRefPtrWillBeRawPtr<Widget> widget) | 207 void HTMLFrameOwnerElement::setWidget(PassRefPtrWillBeRawPtr<Widget> widget) |
| 209 { | 208 { |
| 210 if (widget == m_widget) | 209 if (widget == m_widget) |
| 211 return; | 210 return; |
| 212 | 211 |
| 213 if (m_widget) { | 212 if (m_widget) { |
| 214 if (m_widget->parent()) | 213 if (m_widget->parent()) |
| 215 moveWidgetToParentSoon(m_widget.get(), 0); | 214 moveWidgetToParentSoon(m_widget.get(), 0); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 void HTMLFrameOwnerElement::trace(Visitor* visitor) | 260 void HTMLFrameOwnerElement::trace(Visitor* visitor) |
| 262 { | 261 { |
| 263 visitor->trace(m_contentFrame); | 262 visitor->trace(m_contentFrame); |
| 264 visitor->trace(m_widget); | 263 visitor->trace(m_widget); |
| 265 HTMLElement::trace(visitor); | 264 HTMLElement::trace(visitor); |
| 266 FrameOwner::trace(visitor); | 265 FrameOwner::trace(visitor); |
| 267 } | 266 } |
| 268 | 267 |
| 269 | 268 |
| 270 } // namespace blink | 269 } // namespace blink |
| OLD | NEW |