Chromium Code Reviews| Index: Source/core/workers/WorkerEventQueue.cpp |
| diff --git a/Source/core/workers/WorkerEventQueue.cpp b/Source/core/workers/WorkerEventQueue.cpp |
| index a8d52068d62ec21c33eb52c3a305fd15389c5e57..a3e677c3fc5ead4f5e57ab875d676590a61e8509 100644 |
| --- a/Source/core/workers/WorkerEventQueue.cpp |
| +++ b/Source/core/workers/WorkerEventQueue.cpp |
| @@ -72,8 +72,13 @@ public: |
| m_eventQueue->removeEvent(m_event.get()); |
| } |
| - void dispatchEvent(ExecutionContext*, PassRefPtrWillBeRawPtr<Event> event) |
| + void dispatchEvent(ExecutionContext*, PassRefPtrWillBeRawPtr<Event> prpEvent) |
| { |
| + // Stash the event on the stack in a RefPtrWillBeRawPtr; trying to do this |
| + // in a single line causes an optimization bug with MSVC. MSVC generates code |
| + // that passes the event arg (forcing PassRefPtrWillBeRawPtr to be released) |
| + // before the target is queried. |
|
tkent
2015/07/16 00:22:03
Wow, nice detective work.
|
| + RefPtrWillBeRawPtr<Event> event = prpEvent; |
| event->target()->dispatchEvent(event); |
| } |