| Index: third_party/WebKit/Source/wtf/SizeLimits.cpp
|
| diff --git a/third_party/WebKit/Source/wtf/SizeLimits.cpp b/third_party/WebKit/Source/wtf/SizeLimits.cpp
|
| index afb8fed6eb0e774f5339edc5c843a0a9bd5d9a24..faf122b27488a7274265e99021d20fe911c60d37 100644
|
| --- a/third_party/WebKit/Source/wtf/SizeLimits.cpp
|
| +++ b/third_party/WebKit/Source/wtf/SizeLimits.cpp
|
| @@ -44,47 +44,59 @@ namespace WTF {
|
| #if ENABLE(ASSERT) || ENABLE(SECURITY_ASSERT)
|
| // The debug/assertion version may get bigger.
|
| struct SameSizeAsRefCounted {
|
| - int a;
|
| + int a;
|
| #if ENABLE(SECURITY_ASSERT)
|
| - bool b;
|
| + bool b;
|
| #endif
|
| #if ENABLE(ASSERT)
|
| - bool c;
|
| - ThreadRestrictionVerifier d;
|
| + bool c;
|
| + ThreadRestrictionVerifier d;
|
| #endif
|
| };
|
| #else
|
| struct SameSizeAsRefCounted {
|
| - int a;
|
| - // Don't add anything here because this should stay small.
|
| + int a;
|
| + // Don't add anything here because this should stay small.
|
| };
|
| #endif
|
| -template<typename T, unsigned inlineCapacity = 0>
|
| +template <typename T, unsigned inlineCapacity = 0>
|
| struct SameSizeAsVectorWithInlineCapacity;
|
|
|
| -template<typename T>
|
| +template <typename T>
|
| struct SameSizeAsVectorWithInlineCapacity<T, 0> {
|
| - void* bufferPointer;
|
| - unsigned capacity;
|
| - unsigned size;
|
| + void* bufferPointer;
|
| + unsigned capacity;
|
| + unsigned size;
|
| };
|
|
|
| -template<typename T, unsigned inlineCapacity>
|
| +template <typename T, unsigned inlineCapacity>
|
| struct SameSizeAsVectorWithInlineCapacity {
|
| - SameSizeAsVectorWithInlineCapacity<T, 0> baseCapacity;
|
| + SameSizeAsVectorWithInlineCapacity<T, 0> baseCapacity;
|
| #if !defined(ANNOTATE_CONTIGUOUS_CONTAINER)
|
| - AlignedBuffer<inlineCapacity * sizeof(T), WTF_ALIGN_OF(T)> inlineBuffer;
|
| + AlignedBuffer<inlineCapacity * sizeof(T), WTF_ALIGN_OF(T)> inlineBuffer;
|
| #endif
|
| };
|
|
|
| static_assert(sizeof(OwnPtr<int>) == sizeof(int*), "OwnPtr should stay small");
|
| -static_assert(sizeof(PassRefPtr<RefCounted<int>>) == sizeof(int*), "PassRefPtr should stay small");
|
| -static_assert(sizeof(RefCounted<int>) == sizeof(SameSizeAsRefCounted), "RefCounted should stay small");
|
| -static_assert(sizeof(RefPtr<RefCounted<int>>) == sizeof(int*), "RefPtr should stay small");
|
| +static_assert(sizeof(PassRefPtr<RefCounted<int>>) == sizeof(int*),
|
| + "PassRefPtr should stay small");
|
| +static_assert(sizeof(RefCounted<int>) == sizeof(SameSizeAsRefCounted),
|
| + "RefCounted should stay small");
|
| +static_assert(sizeof(RefPtr<RefCounted<int>>) == sizeof(int*),
|
| + "RefPtr should stay small");
|
| static_assert(sizeof(String) == sizeof(int*), "String should stay small");
|
| -static_assert(sizeof(AtomicString) == sizeof(String), "AtomicString should stay small");
|
| -static_assert(sizeof(Vector<int>) == sizeof(SameSizeAsVectorWithInlineCapacity<int>), "Vector should stay small");
|
| -static_assert(sizeof(Vector<int, 1>) == sizeof(SameSizeAsVectorWithInlineCapacity<int, 1>), "Vector should stay small");
|
| -static_assert(sizeof(Vector<int, 2>) == sizeof(SameSizeAsVectorWithInlineCapacity<int, 2>), "Vector should stay small");
|
| -static_assert(sizeof(Vector<int, 3>) == sizeof(SameSizeAsVectorWithInlineCapacity<int, 3>), "Vector should stay small");
|
| +static_assert(sizeof(AtomicString) == sizeof(String),
|
| + "AtomicString should stay small");
|
| +static_assert(sizeof(Vector<int>) ==
|
| + sizeof(SameSizeAsVectorWithInlineCapacity<int>),
|
| + "Vector should stay small");
|
| +static_assert(sizeof(Vector<int, 1>) ==
|
| + sizeof(SameSizeAsVectorWithInlineCapacity<int, 1>),
|
| + "Vector should stay small");
|
| +static_assert(sizeof(Vector<int, 2>) ==
|
| + sizeof(SameSizeAsVectorWithInlineCapacity<int, 2>),
|
| + "Vector should stay small");
|
| +static_assert(sizeof(Vector<int, 3>) ==
|
| + sizeof(SameSizeAsVectorWithInlineCapacity<int, 3>),
|
| + "Vector should stay small");
|
| }
|
|
|