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

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

Issue 70963003: IDL compiler: addEventListener, removeEventListener methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revised Created 7 years, 1 month 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
« no previous file with comments | « no previous file | Source/bindings/scripts/unstable/v8_types.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2302 matching lines...) Expand 10 before | Expand all | Expand 10 after
2313 AddToImplIncludes("bindings/v8/V8EventListenerList.h"); 2313 AddToImplIncludes("bindings/v8/V8EventListenerList.h");
2314 AddToImplIncludes("core/frame/DOMWindow.h"); 2314 AddToImplIncludes("core/frame/DOMWindow.h");
2315 $code .= <<END; 2315 $code .= <<END;
2316 EventTarget* impl = ${v8ClassName}::toNative(info.Holder()); 2316 EventTarget* impl = ${v8ClassName}::toNative(info.Holder());
2317 if (DOMWindow* window = impl->toDOMWindow()) { 2317 if (DOMWindow* window = impl->toDOMWindow()) {
2318 ExceptionState es(info.GetIsolate()); 2318 ExceptionState es(info.GetIsolate());
2319 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) { 2319 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) {
2320 es.throwIfNeeded(); 2320 es.throwIfNeeded();
2321 return; 2321 return;
2322 } 2322 }
2323
2324 if (!window->document()) 2323 if (!window->document())
2325 return; 2324 return;
2326 } 2325 }
2327
2328 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[ 1], false, ListenerFind${lookupType}); 2326 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[ 1], false, ListenerFind${lookupType});
2329 if (listener) { 2327 if (listener) {
2330 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, st ringResource, info[0]); 2328 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev entName, info[0]);
2331 impl->${implName}(stringResource, listener${passRefPtrHandling}, info[2] ->BooleanValue()); 2329 impl->${implName}(eventName, listener${passRefPtrHandling}, info[2]->Boo leanValue());
2332 if (!impl->toNode()) 2330 if (!impl->toNode())
2333 ${hiddenDependencyAction}HiddenDependency(info.Holder(), info[1], ${ v8ClassName}::eventListenerCacheIndex, info.GetIsolate()); 2331 ${hiddenDependencyAction}HiddenDependency(info.Holder(), info[1], ${ v8ClassName}::eventListenerCacheIndex, info.GetIsolate());
2334 } 2332 }
2335 } 2333 }
2336 END 2334 END
2337 $code .= "#endif // ${conditionalString}\n" if $conditionalString; 2335 $code .= "#endif // ${conditionalString}\n" if $conditionalString;
2338 $code .= "\n"; 2336 $code .= "\n";
2339 $implementation{nameSpaceInternal}->add($code); 2337 $implementation{nameSpaceInternal}->add($code);
2340 return; 2338 return;
2341 } 2339 }
(...skipping 3930 matching lines...) Expand 10 before | Expand all | Expand 10 after
6272 my $interface = shift; 6270 my $interface = shift;
6273 6271
6274 return 1 if $interface->extendedAttributes->{"CustomToV8"}; 6272 return 1 if $interface->extendedAttributes->{"CustomToV8"};
6275 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"}; 6273 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"};
6276 return 1 if InheritsInterface($interface, "Document"); 6274 return 1 if InheritsInterface($interface, "Document");
6277 6275
6278 return 0; 6276 return 0;
6279 } 6277 }
6280 6278
6281 1; 6279 1;
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/scripts/unstable/v8_types.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698