| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 } | 293 } |
| 294 | 294 |
| 295 WrappedInt& operator=(const WrappedInt& other) { | 295 WrappedInt& operator=(const WrappedInt& other) { |
| 296 m_i = other.m_i; | 296 m_i = other.m_i; |
| 297 return *this; | 297 return *this; |
| 298 } | 298 } |
| 299 | 299 |
| 300 ~WrappedInt() { | 300 ~WrappedInt() { |
| 301 EXPECT_EQ(m_originalThisPtr, this); | 301 EXPECT_EQ(m_originalThisPtr, this); |
| 302 EXPECT_TRUE(constructedWrappedInts.contains(this)); | 302 EXPECT_TRUE(constructedWrappedInts.contains(this)); |
| 303 constructedWrappedInts.remove(this); | 303 constructedWrappedInts.erase(this); |
| 304 } | 304 } |
| 305 | 305 |
| 306 int get() const { return m_i; } | 306 int get() const { return m_i; } |
| 307 | 307 |
| 308 private: | 308 private: |
| 309 void* m_originalThisPtr; | 309 void* m_originalThisPtr; |
| 310 int m_i; | 310 int m_i; |
| 311 }; | 311 }; |
| 312 | 312 |
| 313 TEST(VectorTest, SwapWithInlineCapacity) { | 313 TEST(VectorTest, SwapWithInlineCapacity) { |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 static_assert(VectorTraits<UChar>::canCopyWithMemcpy, | 699 static_assert(VectorTraits<UChar>::canCopyWithMemcpy, |
| 700 "UChar should be copied with memcpy."); | 700 "UChar should be copied with memcpy."); |
| 701 | 701 |
| 702 class UnknownType; | 702 class UnknownType; |
| 703 static_assert(VectorTraits<UnknownType*>::canCopyWithMemcpy, | 703 static_assert(VectorTraits<UnknownType*>::canCopyWithMemcpy, |
| 704 "Pointers should be copied with memcpy."); | 704 "Pointers should be copied with memcpy."); |
| 705 | 705 |
| 706 } // anonymous namespace | 706 } // anonymous namespace |
| 707 | 707 |
| 708 } // namespace WTF | 708 } // namespace WTF |
| OLD | NEW |