Unreviewed, Chromium build fix.
[WebKit-https.git] / WebCore / bindings / v8 / custom / V8CustomVoidCallback.cpp
index 8c69e765e6d9e008ed4f443efe45312568b5adc0..f4ea62ae4b9b59f3446dd9c9e21da6477a9f427e 100644 (file)
  */
 
 #include "config.h"
-#include "V8Binding.h"
 #include "V8CustomVoidCallback.h"
 
 #include "Frame.h"
+#include "V8Binding.h"
 
 namespace WebCore {
 
@@ -64,7 +64,7 @@ void V8CustomVoidCallback::handleEvent()
     invokeCallback(m_callback, 0, 0, callbackReturnValue);
 }
 
-static bool invokeCallbackHelper(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], v8::Handle<v8::Value>& returnValue)
+bool invokeCallback(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue)
 {
     v8::TryCatch exceptionCatcher;
 
@@ -73,9 +73,8 @@ static bool invokeCallbackHelper(v8::Persistent<v8::Object> callback, int argc,
         callbackFunction = v8::Local<v8::Function>::New(v8::Persistent<v8::Function>::Cast(callback));
     } else if (callback->IsObject()) {
         v8::Local<v8::Value> handleEventFunction = callback->Get(v8::String::NewSymbol("handleEvent"));
-        if (handleEventFunction->IsFunction()) {
+        if (handleEventFunction->IsFunction())
             callbackFunction = v8::Local<v8::Function>::Cast(handleEventFunction);
-        }
     } else
         return false;
 
@@ -87,7 +86,8 @@ static bool invokeCallbackHelper(v8::Persistent<v8::Object> callback, int argc,
     V8Proxy* proxy = V8Proxy::retrieve();
     ASSERT(proxy);
 
-    returnValue = proxy->callFunction(callbackFunction, thisObject, argc, argv);
+    v8::Handle<v8::Value> result = proxy->callFunction(callbackFunction, thisObject, argc, argv);
+    callbackReturnValue = !result.IsEmpty() && result->BooleanValue();
 
     if (exceptionCatcher.HasCaught()) {
         v8::Local<v8::Message> message = exceptionCatcher.Message();
@@ -98,20 +98,4 @@ static bool invokeCallbackHelper(v8::Persistent<v8::Object> callback, int argc,
     return false;
 }
 
-bool invokeCallback(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue)
-{
-    v8::Handle<v8::Value> returnValue;
-    bool result = invokeCallbackHelper(callback, argc, argv, returnValue);
-    callbackReturnValue = !returnValue.IsEmpty() && returnValue->IsBoolean() && returnValue->BooleanValue();
-    return result;
-}
-
-bool invokeCallbackTreatOnlyExplicitFalseAsFalse(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue)
-{
-    v8::Handle<v8::Value> returnValue;
-    bool result = invokeCallbackHelper(callback, argc, argv, returnValue);
-    callbackReturnValue = !returnValue.IsEmpty() && !returnValue->IsFalse();
-    return result;
-}
-
 } // namespace WebCore