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

Side by Side Diff: third_party/WebKit/Source/platform/heap/HeapTest.cpp

Issue 1851383002: Make WTF::IsGarbageCollectedType<> work for GC mixin instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « third_party/WebKit/Source/platform/heap/GarbageCollected.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 DEFINE_INLINE_VIRTUAL_TRACE() 1531 DEFINE_INLINE_VIRTUAL_TRACE()
1532 { 1532 {
1533 SimpleObject::trace(visitor); 1533 SimpleObject::trace(visitor);
1534 Mixin::trace(visitor); 1534 Mixin::trace(visitor);
1535 ++s_traceCount; 1535 ++s_traceCount;
1536 } 1536 }
1537 1537
1538 private: 1538 private:
1539 UseMixin() 1539 UseMixin()
1540 { 1540 {
1541 // Verify that WTF::IsGarbageCollectedType<> works as expected for mixin s.
1542 static_assert(WTF::IsGarbageCollectedType<UseMixin>::value, "IsGarbageCo llectedType<> sanity check failed for GC mixin.");
1541 s_traceCount = 0; 1543 s_traceCount = 0;
1542 } 1544 }
1543 }; 1545 };
1544 1546
1545 int UseMixin::s_traceCount = 0; 1547 int UseMixin::s_traceCount = 0;
1546 1548
1547 class VectorObject { 1549 class VectorObject {
1548 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 1550 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
1549 public: 1551 public:
1550 VectorObject() 1552 VectorObject()
(...skipping 4950 matching lines...) Expand 10 before | Expand all | Expand 10 after
6501 EXPECT_EQ(1u, vector2.size()); 6503 EXPECT_EQ(1u, vector2.size());
6502 // TODO(Oilpan): when Vector.h's contiguous container support no longer disables 6504 // TODO(Oilpan): when Vector.h's contiguous container support no longer disables
6503 // Vector<>s with inline capacity, remove. 6505 // Vector<>s with inline capacity, remove.
6504 #if !defined(ANNOTATE_CONTIGUOUS_CONTAINER) 6506 #if !defined(ANNOTATE_CONTIGUOUS_CONTAINER)
6505 EXPECT_EQ(16u, vector1.capacity()); 6507 EXPECT_EQ(16u, vector1.capacity());
6506 EXPECT_EQ(16u, vector2.capacity()); 6508 EXPECT_EQ(16u, vector2.capacity());
6507 #endif 6509 #endif
6508 } 6510 }
6509 6511
6510 } // namespace blink 6512 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/GarbageCollected.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698