| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "platform/WebThreadSupportingGC.h" | 5 #include "platform/WebThreadSupportingGC.h" |
| 6 | 6 |
| 7 #include <memory> |
| 7 #include "platform/heap/SafePoint.h" | 8 #include "platform/heap/SafePoint.h" |
| 8 #include "public/platform/WebScheduler.h" | 9 #include "public/platform/WebScheduler.h" |
| 9 #include "wtf/PtrUtil.h" | 10 #include "wtf/PtrUtil.h" |
| 10 #include "wtf/Threading.h" | 11 #include "wtf/Threading.h" |
| 11 #include <memory> | |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 std::unique_ptr<WebThreadSupportingGC> WebThreadSupportingGC::create( | 15 std::unique_ptr<WebThreadSupportingGC> WebThreadSupportingGC::create( |
| 16 const char* name) { | 16 const char* name) { |
| 17 return WTF::wrapUnique(new WebThreadSupportingGC(name, nullptr)); | 17 return WTF::wrapUnique(new WebThreadSupportingGC(name, nullptr)); |
| 18 } | 18 } |
| 19 | 19 |
| 20 std::unique_ptr<WebThreadSupportingGC> WebThreadSupportingGC::createForThread( | 20 std::unique_ptr<WebThreadSupportingGC> WebThreadSupportingGC::createForThread( |
| 21 WebThread* thread) { | 21 WebThread* thread) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 // Shutdown the thread (via its scheduler) only when the thread is created | 58 // Shutdown the thread (via its scheduler) only when the thread is created |
| 59 // and is owned by this instance. | 59 // and is owned by this instance. |
| 60 if (m_owningThread) | 60 if (m_owningThread) |
| 61 m_owningThread->scheduler()->shutdown(); | 61 m_owningThread->scheduler()->shutdown(); |
| 62 | 62 |
| 63 ThreadState::detachCurrentThread(); | 63 ThreadState::detachCurrentThread(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace blink | 66 } // namespace blink |
| OLD | NEW |