Index: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h |
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h |
index 6423d5ad6b2477f8b6b3c67b064cb87a6b814362..eb38835c4c9b085469eaedd10bca3cd7bedc0a1e 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h |
+++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h |
@@ -109,21 +109,25 @@ DEFINE_ELEMENT_TYPE_CASTS(HTMLFrameOwnerElement, isFrameOwnerElement()); |
class SubframeLoadingDisabler { |
STACK_ALLOCATED(); |
public: |
- explicit SubframeLoadingDisabler(Node& root) |
+ explicit SubframeLoadingDisabler(Node& root) : SubframeLoadingDisabler(&root) |
+ { |
+ } |
+ |
+ explicit SubframeLoadingDisabler(Node* root) |
: m_root(root) |
{ |
- disabledSubtreeRoots().add(m_root); |
+ if (m_root) |
+ disabledSubtreeRoots().add(m_root); |
} |
~SubframeLoadingDisabler() |
{ |
- disabledSubtreeRoots().remove(m_root); |
+ if (m_root) |
+ disabledSubtreeRoots().remove(m_root); |
} |
static bool canLoadFrame(HTMLFrameOwnerElement& owner) |
{ |
- if (owner.document().unloadStarted()) |
- return false; |
for (Node* node = &owner; node; node = node->parentOrShadowHostNode()) { |
if (disabledSubtreeRoots().contains(node)) |
return false; |
@@ -132,7 +136,7 @@ public: |
} |
private: |
- static WillBeHeapHashCountedSet<RawPtrWillBeMember<Node>>& disabledSubtreeRoots(); |
+ CORE_EXPORT static WillBeHeapHashCountedSet<RawPtrWillBeMember<Node>>& disabledSubtreeRoots(); |
RawPtrWillBeMember<Node> m_root; |
}; |