OLD | NEW |
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 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 template<typename T, typename U> inline bool operator==(const Member<T>& a, cons
t Member<U>& b) { return a.get() == b.get(); } | 998 template<typename T, typename U> inline bool operator==(const Member<T>& a, cons
t Member<U>& b) { return a.get() == b.get(); } |
999 template<typename T, typename U> inline bool operator!=(const Member<T>& a, cons
t Member<U>& b) { return a.get() != b.get(); } | 999 template<typename T, typename U> inline bool operator!=(const Member<T>& a, cons
t Member<U>& b) { return a.get() != b.get(); } |
1000 template<typename T, typename U> inline bool operator==(const Persistent<T>& a,
const Persistent<U>& b) { return a.get() == b.get(); } | 1000 template<typename T, typename U> inline bool operator==(const Persistent<T>& a,
const Persistent<U>& b) { return a.get() == b.get(); } |
1001 template<typename T, typename U> inline bool operator!=(const Persistent<T>& a,
const Persistent<U>& b) { return a.get() != b.get(); } | 1001 template<typename T, typename U> inline bool operator!=(const Persistent<T>& a,
const Persistent<U>& b) { return a.get() != b.get(); } |
1002 | 1002 |
1003 template<typename T, typename U> inline bool operator==(const Member<T>& a, cons
t Persistent<U>& b) { return a.get() == b.get(); } | 1003 template<typename T, typename U> inline bool operator==(const Member<T>& a, cons
t Persistent<U>& b) { return a.get() == b.get(); } |
1004 template<typename T, typename U> inline bool operator!=(const Member<T>& a, cons
t Persistent<U>& b) { return a.get() != b.get(); } | 1004 template<typename T, typename U> inline bool operator!=(const Member<T>& a, cons
t Persistent<U>& b) { return a.get() != b.get(); } |
1005 template<typename T, typename U> inline bool operator==(const Persistent<T>& a,
const Member<U>& b) { return a.get() == b.get(); } | 1005 template<typename T, typename U> inline bool operator==(const Persistent<T>& a,
const Member<U>& b) { return a.get() == b.get(); } |
1006 template<typename T, typename U> inline bool operator!=(const Persistent<T>& a,
const Member<U>& b) { return a.get() != b.get(); } | 1006 template<typename T, typename U> inline bool operator!=(const Persistent<T>& a,
const Member<U>& b) { return a.get() != b.get(); } |
1007 | 1007 |
1008 #if defined(LEAK_SANITIZER) | |
1009 #define DEFINE_STATIC_REF_WILL_BE_PERSISTENT(type, name, arguments) \ | |
1010 static type* name = *(new Persistent<type>(arguments))->registerAsStaticRefe
rence() | |
1011 #else | |
1012 #define DEFINE_STATIC_REF_WILL_BE_PERSISTENT(type, name, arguments) \ | |
1013 static type* name = *(new Persistent<type>(arguments)) | |
1014 #endif | |
1015 | |
1016 template<typename T, bool = IsGarbageCollectedType<T>::value> | 1008 template<typename T, bool = IsGarbageCollectedType<T>::value> |
1017 class RawPtrOrMemberTrait { | 1009 class RawPtrOrMemberTrait { |
1018 STATIC_ONLY(RawPtrOrMemberTrait) | 1010 STATIC_ONLY(RawPtrOrMemberTrait) |
1019 public: | 1011 public: |
1020 using Type = RawPtr<T>; | 1012 using Type = RawPtr<T>; |
1021 }; | 1013 }; |
1022 | 1014 |
1023 template<typename T> | 1015 template<typename T> |
1024 class RawPtrOrMemberTrait<T, true> { | 1016 class RawPtrOrMemberTrait<T, true> { |
1025 STATIC_ONLY(RawPtrOrMemberTrait) | 1017 STATIC_ONLY(RawPtrOrMemberTrait) |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1301 // into it. | 1293 // into it. |
1302 // | 1294 // |
1303 // TODO(sof): remove this hack once wtf/Functional.h can also work with a ty
pe like | 1295 // TODO(sof): remove this hack once wtf/Functional.h can also work with a ty
pe like |
1304 // CrossThreadWeakPersistent<>. | 1296 // CrossThreadWeakPersistent<>. |
1305 static WeakPtr<T> unwrap(const StorageType& value) { return WeakPtr<T>(WeakR
eference<T>::create(value.get())); } | 1297 static WeakPtr<T> unwrap(const StorageType& value) { return WeakPtr<T>(WeakR
eference<T>::create(value.get())); } |
1306 }; | 1298 }; |
1307 | 1299 |
1308 } // namespace WTF | 1300 } // namespace WTF |
1309 | 1301 |
1310 #endif | 1302 #endif |
OLD | NEW |