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

Side by Side Diff: Source/bindings/tests/results/V8TestObjectPython.cpp

Issue 203603005: Explicitly mark first 2 args of addEventListener/removeEventListener as optional (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update test result (addEventListener.length now 0, not 2) Created 6 years, 9 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
« no previous file with comments | « Source/bindings/templates/methods.cpp ('k') | Source/core/core.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 5350 matching lines...) Expand 10 before | Expand all | Expand 10 after
5361 5361
5362 static void voidMethodDictionaryArgMethodCallback(const v8::FunctionCallbackInfo <v8::Value>& info) 5362 static void voidMethodDictionaryArgMethodCallback(const v8::FunctionCallbackInfo <v8::Value>& info)
5363 { 5363 {
5364 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5364 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5365 TestObjectPythonV8Internal::voidMethodDictionaryArgMethod(info); 5365 TestObjectPythonV8Internal::voidMethodDictionaryArgMethod(info);
5366 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5366 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5367 } 5367 }
5368 5368
5369 static void voidMethodEventListenerArgMethod(const v8::FunctionCallbackInfo<v8:: Value>& info) 5369 static void voidMethodEventListenerArgMethod(const v8::FunctionCallbackInfo<v8:: Value>& info)
5370 { 5370 {
5371 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodE ventListenerArg", "TestObjectPython", info.Holder(), info.GetIsolate());
5371 if (UNLIKELY(info.Length() < 1)) { 5372 if (UNLIKELY(info.Length() < 1)) {
5372 throwTypeError(ExceptionMessages::failedToExecute("voidMethodEventListen erArg", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length ())), info.GetIsolate()); 5373 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
5374 exceptionState.throwIfNeeded();
5373 return; 5375 return;
5374 } 5376 }
5375 TestObjectPython* impl = V8TestObjectPython::toNative(info.Holder()); 5377 TestObjectPython* impl = V8TestObjectPython::toNative(info.Holder());
5376 RefPtr<EventListener> eventListenerArg = V8EventListenerList::getEventListen er(info[1], false, ListenerFindOrCreate); 5378 RefPtr<EventListener> eventListenerArg = V8EventListenerList::getEventListen er(info[1], false, ListenerFindOrCreate);
5377 impl->voidMethodEventListenerArg(eventListenerArg); 5379 impl->voidMethodEventListenerArg(eventListenerArg);
5380 if (listener && !impl->toNode())
5381 removeHiddenValueFromArray(info.Holder(), info[1], V8TestObjectPython::e ventListenerCacheIndex, info.GetIsolate());
5378 } 5382 }
5379 5383
5380 static void voidMethodEventListenerArgMethodCallback(const v8::FunctionCallbackI nfo<v8::Value>& info) 5384 static void voidMethodEventListenerArgMethodCallback(const v8::FunctionCallbackI nfo<v8::Value>& info)
5381 { 5385 {
5382 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5386 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5383 TestObjectPythonV8Internal::voidMethodEventListenerArgMethod(info); 5387 TestObjectPythonV8Internal::voidMethodEventListenerArgMethod(info);
5384 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5388 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5385 } 5389 }
5386 5390
5387 static void voidMethodNodeFilterArgMethod(const v8::FunctionCallbackInfo<v8::Val ue>& info) 5391 static void voidMethodNodeFilterArgMethod(const v8::FunctionCallbackInfo<v8::Val ue>& info)
(...skipping 2427 matching lines...) Expand 10 before | Expand all | Expand 10 after
7815 fromInternalPointer(object)->deref(); 7819 fromInternalPointer(object)->deref();
7816 } 7820 }
7817 7821
7818 template<> 7822 template<>
7819 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate) 7823 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate)
7820 { 7824 {
7821 return toV8(impl, creationContext, isolate); 7825 return toV8(impl, creationContext, isolate);
7822 } 7826 }
7823 7827
7824 } // namespace WebCore 7828 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/templates/methods.cpp ('k') | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698