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

Unified Diff: third_party/WebKit/Source/platform/heap/Member.h

Issue 2599533002: Introduce ThreadState::isOnThreadHeap() helper predicate. (Closed)
Patch Set: Created 4 years 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 | « no previous file | third_party/WebKit/Source/platform/heap/ThreadState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/Member.h
diff --git a/third_party/WebKit/Source/platform/heap/Member.h b/third_party/WebKit/Source/platform/heap/Member.h
index 1a6502d571c610b2aec3ab1be2a09378fe5d2fdf..db16863abd315f1af621ae5d0b4b462e9487f732 100644
--- a/third_party/WebKit/Source/platform/heap/Member.h
+++ b/third_party/WebKit/Source/platform/heap/Member.h
@@ -136,12 +136,11 @@ class MemberBase {
// constructor wasn't called.
if (m_creationThreadState) {
// Member should point to objects that belong in the same ThreadHeap.
- DCHECK_EQ(&ThreadState::fromObject(m_raw)->heap(),
- &m_creationThreadState->heap());
+ DCHECK(m_creationThreadState->isOnThreadHeap(m_raw));
// Member should point to objects that belong in the same ThreadHeap.
DCHECK_EQ(&current->heap(), &m_creationThreadState->heap());
} else {
- DCHECK_EQ(&ThreadState::fromObject(m_raw)->heap(), &current->heap());
+ DCHECK(current->isOnThreadHeap(m_raw));
}
}
@@ -361,12 +360,11 @@ class SameThreadCheckedMember : public Member<T> {
// constructor wasn't called.
if (m_creationThreadState) {
// Member should point to objects that belong in the same ThreadHeap.
- CHECK_EQ(&ThreadState::fromObject(this->m_raw)->heap(),
- &m_creationThreadState->heap());
+ CHECK(m_creationThreadState->isOnThreadHeap(this->m_raw));
// Member should point to objects that belong in the same ThreadHeap.
CHECK_EQ(&current->heap(), &m_creationThreadState->heap());
} else {
- CHECK_EQ(&ThreadState::fromObject(this->m_raw)->heap(), &current->heap());
+ CHECK(current->isOnThreadHeap(this->m_raw));
}
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698