Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: third_party/WebKit/Source/platform/exported/Platform.cpp

Issue 1910253003: PartitionAllocMemoryDumpProvider can directly inherit from MemoryDumpProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 WTF::initialize(callOnMainThreadFunction); 92 WTF::initialize(callOnMainThreadFunction);
93 93
94 ProcessHeap::init(); 94 ProcessHeap::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 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvide r(PartitionAllocMemoryDumpProvider::instance(), "PartitionAlloc", base::ThreadTa skRunnerHandle::Get());
103 s_platform->registerMemoryDumpProvider(FontCacheMemoryDumpProvider::inst ance(), "FontCaches"); 103 s_platform->registerMemoryDumpProvider(FontCacheMemoryDumpProvider::inst ance(), "FontCaches");
104 } 104 }
105 105
106 CompositorFactory::initializeDefault(); 106 CompositorFactory::initializeDefault();
107 } 107 }
108 108
109 void Platform::shutdown() 109 void Platform::shutdown()
110 { 110 {
111 ASSERT(isMainThread()); 111 ASSERT(isMainThread());
112 CompositorFactory::shutdown(); 112 CompositorFactory::shutdown();
113 113
114 if (s_platform->m_mainThread) { 114 if (s_platform->m_mainThread) {
115 s_platform->unregisterMemoryDumpProvider(FontCacheMemoryDumpProvider::in stance()); 115 s_platform->unregisterMemoryDumpProvider(FontCacheMemoryDumpProvider::in stance());
116 s_platform->unregisterMemoryDumpProvider(PartitionAllocMemoryDumpProvide r::instance()); 116 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvi der(PartitionAllocMemoryDumpProvider::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 ProcessHeap::shutdown(); 126 ProcessHeap::shutdown();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698