Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: third_party/WebKit/Source/platform/CrossThreadCopier.cpp

Issue 1701013003: CrossThreadCopier: Consider arithmetic and enum types as safe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/CrossThreadCopier.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/CrossThreadCopier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698