| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 void Platform::initialize(Platform* platform) | 84 void Platform::initialize(Platform* platform) |
| 85 { | 85 { |
| 86 ASSERT(!s_platform); | 86 ASSERT(!s_platform); |
| 87 ASSERT(platform); | 87 ASSERT(platform); |
| 88 s_platform = platform; | 88 s_platform = platform; |
| 89 s_platform->m_mainThread = platform->currentThread(); | 89 s_platform->m_mainThread = platform->currentThread(); |
| 90 | 90 |
| 91 WTF::Partitions::initialize(maxObservedSizeFunction); | 91 WTF::Partitions::initialize(maxObservedSizeFunction); |
| 92 WTF::initialize(callOnMainThreadFunction); | 92 WTF::initialize(callOnMainThreadFunction); |
| 93 | 93 |
| 94 Heap::init(); | 94 ThreadHeap::init(); |
| 95 | 95 |
| 96 ThreadState::attachMainThread(); | 96 ThreadState::attachMainThread(); |
| 97 | 97 |
| 98 // TODO(ssid): remove this check after fixing crbug.com/486782. | 98 // TODO(ssid): remove this check after fixing crbug.com/486782. |
| 99 if (s_platform->m_mainThread) { | 99 if (s_platform->m_mainThread) { |
| 100 ASSERT(!s_gcTaskRunner); | 100 ASSERT(!s_gcTaskRunner); |
| 101 s_gcTaskRunner = new GCTaskRunner(s_platform->m_mainThread); | 101 s_gcTaskRunner = new GCTaskRunner(s_platform->m_mainThread); |
| 102 s_platform->registerMemoryDumpProvider(PartitionAllocMemoryDumpProvider:
:instance(), "PartitionAlloc"); | 102 s_platform->registerMemoryDumpProvider(PartitionAllocMemoryDumpProvider:
:instance(), "PartitionAlloc"); |
| 103 s_platform->registerMemoryDumpProvider(FontCacheMemoryDumpProvider::inst
ance(), "FontCaches"); | 103 s_platform->registerMemoryDumpProvider(FontCacheMemoryDumpProvider::inst
ance(), "FontCaches"); |
| 104 } | 104 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 116 s_platform->unregisterMemoryDumpProvider(PartitionAllocMemoryDumpProvide
r::instance()); | 116 s_platform->unregisterMemoryDumpProvider(PartitionAllocMemoryDumpProvide
r::instance()); |
| 117 ASSERT(s_gcTaskRunner); | 117 ASSERT(s_gcTaskRunner); |
| 118 delete s_gcTaskRunner; | 118 delete s_gcTaskRunner; |
| 119 s_gcTaskRunner = nullptr; | 119 s_gcTaskRunner = nullptr; |
| 120 } | 120 } |
| 121 | 121 |
| 122 // Detach the main thread before starting the shutdown sequence | 122 // Detach the main thread before starting the shutdown sequence |
| 123 // so that the main thread won't get involved in a GC during the shutdown. | 123 // so that the main thread won't get involved in a GC during the shutdown. |
| 124 ThreadState::detachMainThread(); | 124 ThreadState::detachMainThread(); |
| 125 | 125 |
| 126 Heap::shutdown(); | 126 ThreadHeap::shutdown(); |
| 127 | 127 |
| 128 WTF::shutdown(); | 128 WTF::shutdown(); |
| 129 WTF::Partitions::shutdown(); | 129 WTF::Partitions::shutdown(); |
| 130 | 130 |
| 131 s_platform->m_mainThread = nullptr; | 131 s_platform->m_mainThread = nullptr; |
| 132 s_platform = nullptr; | 132 s_platform = nullptr; |
| 133 } | 133 } |
| 134 | 134 |
| 135 void Platform::setCurrentPlatformForTesting(Platform* platform) | 135 void Platform::setCurrentPlatformForTesting(Platform* platform) |
| 136 { | 136 { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 adapter->set_is_registered(false); | 177 adapter->set_is_registered(false); |
| 178 memoryDumpProviders().remove(it); | 178 memoryDumpProviders().remove(it); |
| 179 } | 179 } |
| 180 | 180 |
| 181 ServiceRegistry* Platform::serviceRegistry() | 181 ServiceRegistry* Platform::serviceRegistry() |
| 182 { | 182 { |
| 183 return ServiceRegistry::getEmptyServiceRegistry(); | 183 return ServiceRegistry::getEmptyServiceRegistry(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 } // namespace blink | 186 } // namespace blink |
| OLD | NEW |