Chromium Code Reviews| Index: public/platform/WebPrivatePtr.h |
| diff --git a/public/platform/WebPrivatePtr.h b/public/platform/WebPrivatePtr.h |
| index 31d09a90bdacf2deb393721e1103359840cd7cd7..8d41e07c9558e060e8a919b65e0d40d1eea8c872 100644 |
| --- a/public/platform/WebPrivatePtr.h |
| +++ b/public/platform/WebPrivatePtr.h |
| @@ -51,6 +51,13 @@ public: |
| bool isNull() const { return !m_ptr; } |
| #if WEBKIT_IMPLEMENTATION |
| + WebPrivatePtr(const WebPrivatePtr& other) |
| + : m_ptr(other.m_ptr) |
| + { |
| + if (m_ptr) |
| + m_ptr->ref(); |
| + } |
|
abarth-chromium
2013/05/22 17:16:11
We shouldn't need to modify this class.
dmichael (off chromium)
2013/05/22 17:37:33
See the updated CL description. WebPrivatePtr did
abarth-chromium
2013/05/22 18:06:23
Good point. Let's try disabling the copy construc
dmichael (off chromium)
2013/05/22 18:44:26
Done. I kind of liked fixing it better; I wasn't s
|
| + |
| WebPrivatePtr(const PassRefPtr<T>& prp) |
| : m_ptr(prp.leakRef()) |
| { |
| @@ -97,6 +104,12 @@ private: |
| m_ptr->deref(); |
| m_ptr = p; |
| } |
| +#else |
| + // Disable copy and assign; we define them above for the implementation, but |
| + // we need to make sure that they aren't used outside there; the compiler- |
| + // provided versions won't handle reference counting properly. |
| + WebPrivatePtr(const WebPrivatePtr<T>&); |
| + WebPrivatePtr<T>& operator=(const WebPrivatePtr<T>& other); |
| #endif |
| T* m_ptr; |