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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h

Issue 1659013003: Don't reset LoadEventProgress if frame unload has already started. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test and adjust comments. Created 4 years, 10 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
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 RawPtrWillBeMember<Frame> m_contentFrame; 102 RawPtrWillBeMember<Frame> m_contentFrame;
103 RefPtrWillBeMember<Widget> m_widget; 103 RefPtrWillBeMember<Widget> m_widget;
104 SandboxFlags m_sandboxFlags; 104 SandboxFlags m_sandboxFlags;
105 }; 105 };
106 106
107 DEFINE_ELEMENT_TYPE_CASTS(HTMLFrameOwnerElement, isFrameOwnerElement()); 107 DEFINE_ELEMENT_TYPE_CASTS(HTMLFrameOwnerElement, isFrameOwnerElement());
108 108
109 class SubframeLoadingDisabler { 109 class SubframeLoadingDisabler {
110 STACK_ALLOCATED(); 110 STACK_ALLOCATED();
111 public: 111 public:
112 explicit SubframeLoadingDisabler(Node& root) 112 explicit SubframeLoadingDisabler(Node& root) : SubframeLoadingDisabler(&root )
113 {
114 }
115
116 explicit SubframeLoadingDisabler(Node* root)
Nate Chapin 2016/02/03 23:25:14 Do we have to have constructors for both a pointer
dcheng 2016/02/03 23:33:31 A pre-Oilpan alternative is to just keep the refer
113 : m_root(root) 117 : m_root(root)
114 { 118 {
115 disabledSubtreeRoots().add(m_root); 119 if (m_root)
120 disabledSubtreeRoots().add(m_root);
116 } 121 }
117 122
118 ~SubframeLoadingDisabler() 123 ~SubframeLoadingDisabler()
119 { 124 {
120 disabledSubtreeRoots().remove(m_root); 125 if (m_root)
126 disabledSubtreeRoots().remove(m_root);
121 } 127 }
122 128
123 static bool canLoadFrame(HTMLFrameOwnerElement& owner) 129 static bool canLoadFrame(HTMLFrameOwnerElement& owner)
124 { 130 {
125 if (owner.document().unloadStarted())
126 return false;
127 for (Node* node = &owner; node; node = node->parentOrShadowHostNode()) { 131 for (Node* node = &owner; node; node = node->parentOrShadowHostNode()) {
128 if (disabledSubtreeRoots().contains(node)) 132 if (disabledSubtreeRoots().contains(node))
129 return false; 133 return false;
130 } 134 }
131 return true; 135 return true;
132 } 136 }
133 137
134 private: 138 private:
135 static WillBeHeapHashCountedSet<RawPtrWillBeMember<Node>>& disabledSubtreeRo ots(); 139 static WillBeHeapHashCountedSet<RawPtrWillBeMember<Node>>& disabledSubtreeRo ots();
136 140
137 RawPtrWillBeMember<Node> m_root; 141 RawPtrWillBeMember<Node> m_root;
138 }; 142 };
139 143
140 DEFINE_TYPE_CASTS(HTMLFrameOwnerElement, FrameOwner, owner, owner->isLocal(), ow ner.isLocal()); 144 DEFINE_TYPE_CASTS(HTMLFrameOwnerElement, FrameOwner, owner, owner->isLocal(), ow ner.isLocal());
141 145
142 } // namespace blink 146 } // namespace blink
143 147
144 #endif // HTMLFrameOwnerElement_h 148 #endif // HTMLFrameOwnerElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.cpp ('k') | third_party/WebKit/Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698