| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/heap/CallbackStack.h" | 5 #include "platform/heap/CallbackStack.h" |
| 6 #include "wtf/PtrUtil.h" | 6 #include "wtf/PtrUtil.h" |
| 7 #include "wtf/allocator/PageAllocator.h" | 7 #include "wtf/allocator/PageAllocator.h" |
| 8 #include "wtf/allocator/Partitions.h" | 8 #include "wtf/allocator/Partitions.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 for (unsigned i = 0; m_buffer + i < m_current; i++) { | 106 for (unsigned i = 0; m_buffer + i < m_current; i++) { |
| 107 Item* item = &m_buffer[i]; | 107 Item* item = &m_buffer[i]; |
| 108 if (item->object() == object) | 108 if (item->object() == object) |
| 109 return true; | 109 return true; |
| 110 } | 110 } |
| 111 return false; | 111 return false; |
| 112 } | 112 } |
| 113 #endif | 113 #endif |
| 114 | 114 |
| 115 std::unique_ptr<CallbackStack> CallbackStack::create() { | 115 std::unique_ptr<CallbackStack> CallbackStack::create() { |
| 116 return wrapUnique(new CallbackStack()); | 116 return WTF::wrapUnique(new CallbackStack()); |
| 117 } | 117 } |
| 118 | 118 |
| 119 CallbackStack::CallbackStack() : m_first(nullptr), m_last(nullptr) {} | 119 CallbackStack::CallbackStack() : m_first(nullptr), m_last(nullptr) {} |
| 120 | 120 |
| 121 CallbackStack::~CallbackStack() { | 121 CallbackStack::~CallbackStack() { |
| 122 CHECK(isEmpty()); | 122 CHECK(isEmpty()); |
| 123 m_first = nullptr; | 123 m_first = nullptr; |
| 124 m_last = nullptr; | 124 m_last = nullptr; |
| 125 } | 125 } |
| 126 | 126 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 bool CallbackStack::hasCallbackForObject(const void* object) { | 209 bool CallbackStack::hasCallbackForObject(const void* object) { |
| 210 for (Block* current = m_first; current; current = current->next()) { | 210 for (Block* current = m_first; current; current = current->next()) { |
| 211 if (current->hasCallbackForObject(object)) | 211 if (current->hasCallbackForObject(object)) |
| 212 return true; | 212 return true; |
| 213 } | 213 } |
| 214 return false; | 214 return false; |
| 215 } | 215 } |
| 216 #endif | 216 #endif |
| 217 | 217 |
| 218 } // namespace blink | 218 } // namespace blink |
| OLD | NEW |