Modified: trunk/Source/WebCore/ChangeLog (140623 => 140624)
--- trunk/Source/WebCore/ChangeLog 2013-01-24 02:02:25 UTC (rev 140623)
+++ trunk/Source/WebCore/ChangeLog 2013-01-24 02:11:18 UTC (rev 140624)
@@ -1,3 +1,22 @@
+2013-01-23 Kentaro Hara <[email protected]>
+
+ [V8] Make an Isolate parameter mandatory in NativeToJS()
+ https://bugs.webkit.org/show_bug.cgi?id=107663
+
+ Reviewed by Adam Barth.
+
+ No tests. No change in behavior.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateCallbackImplementation):
+ (NativeToJSValue):
+ * bindings/scripts/test/V8/V8TestCallback.cpp:
+ (WebCore::V8TestCallback::callbackWithClass1Param):
+ (WebCore::V8TestCallback::callbackWithClass2Param):
+ (WebCore::V8TestCallback::callbackWithStringList):
+ (WebCore::V8TestCallback::callbackWithBoolean):
+ (WebCore::V8TestCallback::callbackRequiresThisToPass):
+
2013-01-23 Benjamin Poulain <[email protected]>
RenderProgress does not repaint on value change
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (140623 => 140624)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2013-01-24 02:02:25 UTC (rev 140623)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2013-01-24 02:11:18 UTC (rev 140624)
@@ -3385,7 +3385,7 @@
@args = ();
foreach my $param (@params) {
my $paramName = $param->name;
- push(@implContent, " v8::Handle<v8::Value> ${paramName}Handle = " . NativeToJSValue($param, $paramName, "v8::Handle<v8::Object>()", "v8::Isolate::GetCurrent()") . ";\n");
+ push(@implContent, " v8::Handle<v8::Value> ${paramName}Handle = " . NativeToJSValue($param, $paramName, "v8::Handle<v8::Object>()", "v8Context->GetIsolate()") . ";\n");
push(@implContent, " if (${paramName}Handle.IsEmpty()) {\n");
push(@implContent, " if (!isScriptControllerTerminating())\n");
push(@implContent, " CRASH();\n");
@@ -4017,6 +4017,7 @@
my $value = shift;
my $getCreationContext = shift;
my $getIsolate = shift;
+ die "An Isolate is mandatory for native value => JS value conversion." unless $getIsolate;
my $getHolderContainer = shift;
my $getHolderContainerArg = $getHolderContainer ? ", $getHolderContainer" : "";
my $getScriptWrappable = shift;
@@ -4026,7 +4027,7 @@
my $type = $signature->type;
- return ($getIsolate ? "v8Boolean($value, $getIsolate)" : "v8Boolean($value)") if $type eq "boolean";
+ return "v8Boolean($value, $getIsolate)" if $type eq "boolean";
return "v8Undefined()" if $type eq "void"; # equivalent to v8Undefined()
# HTML5 says that unsigned reflected attributes should be in the range
@@ -4057,7 +4058,7 @@
die "Unknown value for TreatReturnedNullStringAs extended attribute";
}
- return $getIsolate ? "v8String($value, $getIsolate$returnHandleTypeArg)" : "deprecatedV8String($value)";
+ return "v8String($value, $getIsolate$returnHandleTypeArg)";
}
my $arrayType = $codeGenerator->GetArrayType($type);
@@ -4087,12 +4088,12 @@
if ($type eq "EventListener") {
AddToImplIncludes("V8AbstractEventListener.h");
- return "${value} ? v8::Handle<v8::Value>(static_cast<V8AbstractEventListener*>(${value})->getListenerObject(imp->scriptExecutionContext())) : v8::Handle<v8::Value>(" . ($getIsolate ? "v8Null($getIsolate)" : "v8::Null()") . ")";
+ return "${value} ? v8::Handle<v8::Value>(static_cast<V8AbstractEventListener*>(${value})->getListenerObject(imp->scriptExecutionContext())) : v8::Handle<v8::Value>(v8Null($getIsolate))";
}
if ($type eq "SerializedScriptValue") {
AddToImplIncludes("$type.h");
- return "$value ? $value->deserialize() : v8::Handle<v8::Value>(" . ($getIsolate ? "v8Null($getIsolate)" : "v8::Null()") . ")";
+ return "$value ? $value->deserialize() : v8::Handle<v8::Value>(v8Null($getIsolate))";
}
AddToImplIncludes("wtf/RefCounted.h");
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp (140623 => 140624)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp 2013-01-24 02:02:25 UTC (rev 140623)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp 2013-01-24 02:11:18 UTC (rev 140624)
@@ -85,7 +85,7 @@
v8::Context::Scope scope(v8Context);
- v8::Handle<v8::Value> class1ParamHandle = toV8(class1Param, v8::Handle<v8::Object>(), v8::Isolate::GetCurrent());
+ v8::Handle<v8::Value> class1ParamHandle = toV8(class1Param, v8::Handle<v8::Object>(), v8Context->GetIsolate());
if (class1ParamHandle.IsEmpty()) {
if (!isScriptControllerTerminating())
CRASH();
@@ -113,13 +113,13 @@
v8::Context::Scope scope(v8Context);
- v8::Handle<v8::Value> class2ParamHandle = toV8(class2Param, v8::Handle<v8::Object>(), v8::Isolate::GetCurrent());
+ v8::Handle<v8::Value> class2ParamHandle = toV8(class2Param, v8::Handle<v8::Object>(), v8Context->GetIsolate());
if (class2ParamHandle.IsEmpty()) {
if (!isScriptControllerTerminating())
CRASH();
return true;
}
- v8::Handle<v8::Value> strArgHandle = v8String(strArg, v8::Isolate::GetCurrent());
+ v8::Handle<v8::Value> strArgHandle = v8String(strArg, v8Context->GetIsolate());
if (strArgHandle.IsEmpty()) {
if (!isScriptControllerTerminating())
CRASH();
@@ -148,7 +148,7 @@
v8::Context::Scope scope(v8Context);
- v8::Handle<v8::Value> listParamHandle = toV8(listParam, v8::Handle<v8::Object>(), v8::Isolate::GetCurrent());
+ v8::Handle<v8::Value> listParamHandle = toV8(listParam, v8::Handle<v8::Object>(), v8Context->GetIsolate());
if (listParamHandle.IsEmpty()) {
if (!isScriptControllerTerminating())
CRASH();
@@ -176,7 +176,7 @@
v8::Context::Scope scope(v8Context);
- v8::Handle<v8::Value> boolParamHandle = v8Boolean(boolParam, v8::Isolate::GetCurrent());
+ v8::Handle<v8::Value> boolParamHandle = v8Boolean(boolParam, v8Context->GetIsolate());
if (boolParamHandle.IsEmpty()) {
if (!isScriptControllerTerminating())
CRASH();
@@ -206,13 +206,13 @@
v8::Context::Scope scope(v8Context);
- v8::Handle<v8::Value> class8ParamHandle = toV8(class8Param, v8::Handle<v8::Object>(), v8::Isolate::GetCurrent());
+ v8::Handle<v8::Value> class8ParamHandle = toV8(class8Param, v8::Handle<v8::Object>(), v8Context->GetIsolate());
if (class8ParamHandle.IsEmpty()) {
if (!isScriptControllerTerminating())
CRASH();
return true;
}
- v8::Handle<v8::Value> thisClassParamHandle = toV8(thisClassParam, v8::Handle<v8::Object>(), v8::Isolate::GetCurrent());
+ v8::Handle<v8::Value> thisClassParamHandle = toV8(thisClassParam, v8::Handle<v8::Object>(), v8Context->GetIsolate());
if (thisClassParamHandle.IsEmpty()) {
if (!isScriptControllerTerminating())
CRASH();