Title: [124981] trunk/Source/WebCore
Revision
124981
Author
hara...@chromium.org
Date
2012-08-07 21:38:20 -0700 (Tue, 07 Aug 2012)

Log Message

[V8] Replace v8::Handle<v8::Value>() in bindings/v8/* with v8Undefined()
https://bugs.webkit.org/show_bug.cgi?id=93211

Reviewed by Eric Seidel.

We should use v8Undefined() everywhere in V8 bindings.
Replacing v8::Local<v8::Value>() etc with v8Undefined() can cause build
errors due to type conversion mismatch. I'll do the replacement in follow-up
patches.

No tests. No change in behavior.

* bindings/v8/IDBBindingUtilities.cpp:
(WebCore):
* bindings/v8/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::pauseOnExceptionsState):
(WebCore::ScriptDebugServer::handleV8DebugEvent):
* bindings/v8/SerializedScriptValue.cpp:
* bindings/v8/V8Binding.cpp:
(WebCore::batchConfigureCallbacks):
* bindings/v8/V8Collection.h:
(WebCore::getV8Object):
(WebCore::collectionNamedPropertyGetter):
* bindings/v8/V8DOMWrapper.cpp:
(WebCore::V8DOMWrapper::convertEventTargetToV8Object):
* bindings/v8/V8NPObject.cpp:
(WebCore::npObjectGetProperty):
(WebCore::npObjectSetProperty):
* bindings/v8/V8Proxy.cpp:
(WebCore::V8Proxy::setDOMException):
(WebCore::V8Proxy::throwError):
* bindings/v8/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::addListener):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (124980 => 124981)


--- trunk/Source/WebCore/ChangeLog	2012-08-08 04:34:26 UTC (rev 124980)
+++ trunk/Source/WebCore/ChangeLog	2012-08-08 04:38:20 UTC (rev 124981)
@@ -1,3 +1,39 @@
+2012-08-07  Kentaro Hara  <hara...@chromium.org>
+
+        [V8] Replace v8::Handle<v8::Value>() in bindings/v8/* with v8Undefined()
+        https://bugs.webkit.org/show_bug.cgi?id=93211
+
+        Reviewed by Eric Seidel.
+
+        We should use v8Undefined() everywhere in V8 bindings.
+        Replacing v8::Local<v8::Value>() etc with v8Undefined() can cause build
+        errors due to type conversion mismatch. I'll do the replacement in follow-up
+        patches.
+
+        No tests. No change in behavior.
+
+        * bindings/v8/IDBBindingUtilities.cpp:
+        (WebCore):
+        * bindings/v8/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::pauseOnExceptionsState):
+        (WebCore::ScriptDebugServer::handleV8DebugEvent):
+        * bindings/v8/SerializedScriptValue.cpp:
+        * bindings/v8/V8Binding.cpp:
+        (WebCore::batchConfigureCallbacks):
+        * bindings/v8/V8Collection.h:
+        (WebCore::getV8Object):
+        (WebCore::collectionNamedPropertyGetter):
+        * bindings/v8/V8DOMWrapper.cpp:
+        (WebCore::V8DOMWrapper::convertEventTargetToV8Object):
+        * bindings/v8/V8NPObject.cpp:
+        (WebCore::npObjectGetProperty):
+        (WebCore::npObjectSetProperty):
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::setDOMException):
+        (WebCore::V8Proxy::throwError):
+        * bindings/v8/WorkerScriptDebugServer.cpp:
+        (WebCore::WorkerScriptDebugServer::addListener):
+
 2012-08-07  Joe Mason  <jma...@rim.com>
 
         Fix regression in credential storage when using Negotiate auth

Modified: trunk/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp (124980 => 124981)


--- trunk/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp	2012-08-08 04:34:26 UTC (rev 124980)
+++ trunk/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp	2012-08-08 04:38:20 UTC (rev 124981)
@@ -126,7 +126,7 @@
     ASSERT(index <= keyPathElements.size());
     for (size_t i = 0; i < index; ++i) {
         if (!get(currentValue, keyPathElements[i]))
-            return v8::Handle<v8::Value>();
+            return v8Undefined();
     }
 
     return currentValue;
@@ -143,7 +143,7 @@
         if (!get(currentValue, keyPathElement)) {
             v8::Handle<v8::Object> object = v8::Object::New();
             if (!set(parentValue, keyPathElement, object))
-                return v8::Handle<v8::Value>();
+                return v8Undefined();
             currentValue = object;
         }
     }

Modified: trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp (124980 => 124981)


--- trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp	2012-08-08 04:34:26 UTC (rev 124980)
+++ trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp	2012-08-08 04:38:20 UTC (rev 124981)
@@ -137,7 +137,7 @@
     v8::HandleScope scope;
     v8::Context::Scope contextScope(v8::Debug::GetDebugContext());
 
-    v8::Handle<v8::Value> argv[] = { v8::Handle<v8::Value>() };
+    v8::Handle<v8::Value> argv[] = { v8Undefined() };
     v8::Handle<v8::Value> result = callDebuggerMethod("pauseOnExceptionsState", 0, argv);
     return static_cast<ScriptDebugServer::PauseOnExceptionsState>(result->Int32Value());
 }
@@ -363,7 +363,7 @@
                 v8::Handle<v8::Object> eventData = eventDetails.GetEventData();
                 v8::Handle<v8::Value> exceptionGetterValue = eventData->Get(v8::String::New("exception"));
                 ASSERT(!exceptionGetterValue.IsEmpty() && exceptionGetterValue->IsFunction());
-                v8::Handle<v8::Value> argv[] = { v8::Handle<v8::Value>() };
+                v8::Handle<v8::Value> argv[] = { v8Undefined() };
                 V8RecursionScope::MicrotaskSuppression scope;
                 exception = v8::Handle<v8::Function>::Cast(exceptionGetterValue)->Call(eventData, 0, argv);
             }

Modified: trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp (124980 => 124981)


--- trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp	2012-08-08 04:34:26 UTC (rev 124980)
+++ trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp	2012-08-08 04:38:20 UTC (rev 124981)
@@ -730,7 +730,7 @@
     class ErrorState : public StateBase {
     public:
         ErrorState()
-            : StateBase(v8::Handle<v8::Value>(), 0)
+            : StateBase(v8Undefined(), 0)
         {
         }
 

Modified: trunk/Source/WebCore/bindings/v8/V8Collection.h (124980 => 124981)


--- trunk/Source/WebCore/bindings/v8/V8Collection.h	2012-08-08 04:34:26 UTC (rev 124980)
+++ trunk/Source/WebCore/bindings/v8/V8Collection.h	2012-08-08 04:38:20 UTC (rev 124981)
@@ -45,7 +45,7 @@
 template<class T> static v8::Handle<v8::Value> getV8Object(T* implementation, v8::Isolate* isolate)
 {
     if (!implementation)
-        return v8::Handle<v8::Value>();
+        return v8Undefined();
     return toV8(implementation, isolate);
 }
 
@@ -74,9 +74,9 @@
 template<class Collection, class ItemType> static v8::Handle<v8::Value> collectionNamedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
     if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
-        return v8::Handle<v8::Value>();
+        return v8Undefined();
     if (info.Holder()->HasRealNamedCallbackProperty(name))
-        return v8::Handle<v8::Value>();
+        return v8Undefined();
 
     return getNamedPropertyOfCollection<Collection, ItemType>(name, info.Holder(), info.GetIsolate());
 }

Modified: trunk/Source/WebCore/bindings/v8/V8ConfigureDOMAttributesAndMethods.cpp (124980 => 124981)


--- trunk/Source/WebCore/bindings/v8/V8ConfigureDOMAttributesAndMethods.cpp	2012-08-08 04:34:26 UTC (rev 124980)
+++ trunk/Source/WebCore/bindings/v8/V8ConfigureDOMAttributesAndMethods.cpp	2012-08-08 04:38:20 UTC (rev 124981)
@@ -61,7 +61,7 @@
                              size_t callbackCount)
 {
     for (size_t i = 0; i < callbackCount; ++i)
-        proto->Set(v8::String::New(callbacks[i].name), v8::FunctionTemplate::New(callbacks[i].callback, v8::Handle<v8::Value>(), signature), attributes);
+        proto->Set(v8::String::New(callbacks[i].name), v8::FunctionTemplate::New(callbacks[i].callback, v8Undefined(), signature), attributes);
 }
 
 v8::Local<v8::Signature> configureTemplate(v8::Persistent<v8::FunctionTemplate> desc,

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp (124980 => 124981)


--- trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp	2012-08-08 04:34:26 UTC (rev 124980)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp	2012-08-08 04:38:20 UTC (rev 124981)
@@ -273,7 +273,7 @@
     DOM_EVENT_TARGET_INTERFACES_FOR_EACH(TRY_TO_WRAP_WITH_INTERFACE)
 
     ASSERT_NOT_REACHED();
-    return v8::Handle<v8::Value>();
+    return v8Undefined();
 }
 
 PassRefPtr<EventListener> V8DOMWrapper::getEventListener(v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)

Modified: trunk/Source/WebCore/bindings/v8/V8NPObject.cpp (124980 => 124981)


--- trunk/Source/WebCore/bindings/v8/V8NPObject.cpp	2012-08-08 04:34:26 UTC (rev 124980)
+++ trunk/Source/WebCore/bindings/v8/V8NPObject.cpp	2012-08-08 04:38:20 UTC (rev 124981)
@@ -200,7 +200,7 @@
         NPVariant result;
         VOID_TO_NPVARIANT(result);
         if (!npObject->_class->getProperty(npObject, identifier, &result))
-            return v8::Handle<v8::Value>();
+            return v8Undefined();
 
         v8::Handle<v8::Value> returnValue;
         if (_NPN_IsAlive(npObject))
@@ -234,7 +234,7 @@
         return v8Function;
     }
 
-    return v8::Handle<v8::Value>();
+    return v8Undefined();
 }
 
 v8::Handle<v8::Value> npObjectNamedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
@@ -289,7 +289,7 @@
         if (success)
             return value; // Intercept the call.
     }
-    return v8::Handle<v8::Value>();
+    return v8Undefined();
 }
 
 

Modified: trunk/Source/WebCore/bindings/v8/V8Proxy.cpp (124980 => 124981)


--- trunk/Source/WebCore/bindings/v8/V8Proxy.cpp	2012-08-08 04:34:26 UTC (rev 124980)
+++ trunk/Source/WebCore/bindings/v8/V8Proxy.cpp	2012-08-08 04:38:20 UTC (rev 124981)
@@ -491,7 +491,7 @@
 v8::Handle<v8::Value> V8Proxy::setDOMException(int ec, v8::Isolate* isolate)
 {
     if (ec <= 0 || v8::V8::IsExecutionTerminating())
-        return v8::Handle<v8::Value>();
+        return v8Undefined();
 
     if (ec == NATIVE_TYPE_ERR) {
         const char* message = 0;
@@ -506,7 +506,7 @@
     }
 
     if (exception.IsEmpty())
-        return v8::Handle<v8::Value>();
+        return v8Undefined();
 
     // Attach an Error object to the DOMException. This is then lazily used to get the stack value.
     v8::Handle<v8::Value> error = v8::Exception::Error(v8String(description.description, isolate));
@@ -534,7 +534,7 @@
         return v8::ThrowException(v8::Exception::Error(v8String(message, isolate)));
     default:
         ASSERT_NOT_REACHED();
-        return v8::Handle<v8::Value>();
+        return v8Undefined();
     }
 }
 

Modified: trunk/Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp (124980 => 124981)


--- trunk/Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp	2012-08-08 04:34:26 UTC (rev 124980)
+++ trunk/Source/WebCore/bindings/v8/WorkerScriptDebugServer.cpp	2012-08-08 04:38:20 UTC (rev 124981)
@@ -72,7 +72,7 @@
         return;
 
     v8::Handle<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("getWorkerScripts")));
-    v8::Handle<v8::Value> argv[] = { v8::Handle<v8::Value>() };
+    v8::Handle<v8::Value> argv[] = { v8Undefined() };
     v8::Handle<v8::Value> value = getScriptsFunction->Call(m_debuggerScript.get(), 0, argv);
     if (value.IsEmpty())
         return;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to