| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 } | 81 } |
| 82 | 82 |
| 83 void Platform::initialize(Platform* platform) | 83 void Platform::initialize(Platform* platform) |
| 84 { | 84 { |
| 85 ASSERT(!s_platform); | 85 ASSERT(!s_platform); |
| 86 ASSERT(platform); | 86 ASSERT(platform); |
| 87 s_platform = platform; | 87 s_platform = platform; |
| 88 s_platform->m_mainThread = platform->currentThread(); | 88 s_platform->m_mainThread = platform->currentThread(); |
| 89 | 89 |
| 90 WTF::Partitions::initialize(maxObservedSizeFunction); | 90 WTF::Partitions::initialize(maxObservedSizeFunction); |
| 91 WTF::initialize(); | 91 WTF::initialize(callOnMainThreadFunction); |
| 92 WTF::initializeMainThread(callOnMainThreadFunction); | |
| 93 | 92 |
| 94 Heap::init(); | 93 Heap::init(); |
| 95 | 94 |
| 96 ThreadState::attachMainThread(); | 95 ThreadState::attachMainThread(); |
| 97 | 96 |
| 98 // TODO(ssid): remove this check after fixing crbug.com/486782. | 97 // TODO(ssid): remove this check after fixing crbug.com/486782. |
| 99 if (s_platform->m_mainThread) { | 98 if (s_platform->m_mainThread) { |
| 100 ASSERT(!s_gcTaskRunner); | 99 ASSERT(!s_gcTaskRunner); |
| 101 s_gcTaskRunner = new GCTaskRunner(s_platform->m_mainThread); | 100 s_gcTaskRunner = new GCTaskRunner(s_platform->m_mainThread); |
| 102 s_platform->registerMemoryDumpProvider(PartitionAllocMemoryDumpProvider:
:instance(), "PartitionAlloc"); | 101 s_platform->registerMemoryDumpProvider(PartitionAllocMemoryDumpProvider:
:instance(), "PartitionAlloc"); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 ProviderToAdapterMap::iterator it = memoryDumpProviders().find(provider); | 171 ProviderToAdapterMap::iterator it = memoryDumpProviders().find(provider); |
| 173 if (it == memoryDumpProviders().end()) | 172 if (it == memoryDumpProviders().end()) |
| 174 return; | 173 return; |
| 175 WebMemoryDumpProviderAdapter* adapter = it->value.get(); | 174 WebMemoryDumpProviderAdapter* adapter = it->value.get(); |
| 176 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
adapter); | 175 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
adapter); |
| 177 adapter->set_is_registered(false); | 176 adapter->set_is_registered(false); |
| 178 memoryDumpProviders().remove(it); | 177 memoryDumpProviders().remove(it); |
| 179 } | 178 } |
| 180 | 179 |
| 181 } // namespace blink | 180 } // namespace blink |
| OLD | NEW |