Title: [134396] trunk/Source/WebCore
Revision
134396
Author
[email protected]
Date
2012-11-13 03:44:57 -0800 (Tue, 13 Nov 2012)

Log Message

[V8] Make isValidDOMObject() static
https://bugs.webkit.org/show_bug.cgi?id=101914

Reviewed by Adam Barth.

isValidDOMObject() is used by DOMWrapper.cpp only.

No tests. No change in behavior.

* bindings/v8/V8DOMWrapper.cpp:
(WebCore::isValidDOMObject):
(WebCore):
(WebCore::V8DOMWrapper::maybeDOMWrapper):
* bindings/v8/V8DOMWrapper.h:
(V8DOMWrapper):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (134395 => 134396)


--- trunk/Source/WebCore/ChangeLog	2012-11-13 11:39:12 UTC (rev 134395)
+++ trunk/Source/WebCore/ChangeLog	2012-11-13 11:44:57 UTC (rev 134396)
@@ -1,3 +1,21 @@
+2012-11-13  Kentaro Hara  <[email protected]>
+
+        [V8] Make isValidDOMObject() static
+        https://bugs.webkit.org/show_bug.cgi?id=101914
+
+        Reviewed by Adam Barth.
+
+        isValidDOMObject() is used by DOMWrapper.cpp only.
+
+        No tests. No change in behavior.
+
+        * bindings/v8/V8DOMWrapper.cpp:
+        (WebCore::isValidDOMObject):
+        (WebCore):
+        (WebCore::V8DOMWrapper::maybeDOMWrapper):
+        * bindings/v8/V8DOMWrapper.h:
+        (V8DOMWrapper):
+
 2012-11-13  Mihnea Ovidenie  <[email protected]>
 
         [CSSRegions] Incorrect computed height for content with region-break-before

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp (134395 => 134396)


--- trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp	2012-11-13 11:39:12 UTC (rev 134395)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp	2012-11-13 11:44:57 UTC (rev 134396)
@@ -109,14 +109,17 @@
     return instance;
 }
 
-#ifndef NDEBUG
-bool V8DOMWrapper::maybeDOMWrapper(v8::Handle<v8::Value> value)
+static bool hasInternalField(v8::Handle<v8::Value> value)
 {
     if (value.IsEmpty() || !value->IsObject())
         return false;
+    return v8::Handle<v8::Object>::Cast(value)->InternalFieldCount();
+}
 
-    v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value);
-    if (!object->InternalFieldCount())
+#ifndef NDEBUG
+bool V8DOMWrapper::maybeDOMWrapper(v8::Handle<v8::Value> value)
+{
+    if (!hasInternalField(value))
         return false;
 
     ASSERT(object->InternalFieldCount() >= v8DefaultWrapperInternalFieldCount);
@@ -129,16 +132,9 @@
 }
 #endif
 
-bool V8DOMWrapper::isValidDOMObject(v8::Handle<v8::Value> value)
-{
-    if (value.IsEmpty() || !value->IsObject())
-        return false;
-    return v8::Handle<v8::Object>::Cast(value)->InternalFieldCount();
-}
-
 bool V8DOMWrapper::isWrapperOfType(v8::Handle<v8::Value> value, WrapperTypeInfo* type)
 {
-    if (!isValidDOMObject(value))
+    if (!hasInternalField(value))
         return false;
 
     v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value);

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h (134395 => 134396)


--- trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h	2012-11-13 11:39:12 UTC (rev 134395)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h	2012-11-13 11:44:57 UTC (rev 134396)
@@ -105,8 +105,6 @@
         template<typename T>
         static v8::Persistent<v8::Object> setJSWrapperForDOMObject(PassRefPtr<T>, v8::Handle<v8::Object>, v8::Isolate* = 0);
 
-        static bool isValidDOMObject(v8::Handle<v8::Value>);
-
         // Check whether a V8 value is a wrapper of type |classType|.
         static bool isWrapperOfType(v8::Handle<v8::Value>, WrapperTypeInfo*);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to