| 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 "platform/wtf/Assertions.h" |
| 10 #include "platform/wtf/ThreadingPrimitives.h" |
| 9 #include "public/platform/Platform.h" | 11 #include "public/platform/Platform.h" |
| 10 #include "wtf/Assertions.h" | |
| 11 #include "wtf/ThreadingPrimitives.h" | |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 ParentFrameTaskRunners::ParentFrameTaskRunners(LocalFrame* frame) | 15 ParentFrameTaskRunners::ParentFrameTaskRunners(LocalFrame* frame) |
| 16 : ContextLifecycleObserver(frame ? frame->GetDocument() : nullptr) { | 16 : ContextLifecycleObserver(frame ? frame->GetDocument() : nullptr) { |
| 17 if (frame && frame->GetDocument()) | 17 if (frame && frame->GetDocument()) |
| 18 DCHECK(frame->GetDocument()->IsContextThread()); | 18 DCHECK(frame->GetDocument()->IsContextThread()); |
| 19 | 19 |
| 20 // For now we only support very limited task types. | 20 // For now we only support very limited task types. |
| 21 for (auto type : | 21 for (auto type : |
| (...skipping 13 matching lines...) Expand all Loading... |
| 35 ContextLifecycleObserver::Trace(visitor); | 35 ContextLifecycleObserver::Trace(visitor); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void ParentFrameTaskRunners::ContextDestroyed(ExecutionContext*) { | 38 void ParentFrameTaskRunners::ContextDestroyed(ExecutionContext*) { |
| 39 MutexLocker lock(task_runners_mutex_); | 39 MutexLocker lock(task_runners_mutex_); |
| 40 for (auto& entry : task_runners_) | 40 for (auto& entry : task_runners_) |
| 41 entry.value = Platform::Current()->CurrentThread()->GetWebTaskRunner(); | 41 entry.value = Platform::Current()->CurrentThread()->GetWebTaskRunner(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace blink | 44 } // namespace blink |
| OLD | NEW |