Diff
Modified: trunk/Source/WebCore/ChangeLog (117729 => 117730)
--- trunk/Source/WebCore/ChangeLog 2012-05-21 05:42:56 UTC (rev 117729)
+++ trunk/Source/WebCore/ChangeLog 2012-05-21 05:53:42 UTC (rev 117730)
@@ -1,5 +1,28 @@
2012-05-20 Kentaro Hara <[email protected]>
+ [V8] Pass Isolate to V8Utilities::createFunctionCallback()
+ https://bugs.webkit.org/show_bug.cgi?id=86978
+
+ Reviewed by Adam Barth.
+
+ The objective is to pass Isolate around in V8 bindings.
+ This patch passes Isolate to V8Utilities::createFunctionCallback().
+
+ No tests. No change in behavior.
+
+ * bindings/v8/V8Utilities.cpp:
+ (WebCore::throwTypeMismatchException):
+ * bindings/v8/V8Utilities.h:
+ (WebCore):
+ (WebCore::createFunctionOnlyCallback):
+ * bindings/v8/custom/V8GeolocationCustom.cpp:
+ (WebCore::V8Geolocation::getCurrentPositionCallback):
+ (WebCore::V8Geolocation::watchPositionCallback):
+ * bindings/v8/custom/V8NotificationCustom.cpp:
+ (WebCore::V8Notification::requestPermissionCallback):
+
+2012-05-20 Kentaro Hara <[email protected]>
+
[V8] Pass Isolate to throwError()s in bindings/v8/*.{h,cpp}
https://bugs.webkit.org/show_bug.cgi?id=86977
Modified: trunk/Source/WebCore/bindings/v8/V8Utilities.cpp (117729 => 117730)
--- trunk/Source/WebCore/bindings/v8/V8Utilities.cpp 2012-05-21 05:42:56 UTC (rev 117729)
+++ trunk/Source/WebCore/bindings/v8/V8Utilities.cpp 2012-05-21 05:53:42 UTC (rev 117730)
@@ -202,9 +202,9 @@
return 0;
}
-void throwTypeMismatchException()
+void throwTypeMismatchException(v8::Isolate* isolate)
{
- V8Proxy::throwError(V8Proxy::GeneralError, "TYPE_MISMATCH_ERR: DOM Exception 17");
+ V8Proxy::throwError(V8Proxy::GeneralError, "TYPE_MISMATCH_ERR: DOM Exception 17", isolate);
}
} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/v8/V8Utilities.h (117729 => 117730)
--- trunk/Source/WebCore/bindings/v8/V8Utilities.h 2012-05-21 05:42:56 UTC (rev 117729)
+++ trunk/Source/WebCore/bindings/v8/V8Utilities.h 2012-05-21 05:53:42 UTC (rev 117730)
@@ -60,7 +60,7 @@
ScriptExecutionContext* getScriptExecutionContext();
- void throwTypeMismatchException();
+ void throwTypeMismatchException(v8::Isolate*);
enum CallbackAllowedValueFlag {
CallbackAllowUndefined = 1,
@@ -90,7 +90,7 @@
// 'FunctionOnly' is assumed for the created callback.
template <typename V8CallbackType>
- PassRefPtr<V8CallbackType> createFunctionOnlyCallback(v8::Local<v8::Value> value, bool& succeeded, CallbackAllowedValueFlags acceptedValues = 0)
+ PassRefPtr<V8CallbackType> createFunctionOnlyCallback(v8::Local<v8::Value> value, bool& succeeded, v8::Isolate* isolate, CallbackAllowedValueFlags acceptedValues = 0)
{
succeeded = true;
@@ -102,7 +102,7 @@
if (!value->IsFunction()) {
succeeded = false;
- throwTypeMismatchException();
+ throwTypeMismatchException(isolate);
return 0;
}
Modified: trunk/Source/WebCore/bindings/v8/custom/V8GeolocationCustom.cpp (117729 => 117730)
--- trunk/Source/WebCore/bindings/v8/custom/V8GeolocationCustom.cpp 2012-05-21 05:42:56 UTC (rev 117729)
+++ trunk/Source/WebCore/bindings/v8/custom/V8GeolocationCustom.cpp 2012-05-21 05:53:42 UTC (rev 117730)
@@ -133,13 +133,13 @@
bool succeeded = false;
- RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8PositionCallback>(args[0], succeeded);
+ RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8PositionCallback>(args[0], succeeded, args.GetIsolate());
if (!succeeded)
return v8::Undefined();
ASSERT(positionCallback);
// Argument is optional (hence undefined is allowed), and null is allowed.
- RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8PositionErrorCallback>(args[1], succeeded, CallbackAllowUndefined | CallbackAllowNull);
+ RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8PositionErrorCallback>(args[1], succeeded, args.GetIsolate(), CallbackAllowUndefined | CallbackAllowNull);
if (!succeeded)
return v8::Undefined();
@@ -159,13 +159,13 @@
bool succeeded = false;
- RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8PositionCallback>(args[0], succeeded);
+ RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8PositionCallback>(args[0], succeeded, args.GetIsolate());
if (!succeeded)
return v8::Undefined();
ASSERT(positionCallback);
// Argument is optional (hence undefined is allowed), and null is allowed.
- RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8PositionErrorCallback>(args[1], succeeded, CallbackAllowUndefined | CallbackAllowNull);
+ RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8PositionErrorCallback>(args[1], succeeded, args.GetIsolate(), CallbackAllowUndefined | CallbackAllowNull);
if (!succeeded)
return v8::Undefined();
Modified: trunk/Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp (117729 => 117730)
--- trunk/Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp 2012-05-21 05:42:56 UTC (rev 117729)
+++ trunk/Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp 2012-05-21 05:53:42 UTC (rev 117730)
@@ -39,7 +39,7 @@
INC_STATS(L"DOM.Notification.requestPermission");
bool succeeded = false;
- RefPtr<V8NotificationPermissionCallback> callback = createFunctionOnlyCallback<V8NotificationPermissionCallback>(args[0], succeeded);
+ RefPtr<V8NotificationPermissionCallback> callback = createFunctionOnlyCallback<V8NotificationPermissionCallback>(args[0], succeeded, args.GetIsolate());
if (!succeeded)
return v8::Undefined();
ASSERT(callback);