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 "config.h" | 5 #include "config.h" |
6 #include "platform/WebThreadSupportingGC.h" | 6 #include "platform/WebThreadSupportingGC.h" |
7 | 7 |
8 #include "platform/heap/SafePoint.h" | 8 #include "platform/heap/SafePoint.h" |
9 #include "public/platform/WebScheduler.h" | 9 #include "public/platform/WebScheduler.h" |
10 #include "wtf/Threading.h" | 10 #include "wtf/Threading.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 } | 47 } |
48 | 48 |
49 void WebThreadSupportingGC::initialize() | 49 void WebThreadSupportingGC::initialize() |
50 { | 50 { |
51 ThreadState::attach(); | 51 ThreadState::attach(); |
52 m_gcTaskRunner = adoptPtr(new GCTaskRunner(m_thread)); | 52 m_gcTaskRunner = adoptPtr(new GCTaskRunner(m_thread)); |
53 } | 53 } |
54 | 54 |
55 void WebThreadSupportingGC::shutdown() | 55 void WebThreadSupportingGC::shutdown() |
56 { | 56 { |
| 57 #if defined(LEAK_SANITIZER) |
| 58 ThreadState::current()->releaseStaticPersistentNodes(); |
| 59 #endif |
57 // Ensure no posted tasks will run from this point on. | 60 // Ensure no posted tasks will run from this point on. |
58 m_gcTaskRunner.clear(); | 61 m_gcTaskRunner.clear(); |
59 | 62 |
60 // Shutdown the thread (via its scheduler) only when the thread is created | 63 // Shutdown the thread (via its scheduler) only when the thread is created |
61 // and is owned by this instance. | 64 // and is owned by this instance. |
62 if (m_owningThread) | 65 if (m_owningThread) |
63 m_owningThread->scheduler()->shutdown(); | 66 m_owningThread->scheduler()->shutdown(); |
64 | 67 |
65 ThreadState::detach(); | 68 ThreadState::detach(); |
66 } | 69 } |
67 | 70 |
68 } // namespace blink | 71 } // namespace blink |
OLD | NEW |