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

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

Issue 1305933006: Document CrossThreadWeakPersistent. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pinned
Patch Set: Created 5 years, 3 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 | « no previous file | 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) 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 CrossThreadPersistent(T& raw) : Parent(raw) { } 332 CrossThreadPersistent(T& raw) : Parent(raw) { }
333 CrossThreadPersistent(const CrossThreadPersistent& other) : Parent(other) { } 333 CrossThreadPersistent(const CrossThreadPersistent& other) : Parent(other) { }
334 template<typename U> 334 template<typename U>
335 CrossThreadPersistent(const CrossThreadPersistent<U>& other) : Parent(other) { } 335 CrossThreadPersistent(const CrossThreadPersistent<U>& other) : Parent(other) { }
336 template<typename U> 336 template<typename U>
337 CrossThreadPersistent(const Member<U>& other) : Parent(other) { } 337 CrossThreadPersistent(const Member<U>& other) : Parent(other) { }
338 template<typename U> 338 template<typename U>
339 CrossThreadPersistent(const RawPtr<U>& other) : Parent(other.get()) { } 339 CrossThreadPersistent(const RawPtr<U>& other) : Parent(other.get()) { }
340 }; 340 };
341 341
342 // Combines the behavior of CrossThreadPersistent and WeakPersistent.
342 template<typename T> 343 template<typename T>
343 class CrossThreadWeakPersistent : public PersistentBase<T, WeakPersistentConfigu ration, CrossThreadPersistentConfiguration> { 344 class CrossThreadWeakPersistent : public PersistentBase<T, WeakPersistentConfigu ration, CrossThreadPersistentConfiguration> {
344 typedef PersistentBase<T, WeakPersistentConfiguration, CrossThreadPersistent Configuration> Parent; 345 typedef PersistentBase<T, WeakPersistentConfiguration, CrossThreadPersistent Configuration> Parent;
345 public: 346 public:
346 CrossThreadWeakPersistent() : Parent() { } 347 CrossThreadWeakPersistent() : Parent() { }
347 CrossThreadWeakPersistent(std::nullptr_t) : Parent(nullptr) { } 348 CrossThreadWeakPersistent(std::nullptr_t) : Parent(nullptr) { }
348 CrossThreadWeakPersistent(T* raw) : Parent(raw) { } 349 CrossThreadWeakPersistent(T* raw) : Parent(raw) { }
349 CrossThreadWeakPersistent(T& raw) : Parent(raw) { } 350 CrossThreadWeakPersistent(T& raw) : Parent(raw) { }
350 CrossThreadWeakPersistent(const CrossThreadWeakPersistent& other) : Parent(o ther) { } 351 CrossThreadWeakPersistent(const CrossThreadWeakPersistent& other) : Parent(o ther) { }
351 template<typename U> 352 template<typename U>
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin k::IsGarbageCollectedType<T>::value> { 1180 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin k::IsGarbageCollectedType<T>::value> {
1180 static_assert(sizeof(T), "T must be fully defined"); 1181 static_assert(sizeof(T), "T must be fully defined");
1181 }; 1182 };
1182 1183
1183 template<typename T> 1184 template<typename T>
1184 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; 1185 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete;
1185 1186
1186 } // namespace WTF 1187 } // namespace WTF
1187 1188
1188 #endif 1189 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698