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

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

Issue 552733003: Oilpan: make DOMWindowProperty a GC mixin. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Pacify GC plugin wrt LocalDOMWindow::trace() 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
Index: Source/core/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index 6c930d737ed8ddeac2084ccfee6205259667d83b..dabcd3947ec59ce626265aff30837b7e4ec1b7d2 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -497,7 +497,6 @@ void LocalDOMWindow::statePopped(PassRefPtr<SerializedScriptValue> stateObject)
LocalDOMWindow::~LocalDOMWindow()
{
ASSERT(m_hasBeenReset);
- reset();
#if ENABLE(OILPAN)
// Oilpan: the frame host and document objects are
@@ -508,6 +507,8 @@ LocalDOMWindow::~LocalDOMWindow()
// Cleared when detaching document.
ASSERT(!m_eventQueue);
#else
+ reset();
+
removeAllEventListenersInternal(DoBroadcastListenerRemoval);
ASSERT(m_document->isStopped());
@@ -557,7 +558,7 @@ 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.
- Vector<DOMWindowProperty*> properties;
+ WillBeHeapVector<RawPtrWillBeMember<DOMWindowProperty> > properties;
copyToVector(m_properties, properties);
for (size_t i = 0; i < properties.size(); ++i)
properties[i]->willDestroyGlobalObjectInFrame();
@@ -567,7 +568,7 @@ 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.
- Vector<DOMWindowProperty*> properties;
+ WillBeHeapVector<RawPtrWillBeMember<DOMWindowProperty> > properties;
copyToVector(m_properties, properties);
for (size_t i = 0; i < properties.size(); ++i)
properties[i]->willDetachGlobalObjectFromFrame();
@@ -586,11 +587,6 @@ void LocalDOMWindow::unregisterProperty(DOMWindowProperty* property)
void LocalDOMWindow::reset()
{
willDestroyDocumentInFrame();
- resetDOMWindowProperties();
-}
-
-void LocalDOMWindow::resetDOMWindowProperties()
-{
m_properties.clear();
m_screen = nullptr;
@@ -1897,7 +1893,9 @@ PassOwnPtr<LifecycleNotifier<LocalDOMWindow> > LocalDOMWindow::createLifecycleNo
void LocalDOMWindow::trace(Visitor* visitor)
{
+#if ENABLE(OILPAN)
visitor->trace(m_document);
+ visitor->trace(m_properties);
visitor->trace(m_screen);
visitor->trace(m_history);
visitor->trace(m_locationbar);
@@ -1916,6 +1914,7 @@ void LocalDOMWindow::trace(Visitor* visitor)
visitor->trace(m_performance);
visitor->trace(m_css);
visitor->trace(m_eventQueue);
+#endif
WillBeHeapSupplementable<LocalDOMWindow>::trace(visitor);
EventTargetWithInlineData::trace(visitor);
LifecycleContext<LocalDOMWindow>::trace(visitor);

Powered by Google App Engine
This is Rietveld 408576698