Index: Source/wtf/PassRefPtr.h |
diff --git a/Source/wtf/PassRefPtr.h b/Source/wtf/PassRefPtr.h |
index 9956c78e345e380cf39c6aaf848c88fdf7a04c24..49f244e1884617b7340a23ecaf35fc55e8ab3c85 100644 |
--- a/Source/wtf/PassRefPtr.h |
+++ b/Source/wtf/PassRefPtr.h |
@@ -60,6 +60,7 @@ namespace WTF { |
public: |
PassRefPtr() : m_ptr(0) { } |
PassRefPtr(T* ptr) : m_ptr(ptr) { refIfNotNull(ptr); } |
+ explicit PassRefPtr(T& ptr) : m_ptr(&ptr) { m_ptr->ref(); } |
// It somewhat breaks the type system to allow transfer of ownership out of |
// a const PassRefPtr. However, it makes it much easier to work with PassRefPtr |
// temporaries, and we don't have a need to use real const PassRefPtrs anyway. |