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

Issue 85263006: Make IDL Callbacks non-refcounted by default (Closed)

Created:
7 years ago by adamk
Modified:
7 years ago
CC:
blink-reviews, Nils Barth (inactive), kojih, arv+blink, jsbell+bindings_chromium.org, Michael van Ouwerkerk, eae+blinkwatch, tommyw+watchlist_chromium.org, kinuko, marja+watch_chromium.org, dglazkov+blink, apavlov+blink_chromium.org, adamk+blink_chromium.org, darktears, haraken, Nate Chapin, watchdog-blink-watchlist_google.com, Raymond Toy, Inactive
Visibility:
Public.

Description

Make IDL Callbacks non-refcounted by default Callbacks are different from other IDL-generated code, in that they invert the flow of control of other interfaces (they let C++ code talk to JS, rather than the other way around). For this reason, they don't interact with the GC, and so can usually have a single owner rather than be managed with RefPtrs. This patch converts most existing callbacks to be non-refcounted, and instead manages them with OwnPtrs. Those callbacks where such conversion was non-trivial are listed in IsLegacyRefCountedCallback() in code_generator_v8.pm, and can be converted as follow-ons to this patch. BUG=323681 R=haraken@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=162776

Patch Set 1 #

Patch Set 2 : Refinements #

Total comments: 5

Patch Set 3 : Patch for landing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+191 lines, -185 lines) Patch
M Source/bindings/scripts/code_generator_v8.pm View 1 2 5 chunks +35 lines, -5 lines 0 comments Download
M Source/bindings/tests/results/V8TestCallback.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M Source/bindings/tests/results/V8TestObject.cpp View 1 2 8 chunks +8 lines, -8 lines 0 comments Download
M Source/bindings/tests/results/V8TestTypedefs.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/v8/V8Callback.h View 1 chunk +4 lines, -4 lines 0 comments Download
M Source/bindings/v8/V8MutationCallback.h View 2 chunks +4 lines, -3 lines 0 comments Download
M Source/bindings/v8/custom/V8GeolocationCustom.cpp View 2 chunks +4 lines, -4 lines 0 comments Download
M Source/bindings/v8/custom/V8MutationObserverCustom.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSVariablesMap.h View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/css/CSSVariablesMap.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/css/CSSVariablesMapForEachCallback.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/DataTransferItem.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/DataTransferItem.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/MutationCallback.h View 2 chunks +1 line, -2 lines 0 comments Download
M Source/core/dom/MutationObserver.h View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/dom/MutationObserver.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/dom/StringCallback.h View 1 chunk +2 lines, -3 lines 0 comments Download
M Source/core/dom/StringCallback.cpp View 2 chunks +5 lines, -5 lines 0 comments Download
M Source/core/platform/chromium/ChromiumDataObjectItem.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/platform/chromium/ChromiumDataObjectItem.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M Source/modules/geolocation/Geolocation.h View 3 chunks +6 lines, -6 lines 0 comments Download
M Source/modules/geolocation/Geolocation.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M Source/modules/geolocation/PositionCallback.h View 1 chunk +1 line, -3 lines 0 comments Download
M Source/modules/geolocation/PositionErrorCallback.h View 1 chunk +1 line, -3 lines 0 comments Download
M Source/modules/mediastream/MediaStreamTrack.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/mediastream/MediaStreamTrack.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/mediastream/MediaStreamTrackSourcesCallback.h View 1 chunk +1 line, -3 lines 0 comments Download
M Source/modules/mediastream/MediaStreamTrackSourcesRequest.h View 1 2 chunks +3 lines, -3 lines 0 comments Download
M Source/modules/mediastream/MediaStreamTrackSourcesRequest.cpp View 1 1 chunk +3 lines, -2 lines 0 comments Download
M Source/modules/mediastream/NavigatorMediaStream.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/mediastream/NavigatorMediaStream.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/mediastream/NavigatorUserMediaErrorCallback.h View 1 chunk +1 line, -2 lines 0 comments Download
M Source/modules/mediastream/NavigatorUserMediaSuccessCallback.h View 1 chunk +1 line, -3 lines 0 comments Download
M Source/modules/mediastream/RTCErrorCallback.h View 1 chunk +1 line, -2 lines 0 comments Download
M Source/modules/mediastream/RTCPeerConnection.h View 3 chunks +6 lines, -6 lines 0 comments Download
M Source/modules/mediastream/RTCPeerConnection.cpp View 6 chunks +6 lines, -6 lines 0 comments Download
M Source/modules/mediastream/RTCSessionDescriptionCallback.h View 1 chunk +1 line, -3 lines 0 comments Download
M Source/modules/mediastream/RTCSessionDescriptionRequestImpl.h View 2 chunks +4 lines, -4 lines 0 comments Download
M Source/modules/mediastream/RTCSessionDescriptionRequestImpl.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/modules/mediastream/RTCStatsCallback.h View 1 chunk +1 line, -3 lines 0 comments Download
M Source/modules/mediastream/RTCStatsRequestImpl.h View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M Source/modules/mediastream/RTCStatsRequestImpl.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M Source/modules/mediastream/RTCVoidRequestImpl.h View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/modules/mediastream/RTCVoidRequestImpl.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/modules/mediastream/UserMediaRequest.h View 2 chunks +4 lines, -4 lines 0 comments Download
M Source/modules/mediastream/UserMediaRequest.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/modules/notifications/Notification.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/notifications/Notification.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/notifications/NotificationClient.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/notifications/NotificationPermissionCallback.h View 1 chunk +1 line, -2 lines 0 comments Download
M Source/modules/quota/StorageErrorCallback.h View 2 chunks +4 lines, -4 lines 0 comments Download
M Source/modules/quota/StorageErrorCallback.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/quota/StorageInfo.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/modules/quota/StorageInfo.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/modules/quota/StorageQuota.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/modules/quota/StorageQuota.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/quota/StorageQuotaCallback.h View 1 chunk +1 line, -3 lines 0 comments Download
M Source/modules/quota/StorageUsageCallback.h View 1 chunk +1 line, -3 lines 0 comments Download
M Source/modules/quota/WebStorageQuotaCallbacksImpl.h View 2 chunks +7 lines, -7 lines 0 comments Download
M Source/modules/quota/WebStorageQuotaCallbacksImpl.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/modules/webaudio/AsyncAudioDecoder.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/webaudio/AsyncAudioDecoder.cpp View 3 chunks +4 lines, -4 lines 0 comments Download
M Source/modules/webaudio/AudioBufferCallback.h View 1 chunk +1 line, -3 lines 0 comments Download
M Source/modules/webaudio/AudioContext.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/webaudio/AudioContext.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/webmidi/MIDIAccessPromise.h View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/modules/webmidi/MIDIAccessPromise.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/webmidi/MIDIErrorCallback.h View 1 chunk +1 line, -3 lines 0 comments Download
M Source/modules/webmidi/MIDISuccessCallback.h View 1 chunk +1 line, -2 lines 0 comments Download
M Source/web/NotificationPresenterImpl.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/web/NotificationPresenterImpl.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M Source/web/StorageQuotaChromium.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 11 (0 generated)
adamk
Hi reviewers, I've put a variety of bindings OWNERS to make sure y'all are on ...
7 years ago (2013-11-26 21:26:10 UTC) #1
abarth-chromium
Sounds like a good idea to me. https://codereview.chromium.org/85263006/diff/20001/Source/bindings/scripts/code_generator_v8.pm File Source/bindings/scripts/code_generator_v8.pm (right): https://codereview.chromium.org/85263006/diff/20001/Source/bindings/scripts/code_generator_v8.pm#newcode6359 Source/bindings/scripts/code_generator_v8.pm:6359: sub IsLegacyRefCountedCallback ...
7 years ago (2013-11-26 21:50:15 UTC) #2
adamk
https://codereview.chromium.org/85263006/diff/20001/Source/bindings/scripts/code_generator_v8.pm File Source/bindings/scripts/code_generator_v8.pm (right): https://codereview.chromium.org/85263006/diff/20001/Source/bindings/scripts/code_generator_v8.pm#newcode6359 Source/bindings/scripts/code_generator_v8.pm:6359: sub IsLegacyRefCountedCallback On 2013/11/26 21:50:16, abarth wrote: > Should ...
7 years ago (2013-11-26 21:54:27 UTC) #3
abarth-chromium
On 2013/11/26 21:54:27, adamk wrote: > https://codereview.chromium.org/85263006/diff/20001/Source/bindings/scripts/code_generator_v8.pm > File Source/bindings/scripts/code_generator_v8.pm (right): > > https://codereview.chromium.org/85263006/diff/20001/Source/bindings/scripts/code_generator_v8.pm#newcode6359 > ...
7 years ago (2013-11-26 21:57:10 UTC) #4
haraken
LGTM https://codereview.chromium.org/85263006/diff/20001/Source/bindings/scripts/code_generator_v8.pm File Source/bindings/scripts/code_generator_v8.pm (right): https://codereview.chromium.org/85263006/diff/20001/Source/bindings/scripts/code_generator_v8.pm#newcode6359 Source/bindings/scripts/code_generator_v8.pm:6359: sub IsLegacyRefCountedCallback On 2013/11/26 21:54:28, adamk wrote: > ...
7 years ago (2013-11-27 00:37:10 UTC) #5
adamk
I'd be okay with a FIXME, but it's not clear to me that it's going ...
7 years ago (2013-11-27 00:45:20 UTC) #6
jochen (gone - plz use gerrit)
looks good
7 years ago (2013-11-27 08:59:49 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/adamk@chromium.org/85263006/20001
7 years ago (2013-11-27 16:42:02 UTC) #8
commit-bot: I haz the power
Failed to apply patch for Source/modules/mediastream/RTCStatsRequestImpl.h: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years ago (2013-11-27 16:42:18 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/adamk@chromium.org/85263006/40001
7 years ago (2013-11-27 18:27:03 UTC) #10
adamk
7 years ago (2013-11-27 19:40:21 UTC) #11
Message was sent while issue was closed.
Committed patchset #3 manually as r162776 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698