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

Unified Diff: Source/core/frame/LocalDOMWindow.cpp

Issue 569643002: Simplify and weaken DOMWindowProperty unregistration (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add test Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/frame/LocalDOMWindow.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index 0dfa1b05271b5c9587a68c34c68a3249409bfed4..29b116fc61f9a0c629ad98e771a12e1a6e1afa70 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -556,22 +556,14 @@ void LocalDOMWindow::willDetachFrameHost()
void LocalDOMWindow::willDestroyDocumentInFrame()
{
- // It is necessary to copy m_properties to a separate vector because the DOMWindowProperties may
- // unregister themselves from the LocalDOMWindow as a result of the call to willDestroyGlobalObjectInFrame.
- WillBeHeapVector<RawPtrWillBeMember<DOMWindowProperty> > properties;
Mads Ager (chromium) 2014/09/15 07:58:21 Do you still need the copy for the non-oilpan case
sof 2014/09/15 08:10:25 No implementation of willDestroyGlobalObjectInFram
Mads Ager (chromium) 2014/09/15 08:11:40 Sounds good. Thanks for double checking and explai
- copyToVector(m_properties, properties);
- for (size_t i = 0; i < properties.size(); ++i)
- properties[i]->willDestroyGlobalObjectInFrame();
+ for (WillBeHeapHashSet<RawPtrWillBeWeakMember<DOMWindowProperty> >::const_iterator it = m_properties.begin(); it != m_properties.end(); ++it)
+ (*it)->willDestroyGlobalObjectInFrame();
}
void LocalDOMWindow::willDetachDocumentFromFrame()
{
- // It is necessary to copy m_properties to a separate vector because the DOMWindowProperties may
- // unregister themselves from the LocalDOMWindow as a result of the call to willDetachGlobalObjectFromFrame.
- WillBeHeapVector<RawPtrWillBeMember<DOMWindowProperty> > properties;
Mads Ager (chromium) 2014/09/15 07:58:21 Ditto.
- copyToVector(m_properties, properties);
- for (size_t i = 0; i < properties.size(); ++i)
- properties[i]->willDetachGlobalObjectFromFrame();
+ for (WillBeHeapHashSet<RawPtrWillBeWeakMember<DOMWindowProperty> >::const_iterator it = m_properties.begin(); it != m_properties.end(); ++it)
+ (*it)->willDetachGlobalObjectFromFrame();
}
void LocalDOMWindow::registerProperty(DOMWindowProperty* property)
« no previous file with comments | « Source/core/frame/LocalDOMWindow.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698