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

Side by Side Diff: third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp

Issue 2598353002: The second argument of add/removeEventListener should be an object, null, or undefined
Patch Set: Fix tests Created 3 years, 11 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 | « third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp ('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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/inspector/ThreadDebugger.h" 5 #include "core/inspector/ThreadDebugger.h"
6 6
7 #include "bindings/core/v8/SourceLocation.h" 7 #include "bindings/core/v8/SourceLocation.h"
8 #include "bindings/core/v8/V8Binding.h" 8 #include "bindings/core/v8/V8Binding.h"
9 #include "bindings/core/v8/V8DOMException.h" 9 #include "bindings/core/v8/V8DOMException.h"
10 #include "bindings/core/v8/V8DOMTokenList.h" 10 #include "bindings/core/v8/V8DOMTokenList.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 return toDOMWindow(info.GetIsolate(), info[0]); 336 return toDOMWindow(info.GetIsolate(), info[0]);
337 } 337 }
338 338
339 void ThreadDebugger::setMonitorEventsCallback( 339 void ThreadDebugger::setMonitorEventsCallback(
340 const v8::FunctionCallbackInfo<v8::Value>& info, 340 const v8::FunctionCallbackInfo<v8::Value>& info,
341 bool enabled) { 341 bool enabled) {
342 EventTarget* eventTarget = firstArgumentAsEventTarget(info); 342 EventTarget* eventTarget = firstArgumentAsEventTarget(info);
343 if (!eventTarget) 343 if (!eventTarget)
344 return; 344 return;
345 Vector<String> types = normalizeEventTypes(info); 345 Vector<String> types = normalizeEventTypes(info);
346 NonThrowableExceptionState exceptionState;
346 EventListener* eventListener = V8EventListenerHelper::getEventListener( 347 EventListener* eventListener = V8EventListenerHelper::getEventListener(
347 ScriptState::current(info.GetIsolate()), 348 ScriptState::current(info.GetIsolate()),
348 v8::Local<v8::Function>::Cast(info.Data()), false, 349 v8::Local<v8::Function>::Cast(info.Data()), false,
349 enabled ? ListenerFindOrCreate : ListenerFindOnly); 350 enabled ? ListenerFindOrCreate : ListenerFindOnly, exceptionState);
350 if (!eventListener) 351 if (!eventListener)
351 return; 352 return;
352 for (size_t i = 0; i < types.size(); ++i) { 353 for (size_t i = 0; i < types.size(); ++i) {
353 if (enabled) 354 if (enabled)
354 eventTarget->addEventListener(AtomicString(types[i]), eventListener, 355 eventTarget->addEventListener(AtomicString(types[i]), eventListener,
355 false); 356 false);
356 else 357 else
357 eventTarget->removeEventListener(AtomicString(types[i]), eventListener, 358 eventTarget->removeEventListener(AtomicString(types[i]), eventListener,
358 false); 359 false);
359 } 360 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 void ThreadDebugger::onTimer(TimerBase* timer) { 482 void ThreadDebugger::onTimer(TimerBase* timer) {
482 for (size_t index = 0; index < m_timers.size(); ++index) { 483 for (size_t index = 0; index < m_timers.size(); ++index) {
483 if (m_timers[index].get() == timer) { 484 if (m_timers[index].get() == timer) {
484 m_timerCallbacks[index](m_timerData[index]); 485 m_timerCallbacks[index](m_timerData[index]);
485 return; 486 return;
486 } 487 }
487 } 488 }
488 } 489 }
489 490
490 } // namespace blink 491 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698