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

Unified Diff: Source/WebKit/chromium/public/WebDOMEvent.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
« no previous file with comments | « no previous file | Source/WebKit/chromium/src/WebDOMCustomEvent.cpp » ('j') | public/platform/WebPrivatePtr.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/public/WebDOMEvent.h
diff --git a/Source/WebKit/chromium/public/WebDOMEvent.h b/Source/WebKit/chromium/public/WebDOMEvent.h
index d85648d8750ae859cb9deba52b659726554f531c..79068c63d2fe8cfda3c4b077820a4fb1ee09f10e 100644
--- a/Source/WebKit/chromium/public/WebDOMEvent.h
+++ b/Source/WebKit/chromium/public/WebDOMEvent.h
@@ -32,6 +32,7 @@
#define WebDOMEvent_h
#include "../../../../public/platform/WebCommon.h"
+#include "../../../../public/platform/WebPrivatePtr.h"
#include "../../../../public/platform/WebString.h"
#include "WebNode.h"
@@ -52,8 +53,8 @@ public:
~WebDOMEvent() { reset(); }
- WebDOMEvent() : m_private(0) { }
- WebDOMEvent(const WebDOMEvent& e) : m_private(0) { assign(e); }
+ WebDOMEvent() { }
+ WebDOMEvent(const WebDOMEvent&);
dmichael (off chromium) 2013/05/22 16:08:28 I moved this to the body so that I could use the W
abarth-chromium 2013/05/22 16:21:49 It's probably better to do this using the same pat
WebDOMEvent& operator=(const WebDOMEvent& e)
{
assign(e);
@@ -63,7 +64,7 @@ public:
WEBKIT_EXPORT void reset();
WEBKIT_EXPORT void assign(const WebDOMEvent&);
- bool isNull() const { return !m_private; }
+ bool isNull() const { return m_private.isNull(); }
WEBKIT_EXPORT WebString type() const;
WEBKIT_EXPORT WebNode target() const;
@@ -112,18 +113,21 @@ public:
protected:
typedef WebCore::Event WebDOMEventPrivate;
- void assign(WebDOMEventPrivate*);
- WebDOMEventPrivate* m_private;
+#if WEBKIT_IMPLEMENTATION
+ void assign(const WTF::PassRefPtr<WebDOMEventPrivate>&);
template<typename T> T* unwrap()
{
- return static_cast<T*>(m_private);
+ return static_cast<T*>(m_private.get());
}
template<typename T> const T* constUnwrap() const
{
- return static_cast<const T*>(m_private);
+ return static_cast<const T*>(m_private.get());
}
+#endif
+
+ WebPrivatePtr<WebDOMEventPrivate> m_private;
};
} // namespace WebKit
« no previous file with comments | « no previous file | Source/WebKit/chromium/src/WebDOMCustomEvent.cpp » ('j') | public/platform/WebPrivatePtr.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698