diff options
author | sigbjornf@opera.com <sigbjornf@opera.com> | 2015-07-30 15:02:27 +0000 |
---|---|---|
committer | sigbjornf@opera.com <sigbjornf@opera.com> | 2015-07-30 15:02:27 +0000 |
commit | 01fa4ef29f43dc4b12fd22a8af87ea0656d276d4 (patch) | |
tree | 635dba7668352caf97d28bcbfaeaa8c836a2a896 | |
parent | 030590f5ced384af7ce6ab9ead2665b9f2c920c6 (diff) | |
download | chromium_src-01fa4ef29f43dc4b12fd22a8af87ea0656d276d4.zip chromium_src-01fa4ef29f43dc4b12fd22a8af87ea0656d276d4.tar.gz chromium_src-01fa4ef29f43dc4b12fd22a8af87ea0656d276d4.tar.bz2 |
Remove unused CallbackStack::swap() method.
R=haraken
BUG=420515
Review URL: https://codereview.chromium.org/1262993002
git-svn-id: svn://svn.chromium.org/blink/trunk@199739 bbb929c8-8fbe-4397-9dbb-9b2b20218538
-rw-r--r-- | third_party/WebKit/Source/platform/heap/CallbackStack.cpp | 28 | ||||
-rw-r--r-- | third_party/WebKit/Source/platform/heap/CallbackStack.h | 8 |
2 files changed, 12 insertions, 24 deletions
diff --git a/third_party/WebKit/Source/platform/heap/CallbackStack.cpp b/third_party/WebKit/Source/platform/heap/CallbackStack.cpp index f5a6cd0..7f1b7bd 100644 --- a/third_party/WebKit/Source/platform/heap/CallbackStack.cpp +++ b/third_party/WebKit/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) { diff --git a/third_party/WebKit/Source/platform/heap/CallbackStack.h b/third_party/WebKit/Source/platform/heap/CallbackStack.h index e7e60ba..0df0354 100644 --- a/third_party/WebKit/Source/platform/heap/CallbackStack.h +++ b/third_party/WebKit/Source/platform/heap/CallbackStack.h @@ -6,6 +6,7 @@ #define CallbackStack_h #include "platform/heap/ThreadState.h" +#include "wtf/Assertions.h" namespace blink { @@ -49,9 +50,9 @@ public: bool hasCallbackForObject(const void*); #endif +private: static const size_t blockSize = 8192; -private: class Block { public: explicit Block(Block* next) @@ -86,13 +87,13 @@ private: { if (LIKELY(m_current < m_limit)) return m_current++; - return 0; + return nullptr; } Item* pop() { if (UNLIKELY(isEmptyBlock())) - return 0; + return nullptr; return --m_current; } @@ -114,7 +115,6 @@ private: Item* allocateEntrySlow(); void invokeOldestCallbacks(Block*, Block*, Visitor*); bool hasJustOneBlock() const; - void swap(CallbackStack* other); Block* m_first; Block* m_last; |