Chromium Code Reviews| Index: Source/heap/Handle.h |
| diff --git a/Source/heap/Handle.h b/Source/heap/Handle.h |
| index b175a9140fcdda2ac6c280f1916f416f5de6822b..d6bafcb7152dc76bbbf3bf99ec6373c2bc63bfb9 100644 |
| --- a/Source/heap/Handle.h |
| +++ b/Source/heap/Handle.h |
| @@ -691,6 +691,15 @@ public: |
| { |
| } |
| + template<typename U> |
|
Mads Ager (chromium)
2013/08/16 10:23:41
We really shouldn't be using this unless we really
Erik Corry
2013/08/16 11:39:27
Done.
|
| + Result(const Member<U>* other) |
| + : m_raw(other->raw()) |
| +#ifndef NDEBUG |
| + , m_doNotAllocate() |
| +#endif |
| + { |
| + } |
| + |
| ~Result() |
| { |
| } |
| @@ -729,6 +738,13 @@ public: |
| return *this; |
| } |
| + template<typename U> |
| + Result& operator=(const Member<U>* other) |
| + { |
| + COMPILE_ASSERT(!sizeof(T*), Result_should_never_be_assigned_to); |
| + return *this; |
| + } |
| + |
| template<typename U> bool operator==(const U* other) const { return other == m_raw; } |
| template<typename U> bool operator!=(const U* other) const { return other != m_raw; } |
| @@ -814,6 +830,7 @@ private: |
| mutable NoAllocation m_doNotAllocate; |
| #endif |
| + template<typename U> friend void Visitor::visit(const class Result<U>&); |
| template<typename U> friend class Persistent; |
| template<typename U> friend class Handle; |
| template<typename U> friend class Member; |
| @@ -1460,6 +1477,12 @@ template<typename T> struct HashTraits<WebCore::Member<T> > : SimpleClassHashTra |
| // the two types can be merged into PassInType. |
| typedef const typename WebCore::Handle<T>& PeekInType; |
| typedef const typename WebCore::Handle<T>& PassInType; |
| + typedef WebCore::Result<T> IteratorGetType; |
| + typedef WebCore::Result<T> IteratorConstGetType; |
| + typedef WebCore::Result<T> IteratorReferenceType; |
| + typedef WebCore::Result<T> IteratorConstReferenceType; |
| + static IteratorReferenceType getToReferenceConversion(IteratorGetType x) { return x; } |
| + static IteratorConstReferenceType getToReferenceConstConversion(IteratorConstGetType x) { return x; } |
| // FIXME(oilpan): Similarly, there is no need for a distinction between |
| // PeekType and PassOutType without reference counting. |
| typedef typename WebCore::Result<T> PeekType; |