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

Issue 15271012: Clean up WebDOMEvent ownership of WebCore::Event. (Closed)

Created:
7 years, 7 months ago by dmichael (off chromium)
Modified:
7 years, 7 months ago
CC:
blink-reviews, jamesr, eae+blinkwatch, abarth-chromium
Base URL:
https://chromium.googlesource.com/chromium/blink@master
Visibility:
Public.

Description

Clean up WebDOMEvent ownership of WebCore::Event. Previously, it did manual reference counting. This change uses WebPrivatePtr to make the code clearer and safer. This change also introduces a copy constructor to WebPrivatePtr. Without that, the new WebDOMEvent was quietly using the compiler-provided copy constructor, which does not reference count. This change also disables copy and assign for WebPrivatePtr when WEBKIT_IMPLEMENTATION is not set, to make sure the compiler-provided ones are not used. BUG= Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=150933

Patch Set 1 #

Total comments: 2

Patch Set 2 : Use WebPrivatePtr instead #

Total comments: 2

Patch Set 3 : WEBKIT_EXPORT assign #

Patch Set 4 : Can't believe I forgot to implement assign... #

Patch Set 5 : Remove WEBKIT_EXPORT; shouldn't be necessary. #

Patch Set 6 : Argh... WebPrivatePtr was using a compiler-provided copy ctor #

Patch Set 7 : Disable copy and assign for WebPrivatePtr outside of WEBKIT_IMPLEMENTATION #

Patch Set 8 : merge #

Total comments: 3

Patch Set 9 : A couple more fixes #

Total comments: 9

Patch Set 10 : Review comments #

Patch Set 11 : Revise WebPrivatePtr copy-ctor comment #

Total comments: 6

Patch Set 12 : Improve comments per review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -43 lines) Patch
M Source/WebKit/chromium/public/WebDOMEvent.h View 1 2 3 4 5 6 7 8 9 4 chunks +11 lines, -7 lines 0 comments Download
M Source/WebKit/chromium/public/WebSpeechInputResult.h View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M Source/WebKit/chromium/src/WebDOMCustomEvent.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/WebKit/chromium/src/WebDOMEvent.cpp View 1 2 3 7 8 9 1 chunk +28 lines, -34 lines 0 comments Download
M Source/WebKit/chromium/src/WebDOMMessageEvent.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M public/platform/WebPrivatePtr.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +39 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
dmichael (off chromium)
https://codereview.chromium.org/15271012/diff/1/Source/WebKit/chromium/src/WebDOMEvent.cpp File Source/WebKit/chromium/src/WebDOMEvent.cpp (left): https://codereview.chromium.org/15271012/diff/1/Source/WebKit/chromium/src/WebDOMEvent.cpp#oldcode74 Source/WebKit/chromium/src/WebDOMEvent.cpp:74: return static_cast<WebCore::Event*>(m_private); This actually looks like a bug to ...
7 years, 7 months ago (2013-05-20 21:58:43 UTC) #1
abarth-chromium
https://codereview.chromium.org/15271012/diff/1/Source/WebKit/chromium/public/WebDOMEvent.h File Source/WebKit/chromium/public/WebDOMEvent.h (right): https://codereview.chromium.org/15271012/diff/1/Source/WebKit/chromium/public/WebDOMEvent.h#newcode117 Source/WebKit/chromium/public/WebDOMEvent.h:117: WTF::RefPtr<WebDOMEventPrivate> m_private; We can't use WTF::RefPtr directly because the ...
7 years, 7 months ago (2013-05-20 22:04:45 UTC) #2
dmichael (off chromium)
Sorry about that, using WebPrivatePtr now. https://codereview.chromium.org/15271012/diff/5001/Source/WebKit/chromium/src/WebDOMEvent.cpp File Source/WebKit/chromium/src/WebDOMEvent.cpp (right): https://codereview.chromium.org/15271012/diff/5001/Source/WebKit/chromium/src/WebDOMEvent.cpp#newcode68 Source/WebKit/chromium/src/WebDOMEvent.cpp:68: ASSERT(m_private.get()); If you ...
7 years, 7 months ago (2013-05-20 22:35:49 UTC) #3
abarth-chromium
OMG, so much better. https://codereview.chromium.org/15271012/diff/5001/Source/WebKit/chromium/src/WebDOMEvent.cpp File Source/WebKit/chromium/src/WebDOMEvent.cpp (right): https://codereview.chromium.org/15271012/diff/5001/Source/WebKit/chromium/src/WebDOMEvent.cpp#newcode68 Source/WebKit/chromium/src/WebDOMEvent.cpp:68: ASSERT(m_private.get()); On 2013/05/20 22:35:49, dmichael ...
7 years, 7 months ago (2013-05-20 22:54:50 UTC) #4
dmichael (off chromium)
So... Does it lgty? ;-) On May 20, 2013 4:54 PM, <abarth@chromium.org> wrote: > OMG, ...
7 years, 7 months ago (2013-05-20 23:12:02 UTC) #5
dmichael (off chromium)
I had to do a little more work to get the tests passing; WebPrivatePtr exposed ...
7 years, 7 months ago (2013-05-22 16:08:28 UTC) #6
dmichael (off chromium)
Gah... sorry, might as well still hold off. It looks like some other stuff depends ...
7 years, 7 months ago (2013-05-22 16:21:09 UTC) #7
abarth-chromium
https://codereview.chromium.org/15271012/diff/27001/Source/WebKit/chromium/public/WebDOMEvent.h File Source/WebKit/chromium/public/WebDOMEvent.h (right): https://codereview.chromium.org/15271012/diff/27001/Source/WebKit/chromium/public/WebDOMEvent.h#newcode57 Source/WebKit/chromium/public/WebDOMEvent.h:57: WebDOMEvent(const WebDOMEvent&); On 2013/05/22 16:08:28, dmichael wrote: > I ...
7 years, 7 months ago (2013-05-22 16:21:49 UTC) #8
dmichael (off chromium)
Okay... I think it's actually good this time :-) https://codereview.chromium.org/15271012/diff/33001/Source/WebKit/chromium/public/WebSpeechInputResult.h File Source/WebKit/chromium/public/WebSpeechInputResult.h (right): https://codereview.chromium.org/15271012/diff/33001/Source/WebKit/chromium/public/WebSpeechInputResult.h#newcode52 Source/WebKit/chromium/public/WebSpeechInputResult.h:52: ...
7 years, 7 months ago (2013-05-22 17:00:28 UTC) #9
abarth-chromium
https://codereview.chromium.org/15271012/diff/33001/Source/WebKit/chromium/src/WebDOMEvent.cpp File Source/WebKit/chromium/src/WebDOMEvent.cpp (right): https://codereview.chromium.org/15271012/diff/33001/Source/WebKit/chromium/src/WebDOMEvent.cpp#newcode49 Source/WebKit/chromium/src/WebDOMEvent.cpp:49: } Is there some reason you don't want to ...
7 years, 7 months ago (2013-05-22 17:16:11 UTC) #10
dmichael (off chromium)
https://codereview.chromium.org/15271012/diff/33001/Source/WebKit/chromium/src/WebDOMEvent.cpp File Source/WebKit/chromium/src/WebDOMEvent.cpp (right): https://codereview.chromium.org/15271012/diff/33001/Source/WebKit/chromium/src/WebDOMEvent.cpp#newcode49 Source/WebKit/chromium/src/WebDOMEvent.cpp:49: } On 2013/05/22 17:16:11, abarth wrote: > Is there ...
7 years, 7 months ago (2013-05-22 17:37:33 UTC) #11
abarth-chromium
https://codereview.chromium.org/15271012/diff/33001/Source/WebKit/chromium/src/WebDOMEvent.cpp File Source/WebKit/chromium/src/WebDOMEvent.cpp (right): https://codereview.chromium.org/15271012/diff/33001/Source/WebKit/chromium/src/WebDOMEvent.cpp#newcode49 Source/WebKit/chromium/src/WebDOMEvent.cpp:49: } On 2013/05/22 17:37:33, dmichael wrote: > On 2013/05/22 ...
7 years, 7 months ago (2013-05-22 18:06:23 UTC) #12
dmichael (off chromium)
https://codereview.chromium.org/15271012/diff/33001/Source/WebKit/chromium/src/WebDOMEvent.cpp File Source/WebKit/chromium/src/WebDOMEvent.cpp (right): https://codereview.chromium.org/15271012/diff/33001/Source/WebKit/chromium/src/WebDOMEvent.cpp#newcode49 Source/WebKit/chromium/src/WebDOMEvent.cpp:49: } On 2013/05/22 18:06:23, abarth wrote: > On 2013/05/22 ...
7 years, 7 months ago (2013-05-22 18:44:26 UTC) #13
darin1
Sorry for the awkwardness. This system is designed for: 1) making WebFoo classes act like ...
7 years, 7 months ago (2013-05-22 18:58:24 UTC) #14
darin1
Plus operator= and copy ctor can both be implemented in terms of assign. That avoids ...
7 years, 7 months ago (2013-05-22 19:03:48 UTC) #15
dmichael (off chromium)
On Wed, May 22, 2013 at 1:03 PM, Darin Fisher <darin@google.com> wrote: > Plus operator= ...
7 years, 7 months ago (2013-05-22 19:36:58 UTC) #16
darin1
That seems like a reasonable change to WebPrivatePtr. WebPrivatePtr was invented to help with folks ...
7 years, 7 months ago (2013-05-22 20:08:25 UTC) #17
dmichael (off chromium)
Given that you want to encourage following the pattern (in particular implementing copy ctors using ...
7 years, 7 months ago (2013-05-22 20:17:38 UTC) #18
darin (slow to review)
LGTM https://codereview.chromium.org/15271012/diff/29004/public/platform/WebPrivatePtr.h File public/platform/WebPrivatePtr.h (right): https://codereview.chromium.org/15271012/diff/29004/public/platform/WebPrivatePtr.h#newcode44 public/platform/WebPrivatePtr.h:44: // wrap a reference counted WebCore class. optional: ...
7 years, 7 months ago (2013-05-22 20:28:22 UTC) #19
dmichael (off chromium)
https://codereview.chromium.org/15271012/diff/29004/public/platform/WebPrivatePtr.h File public/platform/WebPrivatePtr.h (right): https://codereview.chromium.org/15271012/diff/29004/public/platform/WebPrivatePtr.h#newcode44 public/platform/WebPrivatePtr.h:44: // wrap a reference counted WebCore class. On 2013/05/22 ...
7 years, 7 months ago (2013-05-22 20:54:29 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmichael@chromium.org/15271012/33007
7 years, 7 months ago (2013-05-22 21:24:41 UTC) #21
commit-bot: I haz the power
7 years, 7 months ago (2013-05-22 23:47:59 UTC) #22
Message was sent while issue was closed.
Change committed as 150933

Powered by Google App Engine
This is Rietveld 408576698