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

Unified Diff: public/platform/WebPrivatePtr.h

Issue 15271012: Clean up WebDOMEvent ownership of WebCore::Event. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: merge Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
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 16:21:49 We shouldn't need to modify WebPrivatePtr
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;

Powered by Google App Engine
This is Rietveld 408576698