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

Unified Diff: Source/core/dom/NodeRareData.cpp

Issue 236653002: Oilpan: move mutation observers to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + explicitly dispose() mutation observer registrations always (non-Oilpan also.) Created 6 years, 8 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
« Source/core/dom/NodeRareData.h ('K') | « Source/core/dom/NodeRareData.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/NodeRareData.cpp
diff --git a/Source/core/dom/NodeRareData.cpp b/Source/core/dom/NodeRareData.cpp
index e3ee7e6d8a1190ad05ff54042d337417c73b0777..3e6823f5e5799dd4a42f2279da58bb12ef3f51f6 100644
--- a/Source/core/dom/NodeRareData.cpp
+++ b/Source/core/dom/NodeRareData.cpp
@@ -31,11 +31,13 @@
#include "config.h"
#include "core/dom/NodeRareData.h"
#include "core/dom/Element.h"
+#include "platform/heap/Handle.h"
namespace WebCore {
struct SameSizeAsNodeRareData {
- void* m_pointer[3];
+ void* m_pointer[2];
+ OwnPtrWillBePersistent<NodeMutationObserverData> m_mutationObserverData;
unsigned m_bitfields;
};
@@ -55,6 +57,15 @@ void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName)
it->value->invalidateCache();
}
+void NodeRareData::dispose()
+{
+ if (m_mutationObserverData) {
+ for (unsigned i = 0; i < m_mutationObserverData->registry.size(); i++)
+ m_mutationObserverData->registry.at(i)->dispose();
+ m_mutationObserverData.clear();
+ }
+}
+
// Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow
COMPILE_ASSERT(Page::maxNumberOfFrames < (1 << NodeRareData::ConnectedFrameCountBits), Frame_limit_should_fit_in_rare_data_count);
« Source/core/dom/NodeRareData.h ('K') | « Source/core/dom/NodeRareData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698