| OLD | NEW |
| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 unsigned hash() { return IntHash<int>::hash(m_x); } | 70 unsigned hash() { return IntHash<int>::hash(m_x); } |
| 71 | 71 |
| 72 IntWrapper(int x) : m_x(x) { } | 72 IntWrapper(int x) : m_x(x) { } |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 IntWrapper(); | 75 IntWrapper(); |
| 76 int m_x; | 76 int m_x; |
| 77 }; | 77 }; |
| 78 static_assert(WTF::NeedsTracing<IntWrapper>::value, "NeedsTracing macro failed t
o recognize trace method."); | 78 static_assert(WTF::NeedsTracing<IntWrapper>::value, "NeedsTracing macro failed t
o recognize trace method."); |
| 79 | 79 |
| 80 struct SameSizeAsPersistent { |
| 81 void* m_pointer[4]; |
| 82 }; |
| 83 |
| 84 static_assert(sizeof(Persistent<IntWrapper>) <= sizeof(SameSizeAsPersistent), "P
ersistent handle should stay small"); |
| 85 |
| 80 class ThreadMarker { | 86 class ThreadMarker { |
| 81 public: | 87 public: |
| 82 ThreadMarker() : m_creatingThread(reinterpret_cast<ThreadState*>(0)), m_num(
0) { } | 88 ThreadMarker() : m_creatingThread(reinterpret_cast<ThreadState*>(0)), m_num(
0) { } |
| 83 ThreadMarker(unsigned i) : m_creatingThread(ThreadState::current()), m_num(i
) { } | 89 ThreadMarker(unsigned i) : m_creatingThread(ThreadState::current()), m_num(i
) { } |
| 84 ThreadMarker(WTF::HashTableDeletedValueType deleted) : m_creatingThread(rein
terpret_cast<ThreadState*>(-1)), m_num(0) { } | 90 ThreadMarker(WTF::HashTableDeletedValueType deleted) : m_creatingThread(rein
terpret_cast<ThreadState*>(-1)), m_num(0) { } |
| 85 ~ThreadMarker() | 91 ~ThreadMarker() |
| 86 { | 92 { |
| 87 EXPECT_TRUE((m_creatingThread == ThreadState::current()) | 93 EXPECT_TRUE((m_creatingThread == ThreadState::current()) |
| 88 || (m_creatingThread == reinterpret_cast<ThreadState*>(0)) | 94 || (m_creatingThread == reinterpret_cast<ThreadState*>(0)) |
| 89 || (m_creatingThread == reinterpret_cast<ThreadState*>(-1))); | 95 || (m_creatingThread == reinterpret_cast<ThreadState*>(-1))); |
| (...skipping 6029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6119 { | 6125 { |
| 6120 Persistent<ClassWithMember> object = ClassWithMember::create(); | 6126 Persistent<ClassWithMember> object = ClassWithMember::create(); |
| 6121 EXPECT_EQ(0, object->traceCount()); | 6127 EXPECT_EQ(0, object->traceCount()); |
| 6122 TestMixinAllocatingObject* mixin = TestMixinAllocatingObject::create(object.
get()); | 6128 TestMixinAllocatingObject* mixin = TestMixinAllocatingObject::create(object.
get()); |
| 6123 EXPECT_TRUE(mixin); | 6129 EXPECT_TRUE(mixin); |
| 6124 EXPECT_GT(object->traceCount(), 0); | 6130 EXPECT_GT(object->traceCount(), 0); |
| 6125 EXPECT_GT(mixin->traceCount(), 0); | 6131 EXPECT_GT(mixin->traceCount(), 0); |
| 6126 } | 6132 } |
| 6127 | 6133 |
| 6128 } // namespace blink | 6134 } // namespace blink |
| OLD | NEW |