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

Issue 2049003002: Wrap GCed raw pointer parameters of WTF::bind with Persistent (Closed)

Created:
4 years, 6 months ago by tzik
Modified:
4 years, 6 months ago
CC:
chromium-reviews, blink-reviews-platform-graphics_chromium.org, dshwang, eae+blinkwatch, eric.carlson_apple.com, apavlov+blink_chromium.org, kinuko+worker_chromium.org, kinuko+watch, danakj+watch_chromium.org, rwlbuis, timvolodine, caseq+blink_chromium.org, pdr+graphicswatchlist_chromium.org, drott+blinkwatch_chromium.org, Mads Ager (chromium), mvanouwerkerk+watch_chromium.org, blink-reviews-wtf_chromium.org, blink-reviews-html_chromium.org, Justin Novosad, hongchan, blink-reviews-dom_chromium.org, dglazkov+blink, Rik, blink-reviews-bindings_chromium.org, gavinp+loader_chromium.org, devtools-reviews_chromium.org, blink-reviews, ajuma+watch_chromium.org, blink-worker-reviews_chromium.org, jbroman, Peter Beverloo, mlamouri+watch-blink_chromium.org, nhiroki, Raymond Toy, loading-reviews_chromium.org, tommyw+watchlist_chromium.org, krit, lushnikov+blink_chromium.org, loading-reviews+fetch_chromium.org, Nate Chapin, Stephen Chennney, tyoshino+watch_chromium.org, feature-media-reviews_chromium.org, ajuma+watch-canvas_chromium.org, scheduler-bugs_chromium.org, falken, pfeldman+blink_chromium.org, f(malita), mcasas+watch+mediastream_chromium.org, oilpan-reviews, horo+watch_chromium.org, sergeyv+blink_chromium.org, Mikhail, kouhei+heap_chromium.org, kinuko+fileapi, kozyatinskiy+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Wrap GCed raw pointer parameters of WTF::bind with Persistent This CL adds `wrapPersistent` to all GCed raw pointer prameters of WTF::bind, as a preparation of raw pointer removal on WTF::bind. WTF::bind and blink::threadSafeBind wrap raw pointers into Persistent if it's a GCed type. However, the lifetime management based on the type get considered harmful these days, and should eventually be removed. This CL and following CLs annotate all raw pointers on WTF::bind, and ban all raw pointers. BUG=597856 Committed: https://crrev.com/8359caf0b6a4b86949be98b12147c926fb58d2a8 Cr-Commit-Position: refs/heads/master@{#401558}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : rebase #

Patch Set 4 : s/bind/threadSafeBind/ in DatabaseThread #

Patch Set 5 : s/wrapPersistent/wrapCrossThreadPersistent/g #

Patch Set 6 : revert "unretained" part and "disallow pointers" part #

Total comments: 4

Patch Set 7 : rebase. split RejectedPromise case to another CL. use wrapPersistent in HTMLSlotElement. #

Total comments: 10

Patch Set 8 : s/wrapCrossThreadPersistent/wrapPersistent/ #

Total comments: 5

Patch Set 9 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+91 lines, -94 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp View 1 2 3 4 5 6 7 8 3 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ExecutionContext.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/fileapi/FileReader.cpp View 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLInputElement.cpp View 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLSelectElement.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLSlotElement.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp View 1 2 3 4 5 6 7 8 12 chunks +13 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreatorTest.cpp View 5 6 7 2 chunks +2 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/html/forms/SearchInputType.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/page/NetworkStateNotifierTest.cpp View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/battery/BatteryDispatcher.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp View 1 2 3 4 5 6 7 2 chunks +6 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/modules/geolocation/Geolocation.cpp View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp View 1 2 3 4 5 6 7 8 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/nfc/NFC.cpp View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/notifications/Notification.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/quota/StorageErrorCallback.cpp View 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/sensor/Sensor.cpp View 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/vibration/VibrationController.cpp View 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/vr/VRController.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webdatabase/Database.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webusb/USB.cpp View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webusb/USBDevice.cpp View 1 2 3 4 5 6 7 8 15 chunks +15 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/modules/worklet/Worklet.cpp View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/HeapTest.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/ExternalPopupMenu.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/web/PopupMenuImpl.cpp View 5 6 7 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 41 (14 generated)
tzik
PTAL
4 years, 6 months ago (2016-06-08 12:02:21 UTC) #5
Yuta Kitamura
Didn't look into the actual code, but if you want to land this, I think ...
4 years, 6 months ago (2016-06-09 04:20:21 UTC) #7
yhirano
bindings and modules/fetch lgtm. The |this| pointer in the bind call in RejectedPromises once had ...
4 years, 6 months ago (2016-06-09 08:47:39 UTC) #8
tzik
On 2016/06/09 04:20:21, Yuta Kitamura wrote: > Didn't look into the actual code, but if ...
4 years, 6 months ago (2016-06-09 09:08:11 UTC) #9
tzik
Updated. PTAL.
4 years, 6 months ago (2016-06-09 09:36:30 UTC) #11
hiroshige
About CL description: > WTF::bind and blink::threadSafeBind wrap raw pointers into Persistent s/Persistent/CrossThreadPersistent/. Also, could ...
4 years, 6 months ago (2016-06-15 12:12:39 UTC) #12
tzik
https://codereview.chromium.org/2049003002/diff/100001/third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp File third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp (right): https://codereview.chromium.org/2049003002/diff/100001/third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp#newcode213 third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp:213: Platform::current()->currentThread()->scheduler()->timerTaskRunner()->postTask(BLINK_FROM_HERE, bind(&RejectedPromises::revokeNow, RefPtr<RejectedPromises>(this), passed(std::move(message)))); On 2016/06/15 12:12:39, hiroshige (slow) ...
4 years, 6 months ago (2016-06-21 09:09:04 UTC) #13
kouhei (in TOK)
Source/core & Source/modules lgtm
4 years, 6 months ago (2016-06-22 06:27:26 UTC) #15
haraken
It looks like this CL is abusing CrossThreadPersistents. We should use wrapPersistent() for tasks that ...
4 years, 6 months ago (2016-06-22 06:27:43 UTC) #17
sof
On 2016/06/22 06:27:43, haraken wrote: > It looks like this CL is abusing CrossThreadPersistents. We ...
4 years, 6 months ago (2016-06-22 06:36:57 UTC) #18
Yuta Kitamura
I felt the same way as haraken. Are those changes functionally equivalent to what we ...
4 years, 6 months ago (2016-06-22 07:12:47 UTC) #19
tzik
Hmm, we currently use CrossThreadPersistent to them, and I wanted to avoid functional changes in ...
4 years, 6 months ago (2016-06-22 07:21:28 UTC) #20
tzik
Updated. Could you guys take another look?
4 years, 6 months ago (2016-06-22 08:25:08 UTC) #22
tzik
https://codereview.chromium.org/2049003002/diff/120001/third_party/WebKit/Source/core/dom/ExecutionContext.cpp File third_party/WebKit/Source/core/dom/ExecutionContext.cpp (right): https://codereview.chromium.org/2049003002/diff/120001/third_party/WebKit/Source/core/dom/ExecutionContext.cpp#newcode97 third_party/WebKit/Source/core/dom/ExecutionContext.cpp:97: postTask(BLINK_FROM_HERE, createSameThreadTask(&ExecutionContext::runSuspendableTasks, wrapCrossThreadPersistent(this))); On 2016/06/22 06:27:43, haraken wrote: > ...
4 years, 6 months ago (2016-06-22 08:26:04 UTC) #23
haraken
LGTM
4 years, 6 months ago (2016-06-22 09:35:55 UTC) #24
sof
lgtm Could we remove WTF::PointerParamStorageTraits<T*, true> following these changes? https://codereview.chromium.org/2049003002/diff/140001/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp File third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp (right): https://codereview.chromium.org/2049003002/diff/140001/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp#newcode117 third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp:117: ...
4 years, 6 months ago (2016-06-22 09:39:22 UTC) #26
Yuta Kitamura
lgtm modulo sof's comments
4 years, 6 months ago (2016-06-22 10:14:11 UTC) #27
tzik
https://codereview.chromium.org/2049003002/diff/140001/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp File third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp (right): https://codereview.chromium.org/2049003002/diff/140001/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp#newcode117 third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp:117: m_thread->postTask(BLINK_FROM_HERE, WTF::bind(&DatabaseThread::cleanupDatabaseThreadCompleted, wrapCrossThreadPersistent(this))); On 2016/06/22 09:39:22, sof wrote: > ...
4 years, 6 months ago (2016-06-22 10:16:02 UTC) #28
sof
https://codereview.chromium.org/2049003002/diff/140001/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp File third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp (right): https://codereview.chromium.org/2049003002/diff/140001/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp#newcode117 third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp:117: m_thread->postTask(BLINK_FROM_HERE, WTF::bind(&DatabaseThread::cleanupDatabaseThreadCompleted, wrapCrossThreadPersistent(this))); On 2016/06/22 10:16:01, tzik wrote: > ...
4 years, 6 months ago (2016-06-22 13:24:28 UTC) #29
tzik
https://codereview.chromium.org/2049003002/diff/140001/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp File third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp (right): https://codereview.chromium.org/2049003002/diff/140001/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp#newcode117 third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp:117: m_thread->postTask(BLINK_FROM_HERE, WTF::bind(&DatabaseThread::cleanupDatabaseThreadCompleted, wrapCrossThreadPersistent(this))); On 2016/06/22 13:24:27, sof wrote: > ...
4 years, 6 months ago (2016-06-22 13:56:51 UTC) #30
sof
https://codereview.chromium.org/2049003002/diff/140001/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp File third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp (right): https://codereview.chromium.org/2049003002/diff/140001/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp#newcode117 third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp:117: m_thread->postTask(BLINK_FROM_HERE, WTF::bind(&DatabaseThread::cleanupDatabaseThreadCompleted, wrapCrossThreadPersistent(this))); On 2016/06/22 13:56:51, tzik wrote: > ...
4 years, 6 months ago (2016-06-22 14:06:50 UTC) #31
tzik
On 2016/06/22 14:06:50, sof wrote: > https://codereview.chromium.org/2049003002/diff/140001/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp > File third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp (right): > > https://codereview.chromium.org/2049003002/diff/140001/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp#newcode117 > ...
4 years, 6 months ago (2016-06-22 14:32:49 UTC) #32
sof
On 2016/06/22 14:32:49, tzik wrote: > On 2016/06/22 14:06:50, sof wrote: > > > https://codereview.chromium.org/2049003002/diff/140001/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp ...
4 years, 6 months ago (2016-06-22 14:49:22 UTC) #33
hiroshige
lgtm. Use of CrossThreadPersistent with same-thread WTF::bind() looks complicated, but it is a general issue ...
4 years, 6 months ago (2016-06-23 04:48:27 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2049003002/160001
4 years, 6 months ago (2016-06-23 05:30:37 UTC) #37
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 6 months ago (2016-06-23 07:46:21 UTC) #39
commit-bot: I haz the power
4 years, 6 months ago (2016-06-23 07:48:49 UTC) #41
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/8359caf0b6a4b86949be98b12147c926fb58d2a8
Cr-Commit-Position: refs/heads/master@{#401558}

Powered by Google App Engine
This is Rietveld 408576698