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

Unified Diff: Source/bindings/scripts/code_generator_v8.pm

Issue 173363002: Move mediastream module to oilpan transition types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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
Index: Source/bindings/scripts/code_generator_v8.pm
diff --git a/Source/bindings/scripts/code_generator_v8.pm b/Source/bindings/scripts/code_generator_v8.pm
index a554f2f090e7a318991dc654c0693d359a64a558..1f7b421f2530fa7b26090392b2efc098fe4fc940 100644
--- a/Source/bindings/scripts/code_generator_v8.pm
+++ b/Source/bindings/scripts/code_generator_v8.pm
@@ -5440,6 +5440,7 @@ sub GetNativeType
my $type = shift;
my $extendedAttributes = shift;
my $isParameter = shift;
+ my $isMember = shift;
haraken 2014/02/27 15:32:43 The Perl generator is already gone, so you can rem
my $svgNativeType = GetSVGTypeNeedingTearOff($type);
if ($svgNativeType) {
@@ -5490,7 +5491,11 @@ sub GetNativeType
if ($isParameter) {
return "$implClassName*";
} elsif (IsWillBeGarbageCollectedType($interface->name)) {
- return "RefPtrWillBeRawPtr<$implClassName>";
+ if ($isMember) {
+ return "RefPtrWillBeMember<$implClassName>";
+ } else {
+ return "RefPtrWillBeRawPtr<$implClassName>";
+ }
} else {
return "RefPtr<$implClassName>";
}
@@ -5500,9 +5505,15 @@ sub GetNativeType
my $arrayOrSequenceType = GetArrayOrSequenceType($type);
if ($arrayOrSequenceType) {
- my $nativeType = GetNativeType($arrayOrSequenceType);
- $nativeType .= " " if ($nativeType =~ />$/);
- return "Vector<${nativeType}>";
+ if (IsWillBeGarbageCollectedType($arrayOrSequenceType)) {
+ my $nativeType = GetNativeType($arrayOrSequenceType, {}, "", "member");
+ $nativeType .= " " if ($nativeType =~ />$/);
+ return "WillBeHeapVector<${nativeType}>";
+ } else {
+ my $nativeType = GetNativeType($arrayOrSequenceType);
+ $nativeType .= " " if ($nativeType =~ />$/);
+ return "Vector<${nativeType}>";
+ }
}
# Default, assume native type is a pointer with same type name as idl type
@@ -5519,6 +5530,7 @@ sub GetNativeTypeForCallbacks
# Callbacks use raw pointers, so pass isParameter = 1
my $nativeType = GetNativeType($type, {}, "parameter");
return "const $nativeType&" if $nativeType =~ /^Vector/;
+ return "const $nativeType&" if $nativeType =~ /^WillBeHeapVector/;
return $nativeType;
}
@@ -5627,6 +5639,10 @@ sub JSValueToNative
my $arrayOrSequenceType = GetArrayOrSequenceType($type);
if ($arrayOrSequenceType) {
+ if (IsWillBeGarbageCollectedType($arrayOrSequenceType)) {
+ AddToImplIncludes("V8${arrayOrSequenceType}.h");
+ return "(toMemberNativeArray<${arrayOrSequenceType}, V8${arrayOrSequenceType}>($value, $argIndexOrZero, $getIsolate))";
+ }
if (IsRefPtrType($arrayOrSequenceType)) {
AddToImplIncludes("V8${arrayOrSequenceType}.h");
return "(toRefPtrNativeArray<${arrayOrSequenceType}, V8${arrayOrSequenceType}>($value, $argIndexOrZero, $getIsolate))";

Powered by Google App Engine
This is Rietveld 408576698