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

Side by Side Diff: Source/bindings/scripts/deprecated_code_generator_v8.pm

Issue 18112019: Have Window inherit EventTarget interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> 2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> 4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
5 # Copyright (C) 2006 Apple Computer, Inc. 5 # Copyright (C) 2006 Apple Computer, Inc.
6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. 6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc.
7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved.
9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 # Copyright (C) 2012 Ericsson AB. All rights reserved. 10 # Copyright (C) 2012 Ericsson AB. All rights reserved.
(...skipping 2156 matching lines...) Expand 10 before | Expand all | Expand 10 after
2167 my $code = ""; 2167 my $code = "";
2168 $code .= "#if ${conditionalString}\n\n" if $conditionalString; 2168 $code .= "#if ${conditionalString}\n\n" if $conditionalString;
2169 $code .= "static void ${name}Method${forMainWorldSuffix}(const v8::FunctionC allbackInfo<v8::Value>& args)\n"; 2169 $code .= "static void ${name}Method${forMainWorldSuffix}(const v8::FunctionC allbackInfo<v8::Value>& args)\n";
2170 $code .= "{\n"; 2170 $code .= "{\n";
2171 2171
2172 if ($name eq "addEventListener" || $name eq "removeEventListener") { 2172 if ($name eq "addEventListener" || $name eq "removeEventListener") {
2173 my $lookupType = ($name eq "addEventListener") ? "OrCreate" : "Only"; 2173 my $lookupType = ($name eq "addEventListener") ? "OrCreate" : "Only";
2174 my $passRefPtrHandling = ($name eq "addEventListener") ? "" : ".get()"; 2174 my $passRefPtrHandling = ($name eq "addEventListener") ? "" : ".get()";
2175 my $hiddenDependencyAction = ($name eq "addEventListener") ? "create" : "remove"; 2175 my $hiddenDependencyAction = ($name eq "addEventListener") ? "create" : "remove";
2176 2176
2177 AddToImplIncludes("bindings/v8/BindingSecurity.h");
2177 AddToImplIncludes("bindings/v8/V8EventListenerList.h"); 2178 AddToImplIncludes("bindings/v8/V8EventListenerList.h");
2179 AddToImplIncludes("core/page/DOMWindow.h");
2178 $code .= <<END; 2180 $code .= <<END;
2181 EventTarget* impl = ${v8ClassName}::toNative(args.Holder());
2182 if (DOMWindow* window = impl->toDOMWindow()) {
2183 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame()))
2184 return;
2185
2186 if (!window->document())
2187 return;
2188 }
2189
2179 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(args[ 1], false, ListenerFind${lookupType}); 2190 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(args[ 1], false, ListenerFind${lookupType});
2180 if (listener) { 2191 if (listener) {
2181 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, st ringResource, args[0]); 2192 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, st ringResource, args[0]);
2182 ${v8ClassName}::toNative(args.Holder())->${implName}(stringResource, lis tener${passRefPtrHandling}, args[2]->BooleanValue()); 2193 impl->${implName}(stringResource, listener${passRefPtrHandling}, args[2] ->BooleanValue());
2183 END 2194 END
2184 if (!InheritsInterface($interface, "Node")) { 2195 if (!InheritsInterface($interface, "Node")) {
2185 $code .= <<END; 2196 $code .= <<END;
2186 ${hiddenDependencyAction}HiddenDependency(args.Holder(), args[1], ${v8Cl assName}::eventListenerCacheIndex, args.GetIsolate()); 2197 ${hiddenDependencyAction}HiddenDependency(args.Holder(), args[1], ${v8Cl assName}::eventListenerCacheIndex, args.GetIsolate());
2187 END 2198 END
2188 } 2199 }
2189 $code .= <<END; 2200 $code .= <<END;
2190 } 2201 }
2191 } 2202 }
2192 2203
(...skipping 3880 matching lines...) Expand 10 before | Expand all | Expand 10 after
6073 if ($currentInterface->extendedAttributes->{$extendedAttribute}) { 6084 if ($currentInterface->extendedAttributes->{$extendedAttribute}) {
6074 $found = 1; 6085 $found = 1;
6075 } 6086 }
6076 return 1 if $found; 6087 return 1 if $found;
6077 }, 0); 6088 }, 0);
6078 6089
6079 return $found; 6090 return $found;
6080 } 6091 }
6081 6092
6082 1; 6093 1;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698