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

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: WIP 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
« no previous file with comments | « no previous file | Source/bindings/v8/V8Binding.h » ('j') | Source/modules/mediastream/MediaDeviceInfo.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8156add23434ce619e4a4b83634d9a5e23632014..0c0556f8bf6e46087848c6ea31c1c8b9be4afc01 100644
--- a/Source/bindings/scripts/code_generator_v8.pm
+++ b/Source/bindings/scripts/code_generator_v8.pm
@@ -5429,6 +5429,7 @@ sub GetNativeType
my $type = shift;
my $extendedAttributes = shift;
my $isParameter = shift;
+ my $isMember = shift;
my $svgNativeType = GetSVGTypeNeedingTearOff($type);
if ($svgNativeType) {
@@ -5479,7 +5480,11 @@ sub GetNativeType
if ($isParameter) {
return "$implClassName*";
} elsif (IsWillBeGarbageCollectedType($interface->name)) {
- return "RefPtrWillBeRawPtr<$implClassName>";
+ if ($isMember) {
+ return "RefPtrWillBeMember<$implClassName>";
Nils Barth (inactive) 2014/02/26 07:17:54 Keishi, could you please add a test case? Since t
keishi 2014/02/27 07:33:34 I'm not sure if it is right but I've added a test.
Nils Barth (inactive) 2014/02/27 11:20:53 Thanks, looks generally ok; I'll take a closer loo
Nils Barth (inactive) 2014/03/03 02:47:53 Current test case looks ok, but you need one more
+ } else {
+ return "RefPtrWillBeRawPtr<$implClassName>";
+ }
} else {
return "RefPtr<$implClassName>";
}
@@ -5489,9 +5494,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
@@ -5508,6 +5519,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;
}
@@ -5616,6 +5628,10 @@ sub JSValueToNative
my $arrayOrSequenceType = GetArrayOrSequenceType($type);
if ($arrayOrSequenceType) {
+ if (IsWillBeGarbageCollectedType($arrayOrSequenceType)) {
+ AddToImplIncludes("V8${arrayOrSequenceType}.h");
+ return "(toRefPtrWillBeMemberNativeArray<${arrayOrSequenceType}, V8${arrayOrSequenceType}>($value, $argIndexOrZero, $getIsolate))";
haraken 2014/02/26 13:58:37 Still I don't fully understand why we need toRefPt
keishi 2014/02/27 07:33:34 I misunderstood. Done.
+ }
if (IsRefPtrType($arrayOrSequenceType)) {
AddToImplIncludes("V8${arrayOrSequenceType}.h");
return "(toRefPtrNativeArray<${arrayOrSequenceType}, V8${arrayOrSequenceType}>($value, $argIndexOrZero, $getIsolate))";
« no previous file with comments | « no previous file | Source/bindings/v8/V8Binding.h » ('j') | Source/modules/mediastream/MediaDeviceInfo.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698