| 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/ThreadedMessagingProxyBase.h" | 5 #include "core/workers/ThreadedMessagingProxyBase.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/SourceLocation.h" | 7 #include "bindings/core/v8/SourceLocation.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/frame/Deprecation.h" | 9 #include "core/frame/Deprecation.h" |
| 10 #include "core/loader/DocumentLoader.h" | 10 #include "core/loader/DocumentLoader.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 void ThreadedMessagingProxyBase::workerThreadCreated() { | 108 void ThreadedMessagingProxyBase::workerThreadCreated() { |
| 109 DCHECK(isParentContextThread()); | 109 DCHECK(isParentContextThread()); |
| 110 DCHECK(!m_askedToTerminate); | 110 DCHECK(!m_askedToTerminate); |
| 111 DCHECK(m_workerThread); | 111 DCHECK(m_workerThread); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void ThreadedMessagingProxyBase::parentObjectDestroyed() { | 114 void ThreadedMessagingProxyBase::parentObjectDestroyed() { |
| 115 DCHECK(isParentContextThread()); | 115 DCHECK(isParentContextThread()); |
| 116 | 116 |
| 117 m_parentFrameTaskRunners->get(TaskType::Internal) | 117 m_parentFrameTaskRunners->get(TaskType::UnspecedTimer) |
| 118 ->postTask( | 118 ->postTask( |
| 119 BLINK_FROM_HERE, | 119 BLINK_FROM_HERE, |
| 120 WTF::bind(&ThreadedMessagingProxyBase::parentObjectDestroyedInternal, | 120 WTF::bind(&ThreadedMessagingProxyBase::parentObjectDestroyedInternal, |
| 121 WTF::unretained(this))); | 121 WTF::unretained(this))); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void ThreadedMessagingProxyBase::parentObjectDestroyedInternal() { | 124 void ThreadedMessagingProxyBase::parentObjectDestroyedInternal() { |
| 125 DCHECK(isParentContextThread()); | 125 DCHECK(isParentContextThread()); |
| 126 m_mayBeDestroyed = true; | 126 m_mayBeDestroyed = true; |
| 127 if (m_workerThread) | 127 if (m_workerThread) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 164 } |
| 165 | 165 |
| 166 bool ThreadedMessagingProxyBase::isParentContextThread() const { | 166 bool ThreadedMessagingProxyBase::isParentContextThread() const { |
| 167 // TODO(nhiroki): Nested worker is not supported yet, so the parent context | 167 // TODO(nhiroki): Nested worker is not supported yet, so the parent context |
| 168 // thread should be equal to the main thread (http://crbug.com/31666). | 168 // thread should be equal to the main thread (http://crbug.com/31666). |
| 169 DCHECK(getExecutionContext()->isDocument()); | 169 DCHECK(getExecutionContext()->isDocument()); |
| 170 return isMainThread(); | 170 return isMainThread(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace blink | 173 } // namespace blink |
| OLD | NEW |