| 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<false, false, false, T> { | 90 template<typename T> struct CrossThreadCopierBase<T, false, 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 20 matching lines...) Expand all Loading... |
| 121 "PassOwnPtr test"); | 121 "PassOwnPtr test"); |
| 122 | 122 |
| 123 // Verify that PassOwnPtr does not get passed through. | 123 // Verify that PassOwnPtr does not get passed through. |
| 124 static_assert((std::is_same< | 124 static_assert((std::is_same< |
| 125 int, | 125 int, |
| 126 CrossThreadCopier<OwnPtr<float>>::Type | 126 CrossThreadCopier<OwnPtr<float>>::Type |
| 127 >::value), | 127 >::value), |
| 128 "OwnPtr test"); | 128 "OwnPtr test"); |
| 129 | 129 |
| 130 } // namespace blink | 130 } // namespace blink |
| OLD | NEW |