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

Side by Side Diff: Source/platform/CrossThreadCopier.h

Issue 813883002: replace COMPILE_ASSERT with static_assert in platform/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: another fixup Created 6 years 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 | « no previous file | Source/platform/CrossThreadCopier.cpp » ('j') | Source/platform/WebThread.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 template<> struct CrossThreadCopierBase<false, false, false, IntSize> : publ ic CrossThreadCopierPassThrough<IntSize> { 75 template<> struct CrossThreadCopierBase<false, false, false, IntSize> : publ ic CrossThreadCopierPassThrough<IntSize> {
76 }; 76 };
77 77
78 // Custom copy methods. 78 // Custom copy methods.
79 template<typename T> struct CrossThreadCopierBase<false, true, false, T> { 79 template<typename T> struct CrossThreadCopierBase<false, true, false, T> {
80 typedef typename WTF::RemoveTemplate<T, RefPtr>::Type TypeWithoutRefPtr; 80 typedef typename WTF::RemoveTemplate<T, RefPtr>::Type TypeWithoutRefPtr;
81 typedef typename WTF::RemoveTemplate<TypeWithoutRefPtr, PassRefPtr>::Typ e TypeWithoutPassRefPtr; 81 typedef typename WTF::RemoveTemplate<TypeWithoutRefPtr, PassRefPtr>::Typ e TypeWithoutPassRefPtr;
82 typedef typename WTF::RemovePointer<TypeWithoutPassRefPtr>::Type RefCoun tedType; 82 typedef typename WTF::RemovePointer<TypeWithoutPassRefPtr>::Type RefCoun tedType;
83 83
84 // Verify that only one of the above did a change. 84 // Verify that only one of the above did a change.
85 COMPILE_ASSERT((WTF::IsSameType<RefPtr<RefCountedType>, T>::value 85 static_assert((WTF::IsSameType<RefPtr<RefCountedType>, T>::value
86 || WTF::IsSameType<PassRefPtr<RefCountedType>, T>::value 86 || WTF::IsSameType<PassRefPtr<RefCountedType>, T>::value
87 || WTF::IsSameType<RefCountedType*, T>::value), 87 || WTF::IsSameType<RefCountedType*, T>::value),
88 OnlyAllowOneTypeModification); 88 "Only one type modification should be allowed");
Nico 2014/12/17 23:24:43 nit: lower-case O (see other review)
Mostyn Bramley-Moore 2014/12/17 23:33:54 Done.
89 89
90 typedef PassRefPtr<RefCountedType> Type; 90 typedef PassRefPtr<RefCountedType> Type;
91 static Type copy(const T& refPtr) 91 static Type copy(const T& refPtr)
92 { 92 {
93 return refPtr; 93 return refPtr;
94 } 94 }
95 }; 95 };
96 96
97 template<typename T> struct CrossThreadCopierBase<false, false, false, PassO wnPtr<T> > { 97 template<typename T> struct CrossThreadCopierBase<false, false, false, PassO wnPtr<T> > {
98 typedef PassOwnPtr<T> Type; 98 typedef PassOwnPtr<T> Type;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 template<typename T> AllowAccessLaterWrapper<T> AllowAccessLater(T* value) 228 template<typename T> AllowAccessLaterWrapper<T> AllowAccessLater(T* value)
229 { 229 {
230 return AllowAccessLaterWrapper<T>(value); 230 return AllowAccessLaterWrapper<T>(value);
231 } 231 }
232 232
233 233
234 } // namespace blink 234 } // namespace blink
235 235
236 #endif // CrossThreadCopier_h 236 #endif // CrossThreadCopier_h
OLDNEW
« no previous file with comments | « no previous file | Source/platform/CrossThreadCopier.cpp » ('j') | Source/platform/WebThread.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698