| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "base/threading/thread_task_runner_handle.h" | 31 #include "base/threading/thread_task_runner_handle.h" |
| 32 #include "base/trace_event/memory_dump_manager.h" | 32 #include "base/trace_event/memory_dump_manager.h" |
| 33 #include "platform/Histogram.h" | 33 #include "platform/Histogram.h" |
| 34 #include "platform/MemoryCacheDumpProvider.h" |
| 34 #include "platform/PartitionAllocMemoryDumpProvider.h" | 35 #include "platform/PartitionAllocMemoryDumpProvider.h" |
| 35 #include "platform/fonts/FontCacheMemoryDumpProvider.h" | 36 #include "platform/fonts/FontCacheMemoryDumpProvider.h" |
| 36 #include "platform/graphics/CompositorFactory.h" | 37 #include "platform/graphics/CompositorFactory.h" |
| 37 #include "platform/heap/BlinkGCMemoryDumpProvider.h" | 38 #include "platform/heap/BlinkGCMemoryDumpProvider.h" |
| 38 #include "platform/heap/GCTaskRunner.h" | 39 #include "platform/heap/GCTaskRunner.h" |
| 39 #include "platform/web_memory_dump_provider_adapter.h" | 40 #include "platform/web_memory_dump_provider_adapter.h" |
| 40 #include "public/platform/Platform.h" | 41 #include "public/platform/Platform.h" |
| 41 #include "public/platform/ServiceRegistry.h" | 42 #include "public/platform/ServiceRegistry.h" |
| 42 #include "public/platform/WebPrerenderingSupport.h" | 43 #include "public/platform/WebPrerenderingSupport.h" |
| 43 #include "wtf/HashMap.h" | 44 #include "wtf/HashMap.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvide
r(BlinkGCMemoryDumpProvider::instance(), "BlinkGC", base::ThreadTaskRunnerHandle
::Get()); | 98 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvide
r(BlinkGCMemoryDumpProvider::instance(), "BlinkGC", base::ThreadTaskRunnerHandle
::Get()); |
| 98 | 99 |
| 99 ThreadState::attachMainThread(); | 100 ThreadState::attachMainThread(); |
| 100 | 101 |
| 101 // TODO(ssid): remove this check after fixing crbug.com/486782. | 102 // TODO(ssid): remove this check after fixing crbug.com/486782. |
| 102 if (s_platform->m_mainThread) { | 103 if (s_platform->m_mainThread) { |
| 103 ASSERT(!s_gcTaskRunner); | 104 ASSERT(!s_gcTaskRunner); |
| 104 s_gcTaskRunner = new GCTaskRunner(s_platform->m_mainThread); | 105 s_gcTaskRunner = new GCTaskRunner(s_platform->m_mainThread); |
| 105 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvide
r(PartitionAllocMemoryDumpProvider::instance(), "PartitionAlloc", base::ThreadTa
skRunnerHandle::Get()); | 106 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvide
r(PartitionAllocMemoryDumpProvider::instance(), "PartitionAlloc", base::ThreadTa
skRunnerHandle::Get()); |
| 106 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvide
r(FontCacheMemoryDumpProvider::instance(), "FontCaches", base::ThreadTaskRunnerH
andle::Get()); | 107 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvide
r(FontCacheMemoryDumpProvider::instance(), "FontCaches", base::ThreadTaskRunnerH
andle::Get()); |
| 108 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvide
r(MemoryCacheDumpProvider::instance(), "MemoryCache", base::ThreadTaskRunnerHand
le::Get()); |
| 107 } | 109 } |
| 108 | 110 |
| 109 CompositorFactory::initializeDefault(); | 111 CompositorFactory::initializeDefault(); |
| 110 } | 112 } |
| 111 | 113 |
| 112 void Platform::shutdown() | 114 void Platform::shutdown() |
| 113 { | 115 { |
| 114 ASSERT(isMainThread()); | 116 ASSERT(isMainThread()); |
| 115 CompositorFactory::shutdown(); | 117 CompositorFactory::shutdown(); |
| 116 | 118 |
| 117 if (s_platform->m_mainThread) { | 119 if (s_platform->m_mainThread) { |
| 118 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvi
der(FontCacheMemoryDumpProvider::instance()); | 120 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvi
der(FontCacheMemoryDumpProvider::instance()); |
| 119 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvi
der(PartitionAllocMemoryDumpProvider::instance()); | 121 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvi
der(PartitionAllocMemoryDumpProvider::instance()); |
| 120 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvi
der(BlinkGCMemoryDumpProvider::instance()); | 122 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvi
der(BlinkGCMemoryDumpProvider::instance()); |
| 123 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvi
der(MemoryCacheDumpProvider::instance()); |
| 121 | 124 |
| 122 ASSERT(s_gcTaskRunner); | 125 ASSERT(s_gcTaskRunner); |
| 123 delete s_gcTaskRunner; | 126 delete s_gcTaskRunner; |
| 124 s_gcTaskRunner = nullptr; | 127 s_gcTaskRunner = nullptr; |
| 125 } | 128 } |
| 126 | 129 |
| 127 // Detach the main thread before starting the shutdown sequence | 130 // Detach the main thread before starting the shutdown sequence |
| 128 // so that the main thread won't get involved in a GC during the shutdown. | 131 // so that the main thread won't get involved in a GC during the shutdown. |
| 129 ThreadState::detachMainThread(); | 132 ThreadState::detachMainThread(); |
| 130 | 133 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 adapter->set_is_registered(false); | 185 adapter->set_is_registered(false); |
| 183 memoryDumpProviders().remove(it); | 186 memoryDumpProviders().remove(it); |
| 184 } | 187 } |
| 185 | 188 |
| 186 ServiceRegistry* Platform::serviceRegistry() | 189 ServiceRegistry* Platform::serviceRegistry() |
| 187 { | 190 { |
| 188 return ServiceRegistry::getEmptyServiceRegistry(); | 191 return ServiceRegistry::getEmptyServiceRegistry(); |
| 189 } | 192 } |
| 190 | 193 |
| 191 } // namespace blink | 194 } // namespace blink |
| OLD | NEW |