Title: [133589] trunk/Source/WebCore
- Revision
- 133589
- Author
- [email protected]
- Date
- 2012-11-06 05:20:42 -0800 (Tue, 06 Nov 2012)
Log Message
Replace setDOMWrapper(wrapper, 0) with resetDOMWrapper(wrapper)
https://bugs.webkit.org/show_bug.cgi?id=101190
Reviewed by Adam Barth.
To guarantee that we never stores NULL pointers to V8 internal
fields, we want to insert ASSERT()s to setDOMWrapper().
This patch replaces setDOMWrapper() that intentionally
passes NULL pointers with clearDOMWrapper().
No tests. No change in behavior.
* bindings/v8/V8DOMWrapper.h:
(V8DOMWrapper):
(WebCore::V8DOMWrapper::clearDOMWrapper):
* bindings/v8/V8NPObject.cpp:
(WebCore::forgetV8ObjectForNPObject):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (133588 => 133589)
--- trunk/Source/WebCore/ChangeLog 2012-11-06 12:56:57 UTC (rev 133588)
+++ trunk/Source/WebCore/ChangeLog 2012-11-06 13:20:42 UTC (rev 133589)
@@ -1,3 +1,23 @@
+2012-11-06 Kentaro Hara <[email protected]>
+
+ Replace setDOMWrapper(wrapper, 0) with resetDOMWrapper(wrapper)
+ https://bugs.webkit.org/show_bug.cgi?id=101190
+
+ Reviewed by Adam Barth.
+
+ To guarantee that we never stores NULL pointers to V8 internal
+ fields, we want to insert ASSERT()s to setDOMWrapper().
+ This patch replaces setDOMWrapper() that intentionally
+ passes NULL pointers with clearDOMWrapper().
+
+ No tests. No change in behavior.
+
+ * bindings/v8/V8DOMWrapper.h:
+ (V8DOMWrapper):
+ (WebCore::V8DOMWrapper::clearDOMWrapper):
+ * bindings/v8/V8NPObject.cpp:
+ (WebCore::forgetV8ObjectForNPObject):
+
2012-11-06 Vsevolod Vlasov <[email protected]>
Web Inspector: Displayed name/path of urls in network tab of dev tools is inconsistent
Modified: trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h (133588 => 133589)
--- trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h 2012-11-06 12:56:57 UTC (rev 133588)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h 2012-11-06 13:20:42 UTC (rev 133589)
@@ -66,7 +66,6 @@
static bool maybeDOMWrapper(v8::Handle<v8::Value>);
#endif
- // Sets contents of a DOM wrapper.
static void setDOMWrapper(v8::Handle<v8::Object> object, WrapperTypeInfo* type, void* cptr)
{
ASSERT(object->InternalFieldCount() >= 2);
@@ -74,6 +73,14 @@
object->SetPointerInInternalField(v8DOMWrapperTypeIndex, type);
}
+ static void clearDOMWrapper(v8::Handle<v8::Object> object, WrapperTypeInfo* type)
+ {
+ ASSERT(object->InternalFieldCount() >= 2);
+ ASSERT(type);
+ object->SetPointerInInternalField(v8DOMWrapperTypeIndex, type);
+ object->SetPointerInInternalField(v8DOMWrapperObjectIndex, 0);
+ }
+
static v8::Handle<v8::Object> lookupDOMWrapper(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Handle<v8::Object> object)
{
return object.IsEmpty() ? object : object->FindInstanceInPrototypeChain(functionTemplate);
Modified: trunk/Source/WebCore/bindings/v8/V8NPObject.cpp (133588 => 133589)
--- trunk/Source/WebCore/bindings/v8/V8NPObject.cpp 2012-11-06 12:56:57 UTC (rev 133588)
+++ trunk/Source/WebCore/bindings/v8/V8NPObject.cpp 2012-11-06 13:20:42 UTC (rev 133589)
@@ -457,7 +457,7 @@
v8::Persistent<v8::Object> wrapper = staticNPObjectMap().get(object);
if (!wrapper.IsEmpty()) {
v8::HandleScope scope;
- V8DOMWrapper::setDOMWrapper(wrapper, npObjectTypeInfo(), 0);
+ V8DOMWrapper::clearDOMWrapper(wrapper, npObjectTypeInfo());
staticNPObjectMap().remove(object, wrapper);
wrapper.Dispose();
wrapper.Clear();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes