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

Side by Side Diff: Source/core/scripts/make_names.pl

Issue 23684014: Crash direct wrapping media element when media isn't enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/media/media-disable-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/perl -w 1 #!/usr/bin/perl -w
2 2
3 # Copyright (C) 2005, 2006, 2007, 2009 Apple Inc. All rights reserved. 3 # Copyright (C) 2005, 2006, 2007, 2009 Apple Inc. All rights reserved.
4 # Copyright (C) 2009, Julien Chaffraix <jchaffraix@webkit.org> 4 # Copyright (C) 2009, Julien Chaffraix <jchaffraix@webkit.org>
5 # Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmob ile.com/) 5 # Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmob ile.com/)
6 # Copyright (C) 2011 Ericsson AB. All rights reserved. 6 # Copyright (C) 2011 Ericsson AB. All rights reserved.
7 # 7 #
8 # Redistribution and use in source and binary forms, with or without 8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions 9 # modification, are permitted provided that the following conditions
10 # are met: 10 # are met:
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 my $conditionalString = "ENABLE(" . join(") && ENABLE(", split(/&/, $conditional)) . ")"; 974 my $conditionalString = "ENABLE(" . join(") && ENABLE(", split(/&/, $conditional)) . ")";
975 print F "#if ${conditionalString}\n\n"; 975 print F "#if ${conditionalString}\n\n";
976 } 976 }
977 977
978 if ($enabledTags{$tagName}{wrapperOnlyIfMediaIsAvailable}) { 978 if ($enabledTags{$tagName}{wrapperOnlyIfMediaIsAvailable}) {
979 print F <<END 979 print F <<END
980 static v8::Handle<v8::Object> create${JSInterfaceName}Wrapper($parameters{namesp ace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isola te) 980 static v8::Handle<v8::Object> create${JSInterfaceName}Wrapper($parameters{namesp ace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isola te)
981 { 981 {
982 Settings* settings = element->document().settings(); 982 Settings* settings = element->document().settings();
983 if (!RuntimeEnabledFeatures::mediaEnabled() || (settings && !settings->media Enabled())) 983 if (!RuntimeEnabledFeatures::mediaEnabled() || (settings && !settings->media Enabled()))
984 return createV8$parameters{namespace}DirectWrapper(element, creationCont ext, isolate); 984 return createV8$parameters{namespace}FallbackWrapper(to$parameters{fallb ackInterfaceName}(element), creationContext, isolate);
985 return wrap(static_cast<${JSInterfaceName}*>(element), creationContext, isol ate); 985 return wrap(static_cast<${JSInterfaceName}*>(element), creationContext, isol ate);
986 } 986 }
987 987
988 END 988 END
989 ; 989 ;
990 } elsif ($enabledTags{$tagName}{contextConditional}) { 990 } elsif ($enabledTags{$tagName}{contextConditional}) {
991 my $contextConditional = $enabledTags{$tagName}{contextConditional}; 991 my $contextConditional = $enabledTags{$tagName}{contextConditional};
992 print F <<END 992 print F <<END
993 static v8::Handle<v8::Object> create${JSInterfaceName}Wrapper($parameters{namesp ace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isola te) 993 static v8::Handle<v8::Object> create${JSInterfaceName}Wrapper($parameters{namesp ace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isola te)
994 { 994 {
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 print F StaticString::GenerateStringImpls(\%parameters); 1283 print F StaticString::GenerateStringImpls(\%parameters);
1284 1284
1285 while ( my ($name, $identifier) = each %parameters ) { 1285 while ( my ($name, $identifier) = each %parameters ) {
1286 print F " new ((void*)&$name) AtomicString(${name}Impl);\n"; 1286 print F " new ((void*)&$name) AtomicString(${name}Impl);\n";
1287 } 1287 }
1288 1288
1289 print F "}\n}\n}\n"; 1289 print F "}\n}\n}\n";
1290 close F; 1290 close F;
1291 exit 0; 1291 exit 0;
1292 } 1292 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/media/media-disable-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698