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

Issue 26878003: Reduce repetitive EventTarget subclassing (Closed)

Created:
7 years, 2 months ago by Inactive
Modified:
7 years, 2 months ago
Reviewers:
tkent, jsbell
CC:
blink-reviews, nessy, jsbell, chromiumbugtracker_adobe.com, alecflett, dgrogan, eae+blinkwatch, tommyw+watchlist_chromium.org, kinuko, feature-media-reviews_chromium.org, dglazkov+blink, apavlov+blink_chromium.org, adamk+blink_chromium.org, darktears, pdr, f(malita), Stephen Chennney, Nate Chapin, vcarbune.chromium, gavinp+loader_chromium.org
Visibility:
Public.

Description

Reduce repetitive EventTarget subclassing Add a EventTargetWithInlineData helper class to EventTarget.h. It's a simple subclass with an EventTargetData member and FINAL eventTargetData()/ensureEventTargetData() overrides. Turns out that this fits almost every use case except Node and SVGElementInstance. ensureEventTargetData() now returns a reference instead of a pointer as it can never be NULL. This patch is based on WebKit r156413 by <akling@apple.com>;. R=tkent BUG= Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=159393

Patch Set 1 #

Patch Set 2 : build fix #

Patch Set 3 : Rebase #

Total comments: 2

Patch Set 4 : Fix nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+143 lines, -526 lines) Patch
M Source/core/css/FontFaceSet.h View 4 chunks +5 lines, -8 lines 0 comments Download
M Source/core/css/FontFaceSet.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/core/dom/MessagePort.h View 1 2 3 chunks +1 line, -4 lines 0 comments Download
M Source/core/dom/MessagePort.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/core/dom/NamedFlow.h View 3 chunks +5 lines, -10 lines 0 comments Download
M Source/core/dom/NamedFlow.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/core/dom/Node.h View 1 2 3 chunks +6 lines, -6 lines 0 comments Download
M Source/core/dom/Node.cpp View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/events/EventTarget.h View 1 2 2 chunks +9 lines, -1 line 0 comments Download
M Source/core/events/EventTarget.cpp View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/fileapi/FileReader.h View 4 chunks +5 lines, -9 lines 0 comments Download
M Source/core/html/MediaController.h View 2 chunks +5 lines, -8 lines 0 comments Download
M Source/core/html/track/TextTrackCue.h View 5 chunks +5 lines, -9 lines 0 comments Download
M Source/core/html/track/TextTrackCue.cpp View 1 chunk +0 lines, -10 lines 0 comments Download
M Source/core/html/track/TextTrackList.h View 4 chunks +5 lines, -8 lines 0 comments Download
M Source/core/html/track/TrackBase.h View 2 chunks +5 lines, -9 lines 0 comments Download
M Source/core/html/track/TrackBase.cpp View 1 chunk +0 lines, -10 lines 0 comments Download
M Source/core/loader/appcache/ApplicationCache.h View 2 chunks +5 lines, -9 lines 0 comments Download
M Source/core/loader/appcache/ApplicationCache.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/core/page/DOMWindow.h View 5 chunks +8 lines, -12 lines 0 comments Download
M Source/core/page/DOMWindow.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/core/page/EventSource.h View 3 chunks +5 lines, -9 lines 0 comments Download
M Source/core/page/EventSource.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/core/page/Performance.h View 2 chunks +6 lines, -9 lines 0 comments Download
M Source/core/page/Performance.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/core/svg/SVGElementInstance.h View 1 chunk +4 lines, -4 lines 0 comments Download
M Source/core/svg/SVGElementInstance.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/workers/AbstractWorker.h View 2 chunks +1 line, -5 lines 0 comments Download
M Source/core/workers/AbstractWorker.cpp View 1 chunk +0 lines, -10 lines 0 comments Download
M Source/core/workers/WorkerGlobalScope.h View 1 2 3 chunks +1 line, -4 lines 0 comments Download
M Source/core/workers/WorkerGlobalScope.cpp View 1 chunk +0 lines, -10 lines 0 comments Download
M Source/core/xml/XMLHttpRequestEventTarget.h View 2 chunks +1 line, -8 lines 0 comments Download
M Source/modules/encryptedmedia/MediaKeySession.h View 2 chunks +1 line, -6 lines 0 comments Download
M Source/modules/filesystem/FileWriter.h View 4 chunks +5 lines, -8 lines 0 comments Download
M Source/modules/indexeddb/IDBDatabase.h View 4 chunks +5 lines, -9 lines 0 comments Download
M Source/modules/indexeddb/IDBDatabase.cpp View 1 2 3 2 chunks +1 line, -11 lines 0 comments Download
M Source/modules/indexeddb/IDBRequest.h View 4 chunks +6 lines, -10 lines 0 comments Download
M Source/modules/indexeddb/IDBRequest.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/modules/indexeddb/IDBTransaction.h View 4 chunks +5 lines, -9 lines 0 comments Download
M Source/modules/indexeddb/IDBTransaction.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/modules/mediasource/MediaSourceBase.h View 3 chunks +1 line, -4 lines 0 comments Download
M Source/modules/mediasource/MediaSourceBase.cpp View 1 chunk +0 lines, -10 lines 0 comments Download
M Source/modules/mediasource/SourceBuffer.h View 3 chunks +1 line, -4 lines 0 comments Download
M Source/modules/mediasource/SourceBuffer.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/modules/mediasource/SourceBufferList.h View 3 chunks +1 line, -6 lines 0 comments Download
M Source/modules/mediasource/SourceBufferList.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/modules/mediasource/WebKitSourceBufferList.h View 3 chunks +1 line, -6 lines 0 comments Download
M Source/modules/mediasource/WebKitSourceBufferList.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/modules/mediastream/MediaStream.h View 3 chunks +1 line, -7 lines 0 comments Download
M Source/modules/mediastream/MediaStream.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/modules/mediastream/MediaStreamTrack.h View 2 chunks +1 line, -4 lines 0 comments Download
M Source/modules/mediastream/MediaStreamTrack.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/modules/mediastream/RTCDTMFSender.h View 2 chunks +1 line, -4 lines 0 comments Download
M Source/modules/mediastream/RTCDTMFSender.cpp View 1 chunk +0 lines, -10 lines 0 comments Download
M Source/modules/mediastream/RTCDataChannel.h View 2 chunks +3 lines, -6 lines 0 comments Download
M Source/modules/mediastream/RTCDataChannel.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/modules/mediastream/RTCPeerConnection.h View 2 chunks +3 lines, -6 lines 0 comments Download
M Source/modules/mediastream/RTCPeerConnection.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/modules/notifications/Notification.h View 4 chunks +6 lines, -10 lines 0 comments Download
M Source/modules/notifications/Notification.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download
M Source/modules/speech/SpeechRecognition.h View 3 chunks +1 line, -5 lines 0 comments Download
M Source/modules/speech/SpeechSynthesisUtterance.h View 2 chunks +1 line, -5 lines 0 comments Download
M Source/modules/webaudio/AudioContext.h View 3 chunks +5 lines, -8 lines 0 comments Download
M Source/modules/webaudio/AudioNode.h View 3 chunks +1 line, -5 lines 0 comments Download
M Source/modules/webmidi/MIDIAccess.h View 2 chunks +1 line, -4 lines 0 comments Download
M Source/modules/webmidi/MIDIPort.h View 2 chunks +1 line, -4 lines 0 comments Download
M Source/modules/websockets/WebSocket.h View 3 chunks +3 lines, -6 lines 0 comments Download
M Source/modules/websockets/WebSocket.cpp View 1 2 1 chunk +0 lines, -10 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Inactive
7 years, 2 months ago (2013-10-10 20:00:55 UTC) #1
tkent
lgtm https://codereview.chromium.org/26878003/diff/7001/Source/modules/indexeddb/IDBDatabase.cpp File Source/modules/indexeddb/IDBDatabase.cpp (right): https://codereview.chromium.org/26878003/diff/7001/Source/modules/indexeddb/IDBDatabase.cpp#newcode396 Source/modules/indexeddb/IDBDatabase.cpp:396: return !m_closePending && !const_cast<IDBDatabase*>(this)->ensureEventTargetData().eventListenerMap.isEmpty() && !m_contextStopped; !...eventListernMap.isEmpty() looks ...
7 years, 2 months ago (2013-10-10 21:16:25 UTC) #2
jsbell
Nice! https://codereview.chromium.org/26878003/diff/7001/Source/modules/indexeddb/IDBDatabase.cpp File Source/modules/indexeddb/IDBDatabase.cpp (right): https://codereview.chromium.org/26878003/diff/7001/Source/modules/indexeddb/IDBDatabase.cpp#newcode396 Source/modules/indexeddb/IDBDatabase.cpp:396: return !m_closePending && !const_cast<IDBDatabase*>(this)->ensureEventTargetData().eventListenerMap.isEmpty() && !m_contextStopped; On 2013/10/10 ...
7 years, 2 months ago (2013-10-10 21:49:15 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/26878003/15001
7 years, 2 months ago (2013-10-10 22:11:10 UTC) #4
commit-bot: I haz the power
7 years, 2 months ago (2013-10-10 23:52:44 UTC) #5
Message was sent while issue was closed.
Change committed as 159393

Powered by Google App Engine
This is Rietveld 408576698