Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp |
| index a6c7caf66d208e3b4b93eb65f7adf0353b770e29..db81be1325c985e9968002de2cc8631867e4d760 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp |
| @@ -46,6 +46,7 @@ V8AbstractEventListener::V8AbstractEventListener(bool isAttribute, DOMWrapperWor |
| : EventListener(JSEventListenerType) |
| , m_isAttribute(isAttribute) |
| , m_world(world) |
| + , m_originWorld(PassRefPtr<DOMWrapperWorld>(world.originWorld())) |
|
haraken
2016/01/21 10:16:15
PassRefPtr<DOMWrapperWorld>() wouldn't be needed.
proberge
2016/01/29 18:00:48
V8AbstractEventListener shouldn't have a RefPtr<DO
|
| , m_isolate(isolate) |
| , m_workerGlobalScope(nullptr) |
| { |
| @@ -91,11 +92,14 @@ void V8AbstractEventListener::handleEvent(ScriptState* scriptState, Event* event |
| RefPtrWillBeRawPtr<V8AbstractEventListener> protect(this); |
| ScriptState::Scope scope(scriptState); |
| + // Ensure the origin world gets propagated to the event and is reset afterwards. |
| + DOMWrapperWorld::OriginWorldPusher worldPusher(scriptState->world(), m_originWorld); |
| // Get the V8 wrapper for the event object. |
| v8::Local<v8::Value> jsEvent = toV8(event, scriptState->context()->Global(), isolate()); |
| if (jsEvent.IsEmpty()) |
| return; |
| + |
| invokeEventHandler(scriptState, event, v8::Local<v8::Value>::New(isolate(), jsEvent)); |
| } |