summaryrefslogtreecommitdiffstats
path: root/WebCore/dom
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/dom')
-rw-r--r--WebCore/dom/Node.cpp24
-rw-r--r--WebCore/dom/Node.h6
-rw-r--r--WebCore/dom/ProcessingInstruction.cpp22
-rw-r--r--WebCore/dom/ProcessingInstruction.h8
4 files changed, 52 insertions, 8 deletions
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index c1861cc..4b91a40 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -2333,16 +2333,28 @@ ContainerNode* Node::eventParentNode()
#ifdef ANDROID_INSTRUMENT
static size_t nodeSize = 0;
-void* Node::operator new(size_t s) throw()
+void* Node::operator new(size_t size)
{
- nodeSize += s;
- return ::operator new(s);
+ nodeSize += size;
+ return ::operator new(size);
}
-void Node::operator delete(void* ptr, size_t s)
+void* Node::operator new[](size_t size)
{
- nodeSize -= s;
- ::operator delete(ptr);
+ nodeSize += size;
+ return ::operator new[](size);
+}
+
+void Node::operator delete(void* p, size_t size)
+{
+ nodeSize -= size;
+ ::operator delete(p);
+}
+
+void Node::operator delete[](void* p, size_t size)
+{
+ nodeSize -= size;
+ ::operator delete[](p);
}
size_t Node::reportDOMNodesSize()
diff --git a/WebCore/dom/Node.h b/WebCore/dom/Node.h
index 8a4c264..082ab16 100644
--- a/WebCore/dom/Node.h
+++ b/WebCore/dom/Node.h
@@ -513,10 +513,12 @@ public:
#ifdef ANDROID_INSTRUMENT
// Overridden to prevent the normal new from being called.
- void* operator new(size_t) throw();
+ void* operator new(size_t size);
+ void* operator new[](size_t size);
// Overridden to prevent the normal delete from being called.
- void operator delete(void*, size_t);
+ void operator delete(void* p, size_t size);
+ void operator delete[](void* p, size_t size);
static size_t reportDOMNodesSize();
#endif
diff --git a/WebCore/dom/ProcessingInstruction.cpp b/WebCore/dom/ProcessingInstruction.cpp
index 72993dd..8a94864 100644
--- a/WebCore/dom/ProcessingInstruction.cpp
+++ b/WebCore/dom/ProcessingInstruction.cpp
@@ -280,4 +280,26 @@ void ProcessingInstruction::finishParsingChildren()
ContainerNode::finishParsingChildren();
}
+#ifdef ANDROID_INSTRUMENT
+void* ProcessingInstruction::operator new(size_t size)
+{
+ return Node::operator new(size);
+}
+
+void* ProcessingInstruction::operator new[](size_t size)
+{
+ return Node::operator new[](size);
+}
+
+void ProcessingInstruction::operator delete(void* p, size_t size)
+{
+ Node::operator delete(p, size);
+}
+
+void ProcessingInstruction::operator delete[](void* p, size_t size)
+{
+ Node::operator delete[](p, size);
+}
+#endif
+
} // namespace
diff --git a/WebCore/dom/ProcessingInstruction.h b/WebCore/dom/ProcessingInstruction.h
index 4b7dc86..61af9cf 100644
--- a/WebCore/dom/ProcessingInstruction.h
+++ b/WebCore/dom/ProcessingInstruction.h
@@ -55,6 +55,14 @@ public:
private:
ProcessingInstruction(Document*, const String& target, const String& data);
+#ifdef ANDROID_INSTRUMENT
+ // Overridden to resolve the ambiguous
+ void* operator new(size_t size);
+ void* operator new[](size_t size);
+ void operator delete(void* p, size_t size);
+ void operator delete[](void* p, size_t size);
+#endif
+
virtual String nodeName() const;
virtual NodeType nodeType() const;
virtual String nodeValue() const;