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

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

Issue 1916283003: [K6] Replace bind() + GCed pointers with retainedRef() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_5c
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*, true> {
1200 STATIC_ONLY(PointerParamStorageTraits);
1201 using StorageType = blink::CrossThreadPersistent<T>;
1202
1203 static StorageType wrap(T* value) { return value; }
1204 static T* unwrap(const StorageType& value) { return value.get(); }
1205 };
1206
1207 template<typename T>
1208 struct ParamStorageTraits<T*> : public PointerParamStorageTraits<T*, blink::IsGa rbageCollectedType<T>::value> { 1199 struct ParamStorageTraits<T*> : public PointerParamStorageTraits<T*, blink::IsGa rbageCollectedType<T>::value> {
1209 STATIC_ONLY(ParamStorageTraits); 1200 STATIC_ONLY(ParamStorageTraits);
1210 }; 1201 };
1211 1202
1212 template<typename T> 1203 template<typename T>
1213 struct ParamStorageTraits<blink::WeakPersistentThisPointer<T>> { 1204 struct ParamStorageTraits<blink::WeakPersistentThisPointer<T>> {
1214 STATIC_ONLY(ParamStorageTraits); 1205 STATIC_ONLY(ParamStorageTraits);
1215 static_assert(sizeof(T), "T must be fully defined"); 1206 static_assert(sizeof(T), "T must be fully defined");
1216 using StorageType = blink::WeakPersistent<T>; 1207 using StorageType = blink::WeakPersistent<T>;
1217 1208
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 STATIC_ONLY(ParamStorageTraits); 1246 STATIC_ONLY(ParamStorageTraits);
1256 1247
1257 using StorageType = blink::CrossThreadRetainedRefWrapper<T>; 1248 using StorageType = blink::CrossThreadRetainedRefWrapper<T>;
1258 static StorageType wrap(blink::CrossThreadRetainedRefWrapper<T>&& value) { r eturn std::move(value); } 1249 static StorageType wrap(blink::CrossThreadRetainedRefWrapper<T>&& value) { r eturn std::move(value); }
1259 static T* unwrap(const StorageType& value) { return value.value(); } 1250 static T* unwrap(const StorageType& value) { return value.value(); }
1260 }; 1251 };
1261 1252
1262 } // namespace WTF 1253 } // namespace WTF
1263 1254
1264 #endif 1255 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/worklet/Worklet.cpp ('k') | third_party/WebKit/Source/platform/heap/HeapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698