Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2111)

Unified Diff: webkit/port/bindings/scripts/CodeGeneratorV8.pm

Issue 149086: Use upstream V8Proxy and V8Utilities (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/webdevtoolsclient_impl.cc ('k') | webkit/port/bindings/v8/NPV8Object.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/port/bindings/scripts/CodeGeneratorV8.pm
===================================================================
--- webkit/port/bindings/scripts/CodeGeneratorV8.pm (revision 19426)
+++ webkit/port/bindings/scripts/CodeGeneratorV8.pm (working copy)
@@ -315,7 +315,7 @@
my $result = "";
$result .= $indent . "if (ec) {\n";
- $result .= $indent . " V8Proxy::SetDOMException(ec);\n";
+ $result .= $indent . " V8Proxy::setDOMException(ec);\n";
$result .= $indent . " return v8::Handle<v8::Value>();\n";
$result .= $indent . "}\n";
@@ -341,12 +341,12 @@
if (IsNodeSubType($dataNode)) {
push(@implContentDecls, <<END);
- $implClassName* imp = V8Proxy::DOMWrapperToNode<$implClassName>(holder);
+ $implClassName* imp = V8Proxy::convertDOMWrapperToNode<$implClassName>(holder);
END
} else {
push(@implContentDecls, <<END);
- $implClassName* imp = V8Proxy::ToNativeObject<$implClassName>(V8ClassIndex::$classIndex, holder);
+ $implClassName* imp = V8Proxy::convertToNativeObject<$implClassName>(V8ClassIndex::$classIndex, holder);
END
}
@@ -369,14 +369,14 @@
my $newTemplateString = GenerateNewFunctionTemplate($function, $dataNode, $signature);
- $implIncludes{"v8_proxy.h"} = 1;
+ $implIncludes{"V8Proxy.h"} = 1;
push(@implContentDecls, <<END);
static v8::Handle<v8::Value> ${funcName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
INC_STATS(\"DOM.$implClassName.$funcName._get\");
static v8::Persistent<v8::FunctionTemplate> private_template =
v8::Persistent<v8::FunctionTemplate>::New($newTemplateString);
- v8::Handle<v8::Object> holder = V8Proxy::LookupDOMWrapper(V8ClassIndex::$classIndex, info.This());
+ v8::Handle<v8::Object> holder = V8Proxy::lookupDOMWrapper(V8ClassIndex::$classIndex, info.This());
if (holder.IsEmpty()) {
// can only reach here by 'object.__proto__.func', and it should passed
// domain security check already
@@ -388,7 +388,7 @@
HolderToNative($dataNode, $implClassName, $classIndex);
push(@implContentDecls, <<END);
- if (!V8Proxy::CanAccessFrame(imp->frame(), false)) {
+ if (!V8Proxy::canAccessFrame(imp->frame(), false)) {
static v8::Persistent<v8::FunctionTemplate> shared_template =
v8::Persistent<v8::FunctionTemplate>::New($newTemplateString);
return shared_template->GetFunction();
@@ -416,13 +416,13 @@
if ($classIndex eq "DOMWINDOW") {
push(@implContentDecls, <<END);
- DOMWindow* window = V8Proxy::ToNativeObject<DOMWindow>(V8ClassIndex::DOMWINDOW, info.Holder());
+ DOMWindow* window = V8Proxy::convertToNativeObject<DOMWindow>(V8ClassIndex::DOMWINDOW, info.Holder());
Frame* frame = window->frame();
if (frame) {
// Get the proxy corresponding to the DOMWindow if possible to
// make sure that the constructor function is constructed in the
// context of the DOMWindow and not in the context of the caller.
- return V8Proxy::retrieve(frame)->GetConstructor(type);
+ return V8Proxy::retrieve(frame)->getConstructor(type);
}
END
}
@@ -453,7 +453,7 @@
my $attrExt = $attribute->signature->extendedAttributes;
my $attrName = $attribute->signature->name;
- $implIncludes{"v8_proxy.h"} = 1;
+ $implIncludes{"V8Proxy.h"} = 1;
my $attrType = $codeGenerator->StripModule($attribute->signature->type);
my $attrIsPodType = $codeGenerator->IsPodType($attrType);
@@ -494,7 +494,7 @@
if ($isPodType) {
push(@implContentDecls, <<END);
- V8SVGPODTypeWrapper<$implClassName>* imp_wrapper = V8Proxy::ToNativeObject<V8SVGPODTypeWrapper<$implClassName> >(V8ClassIndex::$classIndex, info.Holder());
+ V8SVGPODTypeWrapper<$implClassName>* imp_wrapper = V8Proxy::convertToNativeObject<V8SVGPODTypeWrapper<$implClassName> >(V8ClassIndex::$classIndex, info.Holder());
$implClassName imp_instance = *imp_wrapper;
END
if ($getterStringUsesImp) {
@@ -506,7 +506,7 @@
} elsif ($attrExt->{"v8OnProto"} || $attrExt->{"V8DisallowShadowing"}) {
# perform lookup first
push(@implContentDecls, <<END);
- v8::Handle<v8::Object> holder = V8Proxy::LookupDOMWrapper(V8ClassIndex::$classIndex, info.This());
+ v8::Handle<v8::Object> holder = V8Proxy::lookupDOMWrapper(V8ClassIndex::$classIndex, info.This());
if (holder.IsEmpty()) return v8::Undefined();
END
HolderToNative($dataNode, $implClassName, $classIndex);
@@ -519,9 +519,9 @@
# Generate security checks if necessary
if ($attribute->signature->extendedAttributes->{"CheckNodeSecurity"}) {
- push(@implContentDecls, " if (!V8Proxy::CheckNodeSecurity(imp->$attrName())) return v8::Undefined();\n\n");
+ push(@implContentDecls, " if (!V8Proxy::checkNodeSecurity(imp->$attrName())) return v8::Undefined();\n\n");
} elsif ($attribute->signature->extendedAttributes->{"CheckFrameSecurity"}) {
- push(@implContentDecls, " if (!V8Proxy::CheckNodeSecurity(imp->contentDocument())) return v8::Undefined();\n\n");
+ push(@implContentDecls, " if (!V8Proxy::checkNodeSecurity(imp->contentDocument())) return v8::Undefined();\n\n");
}
my $useExceptions = 1 if @{$attribute->getterExceptions} and !($isPodType);
@@ -618,7 +618,7 @@
if ($attrIsPodType) {
my $classIndex = uc($attrType);
- push(@implContentDecls, " return V8Proxy::ToV8Object(V8ClassIndex::$classIndex, wrapper);\n");
+ push(@implContentDecls, " return V8Proxy::convertToV8Object(V8ClassIndex::$classIndex, wrapper);\n");
} else {
push(@implContentDecls, " return " . NativeToJSValue($attribute->signature, $result). ";\n");
}
@@ -631,7 +631,7 @@
{
my $implClassName = shift;
- $implIncludes{"v8_proxy.h"} = 1;
+ $implIncludes{"V8Proxy.h"} = 1;
push(@implContentDecls,
" static void ${attrName}AttrSetter(v8::Local<v8::String> name," .
@@ -655,7 +655,7 @@
my $attrExt = $attribute->signature->extendedAttributes;
- $implIncludes{"v8_proxy.h"} = 1;
+ $implIncludes{"V8Proxy.h"} = 1;
push(@implContentDecls,
" static void ${attrName}AttrSetter(v8::Local<v8::String> name," .
@@ -668,14 +668,14 @@
if ($isPodType) {
$implClassName = GetNativeType($implClassName);
$implIncludes{"V8SVGPODTypeWrapper.h"} = 1;
- push(@implContentDecls, " V8SVGPODTypeWrapper<$implClassName>* wrapper = V8Proxy::ToNativeObject<V8SVGPODTypeWrapper<$implClassName> >(V8ClassIndex::$classIndex, info.Holder());\n");
+ push(@implContentDecls, " V8SVGPODTypeWrapper<$implClassName>* wrapper = V8Proxy::convertToNativeObject<V8SVGPODTypeWrapper<$implClassName> >(V8ClassIndex::$classIndex, info.Holder());\n");
push(@implContentDecls, " $implClassName imp_instance = *wrapper;\n");
push(@implContentDecls, " $implClassName* imp = &imp_instance;\n");
} elsif ($attrExt->{"v8OnProto"}) {
# perform lookup first
push(@implContentDecls, <<END);
- v8::Handle<v8::Object> holder = V8Proxy::LookupDOMWrapper(V8ClassIndex::$classIndex, info.This());
+ v8::Handle<v8::Object> holder = V8Proxy::lookupDOMWrapper(V8ClassIndex::$classIndex, info.This());
if (holder.IsEmpty()) return v8::Undefined();
END
HolderToNative($dataNode, $implClassName, $classIndex);
@@ -718,11 +718,11 @@
}
if ($useExceptions) {
- push(@implContentDecls, " V8Proxy::SetDOMException(ec);\n");
+ push(@implContentDecls, " V8Proxy::setDOMException(ec);\n");
}
if ($isPodType) {
- push(@implContentDecls, " wrapper->commitChange(*imp, V8Proxy::GetSVGContext(wrapper));\n");
+ push(@implContentDecls, " wrapper->commitChange(*imp, V8Proxy::svgContext(wrapper));\n");
} elsif (IsSVGTypeNeedingContextParameter($implClassName)) {
$implIncludes{"SVGElement.h"} = 1;
@@ -731,7 +731,7 @@
$currentObject = "wrapper";
}
- push(@implContentDecls, " if (SVGElement* context = V8Proxy::GetSVGContext($currentObject)) {\n");
+ push(@implContentDecls, " if (SVGElement* context = V8Proxy::svgContext($currentObject)) {\n");
push(@implContentDecls, " context->svgAttributeChanged(imp->associatedAttributeName());\n");
push(@implContentDecls, " }\n");
}
@@ -791,7 +791,7 @@
if ($codeGenerator->IsPodType($implClassName)) {
my $nativeClassName = GetNativeType($implClassName);
- push(@implContentDecls, " V8SVGPODTypeWrapper<$nativeClassName>* imp_wrapper = V8Proxy::ToNativeObject<V8SVGPODTypeWrapper<$nativeClassName> >(V8ClassIndex::$classIndex, args.Holder());\n");
+ push(@implContentDecls, " V8SVGPODTypeWrapper<$nativeClassName>* imp_wrapper = V8Proxy::convertToNativeObject<V8SVGPODTypeWrapper<$nativeClassName> >(V8ClassIndex::$classIndex, args.Holder());\n");
push(@implContentDecls, " $nativeClassName imp_instance = *imp_wrapper;\n");
push(@implContentDecls, " $nativeClassName* imp = &imp_instance;\n");
} else {
@@ -807,7 +807,7 @@
&& !$function->signature->extendedAttributes->{"DoNotCheckDomainSecurity"}) {
# We have not find real use cases yet.
push(@implContentDecls,
-" if (!V8Proxy::CanAccessFrame(imp->frame(), true)) {\n".
+" if (!V8Proxy::canAccessFrame(imp->frame(), true)) {\n".
" return v8::Undefined();\n" .
" }\n");
}
@@ -849,7 +849,7 @@
$implIncludes{"ExceptionCode.h"} = 1;
push(@implContentDecls,
" if (!$parameterName" . (BasicTypeCanFailConversion($parameter) ? "Ok" : "") . ") {\n" .
-" V8Proxy::SetDOMException(TYPE_MISMATCH_ERR);\n" .
+" V8Proxy::setDOMException(TYPE_MISMATCH_ERR);\n" .
" return v8::Handle<v8::Value>();\n" .
" }\n");
}
@@ -858,7 +858,7 @@
$implIncludes{"ExceptionCode.h"} = 1;
push(@implContentDecls,
" if ($parameterName < 0) {\n" .
-" V8Proxy::SetDOMException(INDEX_SIZE_ERR);\n" .
+" V8Proxy::setDOMException(INDEX_SIZE_ERR);\n" .
" return v8::Handle<v8::Value>();\n" .
" }\n");
}
@@ -1050,7 +1050,7 @@
push(@implFixedHeader,
"#include \"config.h\"\n" .
- "#include \"v8_proxy.h\"\n" .
+ "#include \"V8Proxy.h\"\n" .
"#include \"v8_binding.h\"\n\n" .
"#undef LOG\n\n");
@@ -1067,7 +1067,7 @@
$implIncludes{"${className}.h"} = 1;
AddIncludesForType($interfaceName);
- $implIncludes{"v8_proxy.h"} = 1;
+ $implIncludes{"V8Proxy.h"} = 1;
push(@implContentDecls, "namespace WebCore {\n");
push(@implContentDecls, "namespace ${interfaceName}Internal {\n\n");
@@ -1217,7 +1217,7 @@
if ($implClassName eq "DOMWindow") {
push(@implContent, <<END);
static v8::Persistent<v8::ObjectTemplate> ConfigureShadowObjectTemplate(v8::Persistent<v8::ObjectTemplate> templ) {
- BatchConfigureAttributes(templ,
+ batchConfigureAttributes(templ,
v8::Handle<v8::ObjectTemplate>(),
shadow_attrs,
sizeof(shadow_attrs)/sizeof(*shadow_attrs));
@@ -1240,7 +1240,7 @@
# Set up our attributes if we have them
if ($has_attributes) {
push(@implContent, <<END);
- BatchConfigureAttributes(instance, proto, attrs, sizeof(attrs)/sizeof(*attrs));
+ batchConfigureAttributes(instance, proto, attrs, sizeof(attrs)/sizeof(*attrs));
END
}
@@ -1325,7 +1325,7 @@
if ($parent eq "EventTarget") { next; }
$implIncludes{"V8${parent}.h"} = 1;
my $parentClassIndex = uc($codeGenerator->StripModule($parent));
- push(@implContent, " desc->Inherit(V8Proxy::GetTemplate(V8ClassIndex::${parentClassIndex}));\n");
+ push(@implContent, " desc->Inherit(V8Proxy::getTemplate(V8ClassIndex::${parentClassIndex}));\n");
last;
}
@@ -1334,7 +1334,7 @@
if ($has_constants) {
push(@implContent, <<END);
- BatchConfigureConstants(desc, proto, consts, sizeof(consts)/sizeof(*consts));
+ batchConfigureConstants(desc, proto, consts, sizeof(consts)/sizeof(*consts));
END
}
@@ -1346,7 +1346,7 @@
static v8::Persistent<v8::FunctionTemplate> ${className}_raw_cache_;
if (${className}_raw_cache_.IsEmpty()) {
v8::HandleScope scope;
- v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(V8Proxy::CheckNewLegal);
+ v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(V8Proxy::checkNewLegal);
${className}_raw_cache_ = v8::Persistent<v8::FunctionTemplate>::New(result);
}
return ${className}_raw_cache_;
@@ -1489,7 +1489,7 @@
}
$result .= $indent . "if (success)\n";
$result .= $indent . " " .
- "return V8Proxy::NodeToV8Object($nodeToReturn);\n";
+ "return V8Proxy::convertNodeToV8Object($nodeToReturn);\n";
$result .= $indent . "return v8::Null();\n";
return $result;
} elsif ($returnType eq "void") {
@@ -1554,7 +1554,7 @@
if ($returnsPodType) {
my $classIndex = uc($returnType);
- $result .= $indent . "return V8Proxy::ToV8Object(V8ClassIndex::$classIndex, wrapper);\n";
+ $result .= $indent . "return V8Proxy::convertToV8Object(V8ClassIndex::$classIndex, wrapper);\n";
} else {
$result .= $indent . "return " . NativeToJSValue($function->signature, $return) . ";\n";
}
@@ -1818,7 +1818,7 @@
}
if ($type eq "NodeFilter") {
- return "V8Proxy::ToNativeNodeFilter($value)";
+ return "V8Proxy::wrapNativeNodeFilter($value)";
}
if ($type eq "SVGRect") {
@@ -1830,12 +1830,12 @@
}
# Default, assume autogenerated type conversion routines
- $implIncludes{"v8_proxy.h"} = 1;
+ $implIncludes{"V8Proxy.h"} = 1;
if ($type eq "EventTarget") {
$implIncludes{"V8Node.h"} = 1;
# EventTarget is not in DOM hierarchy, but all Nodes are EventTarget.
- return "V8Node::HasInstance($value) ? V8Proxy::DOMWrapperToNode<Node>($value) : 0";
+ return "V8Node::HasInstance($value) ? V8Proxy::convertDOMWrapperToNode<Node>($value) : 0";
}
AddIncludesForType($type);
@@ -1846,7 +1846,7 @@
# Perform type checks on the parameter, if it is expected Node type,
# return NULL.
- return "V8${type}::HasInstance($value) ? V8Proxy::DOMWrapperToNode<${type}>($value) : 0";
+ return "V8${type}::HasInstance($value) ? V8Proxy::convertDOMWrapperToNode<${type}>($value) : 0";
} else {
# TODO: Temporary to avoid Window name conflict.
@@ -1866,7 +1866,7 @@
# Perform type checks on the parameter, if it is expected Node type,
# return NULL.
- return "V8${type}::HasInstance($value) ? V8Proxy::ToNativeObject<${implClassName}>(V8ClassIndex::${classIndex}, $value) : 0";
+ return "V8${type}::HasInstance($value) ? V8Proxy::convertToNativeObject<${implClassName}>(V8ClassIndex::${classIndex}, $value) : 0";
}
}
@@ -2020,23 +2020,23 @@
# special case for non-DOM node interfaces
if (IsDOMNodeType($type)) {
- return "V8Proxy::NodeToV8Object($value)";
+ return "V8Proxy::convertNodeToV8Object($value)";
}
if ($type eq "EventTarget" or $type eq "SVGElementInstance") {
- return "V8Proxy::EventTargetToV8Object($value)";
+ return "V8Proxy::convertEventTargetToV8Object($value)";
}
if ($type eq "Event") {
- return "V8Proxy::EventToV8Object($value)";
+ return "V8Proxy::convertEventToV8Object($value)";
}
if ($type eq "EventListener") {
- return "V8Proxy::EventListenerToV8Object($value)";
+ return "V8Proxy::convertEventListenerToV8Object($value)";
}
if ($type eq "RGBColor") {
- return "V8Proxy::ToV8Object(V8ClassIndex::RGBCOLOR, new RGBColor($value))";
+ return "V8Proxy::convertToV8Object(V8ClassIndex::RGBCOLOR, new RGBColor($value))";
}
if ($type eq "WorkerContext" or $type eq "WorkerLocation" or $type eq "WorkerNavigator") {
@@ -2055,7 +2055,7 @@
$value = GenerateSVGStaticPodTypeWrapper($type, $value);
}
- return "V8Proxy::ToV8Object(V8ClassIndex::$classIndex, $value)";
+ return "V8Proxy::convertToV8Object(V8ClassIndex::$classIndex, $value)";
}
}
@@ -2127,7 +2127,7 @@
my $indent = shift;
$result = GenerateSVGContextRetrieval($srcType, $indent);
- $result .= $indent . "V8Proxy::SetSVGContext($value, context);\n";
+ $result .= $indent . "V8Proxy::setSVGContext($value, context);\n";
return $result;
}
@@ -2147,7 +2147,7 @@
my $contextDecl;
if (IsSVGTypeNeedingContextParameter($srcType)) {
- $contextDecl = "V8Proxy::GetSVGContext($srcObject)";
+ $contextDecl = "V8Proxy::svgContext($srcObject)";
} else {
$contextDecl = $srcObject;
}
« no previous file with comments | « webkit/glue/webdevtoolsclient_impl.cc ('k') | webkit/port/bindings/v8/NPV8Object.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698