Bug 1302826: Rename ServoNodeData's default destructor to Servo_NodeData_DefaultDelete. r?xidorn
The previous version of this was unsound, and was declaring the same extern "C"
function with two different prototypes.
Move the implementation to ServoBindings.cpp, with a doc comment that is also
generated in the Servo file.
Signed-off-by: Emilio Cobos Álvarez <ecoal95@gmail.com>
MozReview-Commit-ID: GtQHaFnbwLw
--- a/dom/base/nsINode.h
+++ b/dom/base/nsINode.h
@@ -51,25 +51,29 @@ class nsIPrincipal;
class nsIURI;
class nsNodeSupportsWeakRefTearoff;
class nsNodeWeakReference;
class nsDOMMutationObserver;
// We declare the bare minimum infrastructure here to allow us to have a
// UniquePtr<ServoNodeData> on nsINode.
struct ServoNodeData;
-extern "C" void Servo_NodeData_Drop(ServoNodeData*);
+/**
+ * NB: This function is not meant to be implemented in Servo, it's a proxy to
+ * a Servo function instead, see the comment in layout/style/ServoBindings.h.
+ */
+void Servo_NodeData_DefaultDelete(ServoNodeData*);
namespace mozilla {
template<>
class DefaultDelete<ServoNodeData>
{
public:
void operator()(ServoNodeData* aPtr) const
{
- Servo_NodeData_Drop(aPtr);
+ Servo_NodeData_DefaultDelete(aPtr);
}
};
} // namespace mozilla
namespace mozilla {
class EventListenerManager;
namespace dom {
/**
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -43,16 +43,25 @@ using namespace mozilla::dom;
}
IMPL_STRONG_REF_TYPE_FOR(ServoComputedValues)
IMPL_STRONG_REF_TYPE_FOR(RawServoStyleSheet)
IMPL_STRONG_REF_TYPE_FOR(ServoDeclarationBlock)
#undef IMPL_STRONG_REF_TYPE_FOR
+/**
+ * NB: Declared in dom/base/nsINode.h, not to be implemented from Servo.
+ */
+void
+Servo_NodeData_DefaultDelete(ServoNodeData* aServoNodeData)
+{
+ Servo_NodeData_Drop(aServoNodeData);
+}
+
uint32_t
Gecko_ChildrenCount(RawGeckoNodeBorrowed aNode)
{
return aNode->GetChildCount();
}
bool
Gecko_NodeIsElement(RawGeckoNodeBorrowed aNode)