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

Unified Diff: Source/platform/heap/CallbackStack.cpp

Issue 1262993002: Remove unused CallbackStack::swap() method. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/heap/CallbackStack.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/CallbackStack.cpp
diff --git a/Source/platform/heap/CallbackStack.cpp b/Source/platform/heap/CallbackStack.cpp
index f5a6cd072fc2d7e1346a6044ae1fd125f65b1309..7f1b7bdd60522c8002ac5c51d9edd20d371eb1e6 100644
--- a/Source/platform/heap/CallbackStack.cpp
+++ b/Source/platform/heap/CallbackStack.cpp
@@ -5,14 +5,12 @@
#include "config.h"
#include "platform/heap/CallbackStack.h"
-#include "platform/heap/Heap.h"
-
namespace blink {
void CallbackStack::Block::clear()
{
m_current = &m_buffer[0];
- m_next = 0;
+ m_next = nullptr;
clearUnused();
}
@@ -54,8 +52,8 @@ CallbackStack::~CallbackStack()
{
clear();
delete m_first;
- m_first = 0;
- m_last = 0;
+ m_first = nullptr;
+ m_last = nullptr;
}
void CallbackStack::clear()
@@ -86,13 +84,13 @@ CallbackStack::Item* CallbackStack::popSlow()
ASSERT(m_first->isEmptyBlock());
for (;;) {
- if (hasJustOneBlock()) {
+ Block* next = m_first->next();
+ if (!next) {
#if ENABLE(ASSERT)
m_first->clear();
#endif
- return 0;
+ return nullptr;
}
- Block* next = m_first->next();
delete m_first;
m_first = next;
if (Item* item = m_first->pop())
@@ -109,8 +107,8 @@ void CallbackStack::invokeEphemeronCallbacks(Visitor* visitor)
// has been prepended to the chain. This will be very rare, but we can
// handle the situation by starting again and calling all the callbacks
// on the prepended blocks.
- Block* from = 0;
- Block* upto = 0;
+ Block* from = nullptr;
+ Block* upto = nullptr;
while (from != m_first) {
upto = from;
from = m_first;
@@ -133,16 +131,6 @@ bool CallbackStack::hasJustOneBlock() const
return !m_first->next();
}
-void CallbackStack::swap(CallbackStack* other)
-{
- Block* tmp = m_first;
- m_first = other->m_first;
- other->m_first = tmp;
- tmp = m_last;
- m_last = other->m_last;
- other->m_last = tmp;
-}
-
#if ENABLE(ASSERT)
bool CallbackStack::hasCallbackForObject(const void* object)
{
« no previous file with comments | « Source/platform/heap/CallbackStack.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698