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

Side by Side Diff: third_party/WebKit/Source/platform/heap/Handle.h

Issue 1915153004: [K5] Replace bind() + non-GC pointers with unretained() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_4
Patch Set: Rebase Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 { 1189 {
1190 return p.get(); 1190 return p.get();
1191 } 1191 }
1192 1192
1193 // For wtf/Functional.h 1193 // For wtf/Functional.h
1194 template<typename T, bool isGarbageCollected> struct PointerParamStorageTraits; 1194 template<typename T, bool isGarbageCollected> struct PointerParamStorageTraits;
1195 1195
1196 // The condition of 'T must be fully defined' (except for void) is checked in 1196 // The condition of 'T must be fully defined' (except for void) is checked in
1197 // blink::IsGarbageCollectedType<T>::value. 1197 // blink::IsGarbageCollectedType<T>::value.
1198 template<typename T> 1198 template<typename T>
1199 struct PointerParamStorageTraits<T*, false> {
1200 STATIC_ONLY(PointerParamStorageTraits);
1201 using StorageType = T*;
1202
1203 static StorageType wrap(T* value) { return value; }
1204 static T* unwrap(const StorageType& value) { return value; }
1205 };
1206
1207 template<typename T>
1208 struct PointerParamStorageTraits<T*, true> { 1199 struct PointerParamStorageTraits<T*, true> {
1209 STATIC_ONLY(PointerParamStorageTraits); 1200 STATIC_ONLY(PointerParamStorageTraits);
1210 using StorageType = blink::CrossThreadPersistent<T>; 1201 using StorageType = blink::CrossThreadPersistent<T>;
1211 1202
1212 static StorageType wrap(T* value) { return value; } 1203 static StorageType wrap(T* value) { return value; }
1213 static T* unwrap(const StorageType& value) { return value.get(); } 1204 static T* unwrap(const StorageType& value) { return value.get(); }
1214 }; 1205 };
1215 1206
1216 template<typename T> 1207 template<typename T>
1217 struct ParamStorageTraits<T*> : public PointerParamStorageTraits<T*, blink::IsGa rbageCollectedType<T>::value> { 1208 struct ParamStorageTraits<T*> : public PointerParamStorageTraits<T*, blink::IsGa rbageCollectedType<T>::value> {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 STATIC_ONLY(ParamStorageTraits); 1255 STATIC_ONLY(ParamStorageTraits);
1265 1256
1266 using StorageType = blink::CrossThreadRetainedRefWrapper<T>; 1257 using StorageType = blink::CrossThreadRetainedRefWrapper<T>;
1267 static StorageType wrap(blink::CrossThreadRetainedRefWrapper<T>&& value) { r eturn std::move(value); } 1258 static StorageType wrap(blink::CrossThreadRetainedRefWrapper<T>&& value) { r eturn std::move(value); }
1268 static T* unwrap(const StorageType& value) { return value.value(); } 1259 static T* unwrap(const StorageType& value) { return value.value(); }
1269 }; 1260 };
1270 1261
1271 } // namespace WTF 1262 } // namespace WTF
1272 1263
1273 #endif 1264 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698