| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 >::value), | 80 >::value), |
| 81 "RefPtr test"); | 81 "RefPtr test"); |
| 82 static_assert((std::is_same< | 82 static_assert((std::is_same< |
| 83 PassRefPtr<CopierThreadSafeRefCountedTest>, | 83 PassRefPtr<CopierThreadSafeRefCountedTest>, |
| 84 CrossThreadCopier<CopierThreadSafeRefCountedTest*>::Type | 84 CrossThreadCopier<CopierThreadSafeRefCountedTest*>::Type |
| 85 >::value), | 85 >::value), |
| 86 "RawPointer test"); | 86 "RawPointer test"); |
| 87 | 87 |
| 88 | 88 |
| 89 // Add a generic specialization which will let's us verify that no other templat
e matches. | 89 // Add a generic specialization which will let's us verify that no other templat
e matches. |
| 90 template<typename T> struct CrossThreadCopierBase<T, false, false, false> { | 90 template<typename T> struct CrossThreadCopierBase<T, false, false> { |
| 91 typedef int Type; | 91 typedef int Type; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 // Verify that RefCounted objects only match our generic template which exposes
Type as int. | 94 // Verify that RefCounted objects only match our generic template which exposes
Type as int. |
| 95 class CopierRefCountedTest : public RefCounted<CopierRefCountedTest> { | 95 class CopierRefCountedTest : public RefCounted<CopierRefCountedTest> { |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 static_assert((std::is_same< | 98 static_assert((std::is_same< |
| 99 int, | 99 int, |
| 100 CrossThreadCopier<PassRefPtr<CopierRefCountedTest>>::Type | 100 CrossThreadCopier<PassRefPtr<CopierRefCountedTest>>::Type |
| (...skipping 13 matching lines...) Expand all Loading... |
| 114 "Raw pointer RefCounted test"); | 114 "Raw pointer RefCounted test"); |
| 115 | 115 |
| 116 // Verify that PassOwnPtr gets passed through. | 116 // Verify that PassOwnPtr gets passed through. |
| 117 static_assert((std::is_same< | 117 static_assert((std::is_same< |
| 118 PassOwnPtr<float>, | 118 PassOwnPtr<float>, |
| 119 CrossThreadCopier<PassOwnPtr<float>>::Type | 119 CrossThreadCopier<PassOwnPtr<float>>::Type |
| 120 >::value), | 120 >::value), |
| 121 "PassOwnPtr test"); | 121 "PassOwnPtr test"); |
| 122 | 122 |
| 123 } // namespace blink | 123 } // namespace blink |
| OLD | NEW |