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

Side by Side Diff: third_party/WebKit/Source/platform/heap/Member.h

Issue 2786843002: Make HeapObjectHeader::checkHeader private. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef Member_h 5 #ifndef Member_h
6 #define Member_h 6 #define Member_h
7 7
8 #include "wtf/Allocator.h" 8 #include "wtf/Allocator.h"
9 #include "wtf/HashFunctions.h" 9 #include "wtf/HashFunctions.h"
10 #include "wtf/HashTraits.h" 10 #include "wtf/HashTraits.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // TODO(haraken): What we really want to check here is that the pointer 148 // TODO(haraken): What we really want to check here is that the pointer
149 // is a traceable object. In other words, the pointer is either of: 149 // is a traceable object. In other words, the pointer is either of:
150 // 150 //
151 // (a) a pointer to the head of an on-heap object. 151 // (a) a pointer to the head of an on-heap object.
152 // (b) a pointer to the head of an on-heap mixin object. 152 // (b) a pointer to the head of an on-heap mixin object.
153 // 153 //
154 // We can check it by calling ThreadHeap::isHeapObjectAlive(m_raw), 154 // We can check it by calling ThreadHeap::isHeapObjectAlive(m_raw),
155 // but we cannot call it here because it requires to include T.h. 155 // but we cannot call it here because it requires to include T.h.
156 // So we currently only try to implement the check for (a), but do 156 // So we currently only try to implement the check for (a), but do
157 // not insist that T's definition is in scope. 157 // not insist that T's definition is in scope.
158 if (IsFullyDefined<T>::value && !IsGarbageCollectedMixin<T>::value) 158 if (IsFullyDefined<T>::value && !IsGarbageCollectedMixin<T>::value) {
159 HeapObjectHeader::fromPayload(m_raw)->checkHeader(); 159 // |fromPayload| checks the integrity of the |HeapObjectHeader|.
160 (void)HeapObjectHeader::fromPayload(m_raw);
161 }
160 #endif 162 #endif
161 #endif 163 #endif
162 } 164 }
163 165
164 void saveCreationThreadState() { 166 void saveCreationThreadState() {
165 #if DCHECK_IS_ON() 167 #if DCHECK_IS_ON()
166 if (tracenessConfiguration == TracenessMemberConfiguration::Untraced) { 168 if (tracenessConfiguration == TracenessMemberConfiguration::Untraced) {
167 m_creationThreadState = nullptr; 169 m_creationThreadState = nullptr;
168 } else { 170 } else {
169 m_creationThreadState = ThreadState::current(); 171 m_creationThreadState = ThreadState::current();
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 542
541 template <typename T> 543 template <typename T>
542 struct IsTraceable<blink::TraceWrapperMember<T>> { 544 struct IsTraceable<blink::TraceWrapperMember<T>> {
543 STATIC_ONLY(IsTraceable); 545 STATIC_ONLY(IsTraceable);
544 static const bool value = true; 546 static const bool value = true;
545 }; 547 };
546 548
547 } // namespace WTF 549 } // namespace WTF
548 550
549 #endif // Member_h 551 #endif // Member_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698