OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 23 matching lines...) Expand all Loading... |
34 #include "wtf/RefCounted.h" | 34 #include "wtf/RefCounted.h" |
35 #include "wtf/RefPtr.h" | 35 #include "wtf/RefPtr.h" |
36 #include "wtf/ThreadRestrictionVerifier.h" | 36 #include "wtf/ThreadRestrictionVerifier.h" |
37 #include "wtf/Vector.h" | 37 #include "wtf/Vector.h" |
38 #include "wtf/text/AtomicString.h" | 38 #include "wtf/text/AtomicString.h" |
39 #include "wtf/text/WTFString.h" | 39 #include "wtf/text/WTFString.h" |
40 #include <memory> | 40 #include <memory> |
41 | 41 |
42 namespace WTF { | 42 namespace WTF { |
43 | 43 |
44 #if ENABLE(ASSERT) || ENABLE(SECURITY_ASSERT) | 44 #if DCHECK_IS_ON() || ENABLE(SECURITY_ASSERT) |
45 // The debug/assertion version may get bigger. | 45 // The debug/assertion version may get bigger. |
46 struct SameSizeAsRefCounted { | 46 struct SameSizeAsRefCounted { |
47 int a; | 47 int a; |
48 #if ENABLE(SECURITY_ASSERT) | 48 #if ENABLE(SECURITY_ASSERT) |
49 bool b; | 49 bool b; |
50 #endif | 50 #endif |
51 #if ENABLE(ASSERT) | 51 #if DCHECK_IS_ON() |
52 bool c; | 52 bool c; |
53 ThreadRestrictionVerifier d; | 53 ThreadRestrictionVerifier d; |
54 #endif | 54 #endif |
55 }; | 55 }; |
56 #else | 56 #else |
57 struct SameSizeAsRefCounted { | 57 struct SameSizeAsRefCounted { |
58 int a; | 58 int a; |
59 // Don't add anything here because this should stay small. | 59 // Don't add anything here because this should stay small. |
60 }; | 60 }; |
61 #endif | 61 #endif |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 static_assert(sizeof(Vector<int, 1>) == | 94 static_assert(sizeof(Vector<int, 1>) == |
95 sizeof(SameSizeAsVectorWithInlineCapacity<int, 1>), | 95 sizeof(SameSizeAsVectorWithInlineCapacity<int, 1>), |
96 "Vector should stay small"); | 96 "Vector should stay small"); |
97 static_assert(sizeof(Vector<int, 2>) == | 97 static_assert(sizeof(Vector<int, 2>) == |
98 sizeof(SameSizeAsVectorWithInlineCapacity<int, 2>), | 98 sizeof(SameSizeAsVectorWithInlineCapacity<int, 2>), |
99 "Vector should stay small"); | 99 "Vector should stay small"); |
100 static_assert(sizeof(Vector<int, 3>) == | 100 static_assert(sizeof(Vector<int, 3>) == |
101 sizeof(SameSizeAsVectorWithInlineCapacity<int, 3>), | 101 sizeof(SameSizeAsVectorWithInlineCapacity<int, 3>), |
102 "Vector should stay small"); | 102 "Vector should stay small"); |
103 } // namespace WTF | 103 } // namespace WTF |
OLD | NEW |