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

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

Issue 2835633002: Add more checks to diagnose MediaQuerySet issue (Closed)
Patch Set: added comment 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/HeapPage.h
diff --git a/third_party/WebKit/Source/platform/heap/HeapPage.h b/third_party/WebKit/Source/platform/heap/HeapPage.h
index 43019c6299e57537d1a05d14f7644581254f666b..8b8e6e0ea9c5914cfc0a7842143426d5aeada4bf 100644
--- a/third_party/WebKit/Source/platform/heap/HeapPage.h
+++ b/third_party/WebKit/Source/platform/heap/HeapPage.h
@@ -241,6 +241,9 @@ class PLATFORM_EXPORT HeapObjectHeader {
// understand, and is public.
static void CheckFromPayload(const void*);
+ // Returns true if magic number is valid.
+ bool IsValid() const;
+
static const uint32_t kZappedMagic = 0xDEAD4321;
protected:
@@ -854,10 +857,17 @@ NO_SANITIZE_ADDRESS inline size_t HeapObjectHeader::size() const {
return result;
}
+NO_SANITIZE_ADDRESS inline bool HeapObjectHeader::IsValid() const {
+#if CPU(64BIT)
+ return GetMagic() == magic_;
+#else
+ return true;
+#endif
+}
+
NO_SANITIZE_ADDRESS inline void HeapObjectHeader::CheckHeader() const {
#if CPU(64BIT)
- const bool good_magic = GetMagic() == magic_;
- DCHECK(good_magic);
+ DCHECK(IsValid());
#endif
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698