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

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

Issue 1217083002: Only check for on-heap Member<T>s iff T is in scope. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/platform/heap/Handle.h » ('j') | Source/platform/heap/Handle.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GarbageCollected_h 5 #ifndef GarbageCollected_h
6 #define GarbageCollected_h 6 #define GarbageCollected_h
7 7
8 #include "platform/heap/ThreadState.h" 8 #include "platform/heap/ThreadState.h"
9 #include "wtf/Assertions.h" 9 #include "wtf/Assertions.h"
10 #include "wtf/ListHashSet.h" 10 #include "wtf/ListHashSet.h"
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 template <typename T> const bool NeedsAdjustAndMark<T, true>::value; 415 template <typename T> const bool NeedsAdjustAndMark<T, true>::value;
416 416
417 template<typename T> 417 template<typename T>
418 class NeedsAdjustAndMark<T, false> { 418 class NeedsAdjustAndMark<T, false> {
419 static_assert(sizeof(T), "T must be fully defined"); 419 static_assert(sizeof(T), "T must be fully defined");
420 public: 420 public:
421 static const bool value = IsGarbageCollectedMixin<typename WTF::RemoveConst< T>::Type>::value; 421 static const bool value = IsGarbageCollectedMixin<typename WTF::RemoveConst< T>::Type>::value;
422 }; 422 };
423 template <typename T> const bool NeedsAdjustAndMark<T, false>::value; 423 template <typename T> const bool NeedsAdjustAndMark<T, false>::value;
424 424
425 // TODO(sof): migrate to wtf/TypeTraits.h
426 template<typename T>
427 class IsFullyDefined {
428 using TrueType = char;
429 struct FalseType {
430 char dummy[2];
431 };
432
433 template<typename U, size_t sz = sizeof(U)> static TrueType isSizeofKnown(U* );
434 static FalseType isSizeofKnown(...);
435 static T& t;
436 public:
437 static const bool value = sizeof(TrueType) == sizeof(isSizeofKnown(&t));
438 };
439
425 } // namespace blink 440 } // namespace blink
426 441
427 #endif 442 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/platform/heap/Handle.h » ('j') | Source/platform/heap/Handle.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698