| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1387 | 1387 |
| 1388 void ThreadState::registerStaticPersistentNode( | 1388 void ThreadState::registerStaticPersistentNode( |
| 1389 PersistentNode* node, | 1389 PersistentNode* node, |
| 1390 PersistentClearCallback callback) { | 1390 PersistentClearCallback callback) { |
| 1391 #if defined(LEAK_SANITIZER) | 1391 #if defined(LEAK_SANITIZER) |
| 1392 if (m_disabledStaticPersistentsRegistration) | 1392 if (m_disabledStaticPersistentsRegistration) |
| 1393 return; | 1393 return; |
| 1394 #endif | 1394 #endif |
| 1395 | 1395 |
| 1396 ASSERT(!m_staticPersistents.contains(node)); | 1396 ASSERT(!m_staticPersistents.contains(node)); |
| 1397 m_staticPersistents.add(node, callback); | 1397 m_staticPersistents.insert(node, callback); |
| 1398 } | 1398 } |
| 1399 | 1399 |
| 1400 void ThreadState::releaseStaticPersistentNodes() { | 1400 void ThreadState::releaseStaticPersistentNodes() { |
| 1401 HashMap<PersistentNode*, ThreadState::PersistentClearCallback> | 1401 HashMap<PersistentNode*, ThreadState::PersistentClearCallback> |
| 1402 staticPersistents; | 1402 staticPersistents; |
| 1403 staticPersistents.swap(m_staticPersistents); | 1403 staticPersistents.swap(m_staticPersistents); |
| 1404 | 1404 |
| 1405 PersistentRegion* persistentRegion = getPersistentRegion(); | 1405 PersistentRegion* persistentRegion = getPersistentRegion(); |
| 1406 for (const auto& it : staticPersistents) | 1406 for (const auto& it : staticPersistents) |
| 1407 persistentRegion->releasePersistentNode(it.key, it.value); | 1407 persistentRegion->releasePersistentNode(it.key, it.value); |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1781 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, | 1781 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, |
| 1782 BlinkGC::ForcedGC); | 1782 BlinkGC::ForcedGC); |
| 1783 size_t liveObjects = heap().heapStats().markedObjectSize(); | 1783 size_t liveObjects = heap().heapStats().markedObjectSize(); |
| 1784 if (liveObjects == previousLiveObjects) | 1784 if (liveObjects == previousLiveObjects) |
| 1785 break; | 1785 break; |
| 1786 previousLiveObjects = liveObjects; | 1786 previousLiveObjects = liveObjects; |
| 1787 } | 1787 } |
| 1788 } | 1788 } |
| 1789 | 1789 |
| 1790 } // namespace blink | 1790 } // namespace blink |
| OLD | NEW |