| OLD | NEW |
| 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/workers/ParentFrameTaskRunners.h" | 5 #include "core/workers/ParentFrameTaskRunners.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
| 9 #include "public/platform/Platform.h" | 9 #include "public/platform/Platform.h" |
| 10 #include "wtf/Assertions.h" | 10 #include "wtf/Assertions.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 RefPtr<WebTaskRunner> ParentFrameTaskRunners::get(TaskType type) { | 28 RefPtr<WebTaskRunner> ParentFrameTaskRunners::get(TaskType type) { |
| 29 MutexLocker lock(m_taskRunnersMutex); | 29 MutexLocker lock(m_taskRunnersMutex); |
| 30 return m_taskRunners.get(type); | 30 return m_taskRunners.get(type); |
| 31 } | 31 } |
| 32 | 32 |
| 33 DEFINE_TRACE(ParentFrameTaskRunners) { | 33 DEFINE_TRACE(ParentFrameTaskRunners) { |
| 34 ContextLifecycleObserver::trace(visitor); | 34 ContextLifecycleObserver::trace(visitor); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void ParentFrameTaskRunners::contextDestroyed() { | 37 void ParentFrameTaskRunners::contextDestroyed(ExecutionContext*) { |
| 38 MutexLocker lock(m_taskRunnersMutex); | 38 MutexLocker lock(m_taskRunnersMutex); |
| 39 for (auto& entry : m_taskRunners) | 39 for (auto& entry : m_taskRunners) |
| 40 entry.value = Platform::current()->currentThread()->getWebTaskRunner(); | 40 entry.value = Platform::current()->currentThread()->getWebTaskRunner(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 } // namespace blink | 43 } // namespace blink |
| OLD | NEW |