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

Side by Side Diff: Source/platform/heap/Handle.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: 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 | 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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 } 765 }
766 766
767 T* get() const { return m_raw; } 767 T* get() const { return m_raw; }
768 768
769 void clear() { m_raw = nullptr; } 769 void clear() { m_raw = nullptr; }
770 770
771 771
772 protected: 772 protected:
773 void checkPointer() 773 void checkPointer()
774 { 774 {
775 #if ENABLE(ASSERT) 775 #if ENABLE(ASSERT) && !OS(WIN)
haraken 2015/06/29 22:23:51 Shall we add a comment?
776 if (!m_raw) 776 if (!m_raw)
777 return; 777 return;
778 // HashTable can store a special value (which is not aligned to the 778 // HashTable can store a special value (which is not aligned to the
779 // allocation granularity) to Member<> to represent a deleted entry. 779 // allocation granularity) to Member<> to represent a deleted entry.
780 // Thus we treat a pointer that is not aligned to the granularity 780 // Thus we treat a pointer that is not aligned to the granularity
781 // as a valid pointer. 781 // as a valid pointer.
782 if (reinterpret_cast<intptr_t>(m_raw) % allocationGranularity) 782 if (reinterpret_cast<intptr_t>(m_raw) % allocationGranularity)
783 return; 783 return;
784 784
785 // TODO(haraken): What we really want to check here is that the pointer 785 // TODO(haraken): What we really want to check here is that the pointer
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin k::IsGarbageCollectedType<T>::value> { 1287 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin k::IsGarbageCollectedType<T>::value> {
1288 static_assert(sizeof(T), "T must be fully defined"); 1288 static_assert(sizeof(T), "T must be fully defined");
1289 }; 1289 };
1290 1290
1291 template<typename T> 1291 template<typename T>
1292 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; 1292 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete;
1293 1293
1294 } // namespace WTF 1294 } // namespace WTF
1295 1295
1296 #endif 1296 #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