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

Unified Diff: Source/core/events/EventTarget.cpp

Issue 149803005: Remove isolated world parameters from event listener attributes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/events/EventTarget.h ('k') | Source/modules/webaudio/AudioScheduledSourceNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/EventTarget.cpp
diff --git a/Source/core/events/EventTarget.cpp b/Source/core/events/EventTarget.cpp
index 2b65bb20c0c7d40c3f12406c9184894f4565770a..99ef9227f2564d76dcd9030b3703718fef889d88 100644
--- a/Source/core/events/EventTarget.cpp
+++ b/Source/core/events/EventTarget.cpp
@@ -33,7 +33,6 @@
#include "core/events/EventTarget.h"
#include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/DOMWrapperWorld.h"
#include "bindings/v8/ExceptionState.h"
#include "core/events/Event.h"
#include "core/dom/ExceptionCode.h"
@@ -123,38 +122,28 @@ bool EventTarget::removeEventListener(const AtomicString& eventType, EventListen
return true;
}
-bool EventTarget::setAttributeEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener, DOMWrapperWorld* isolatedWorld)
+bool EventTarget::setAttributeEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener)
{
- clearAttributeEventListener(eventType, isolatedWorld);
+ clearAttributeEventListener(eventType);
if (!listener)
return false;
return addEventListener(eventType, listener, false);
}
-EventListener* EventTarget::getAttributeEventListener(const AtomicString& eventType, DOMWrapperWorld* isolatedWorld)
+EventListener* EventTarget::getAttributeEventListener(const AtomicString& eventType)
{
const EventListenerVector& entry = getEventListeners(eventType);
for (size_t i = 0; i < entry.size(); ++i) {
EventListener* listener = entry[i].listener.get();
- if (listener->isAttribute()) {
- DOMWrapperWorld* listenerWorld = listener->world();
- // Worker listener
- if (!listenerWorld) {
- ASSERT(!isolatedWorld);
- return listener;
- }
- if (listenerWorld->isMainWorld() && !isolatedWorld)
- return listener;
- if (listenerWorld == isolatedWorld)
- return listener;
- }
+ if (listener->isAttribute() && listener->belongsToTheCurrentWorld())
+ return listener;
}
return 0;
}
-bool EventTarget::clearAttributeEventListener(const AtomicString& eventType, DOMWrapperWorld* isolatedWorld)
+bool EventTarget::clearAttributeEventListener(const AtomicString& eventType)
{
- EventListener* listener = getAttributeEventListener(eventType, isolatedWorld);
+ EventListener* listener = getAttributeEventListener(eventType);
if (!listener)
return false;
return removeEventListener(eventType, listener, false);
« no previous file with comments | « Source/core/events/EventTarget.h ('k') | Source/modules/webaudio/AudioScheduledSourceNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698