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

Issue 253563002: [webcrypto] Make it safe to delete WebCryptoResult from any thread. (Closed)

Created:
6 years, 8 months ago by eroman
Modified:
6 years, 8 months ago
Reviewers:
abarth-chromium
CC:
blink-reviews, jamesr, dglazkov+blink
Visibility:
Public.

Description

[webcrypto] Make it safe to delete WebCryptoResult from any thread. It used to be that WebCrytoResult had to be deleted from the original Blink thread which created it. This posed a challenge for embedders that wanted to defer the work to a background thread. Since it was possible that by the time the work had completed, the original Blink thread was gone (if it was a WebWorker). The approach taken in this changelist is to split out the state tied to an ExecutionContext into a separate WeakPtr which deletes itself on request completion, or when the ExecutionContext is destroyed. BUG=366840, 245025 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=172696

Patch Set 1 #

Patch Set 2 : Use WeakPtr #

Total comments: 2

Patch Set 3 : Make constructor take ExecutionContext #

Patch Set 4 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+115 lines, -100 lines) Patch
M Source/modules/crypto/CryptoResultImpl.h View 1 2 2 chunks +16 lines, -24 lines 0 comments Download
M Source/modules/crypto/CryptoResultImpl.cpp View 1 2 2 chunks +90 lines, -69 lines 0 comments Download
M Source/platform/CryptoResult.h View 1 chunk +2 lines, -2 lines 0 comments Download
M public/platform/WebCrypto.h View 1 2 3 1 chunk +7 lines, -5 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
eroman
I am not sure if this is the best way to address my problem, please ...
6 years, 8 months ago (2014-04-25 02:33:36 UTC) #1
abarth-chromium
This seems quite error prone... I wonder, instead of using RefCountedThreadSafe, can you use WeakPtr? ...
6 years, 8 months ago (2014-04-25 03:49:45 UTC) #2
eroman
Thanks Adam. To make sure I understand the proposal, are you suggesting that: * blink::WebCryptoResult ...
6 years, 8 months ago (2014-04-25 18:27:28 UTC) #3
abarth-chromium
On 2014/04/25 18:27:28, eroman wrote: > Thanks Adam. To make sure I understand the proposal, ...
6 years, 8 months ago (2014-04-25 19:30:14 UTC) #4
eroman
PTAL, updated to use WeakPtr
6 years, 8 months ago (2014-04-25 22:24:14 UTC) #5
abarth-chromium
LGTM You might want to update the CL description to explain what you ended up ...
6 years, 8 months ago (2014-04-25 23:26:13 UTC) #6
eroman
Updated the description. https://codereview.chromium.org/253563002/diff/20001/Source/modules/crypto/CryptoResultImpl.cpp File Source/modules/crypto/CryptoResultImpl.cpp (right): https://codereview.chromium.org/253563002/diff/20001/Source/modules/crypto/CryptoResultImpl.cpp#newcode62 Source/modules/crypto/CryptoResultImpl.cpp:62: ExecutionContext* context = callingExecutionContext(v8::Isolate::GetCurrent()); On 2014/04/25 ...
6 years, 8 months ago (2014-04-26 00:23:43 UTC) #7
abarth-chromium
lgtm
6 years, 8 months ago (2014-04-26 01:25:03 UTC) #8
eroman
The CQ bit was checked by eroman@chromium.org
6 years, 8 months ago (2014-04-26 01:52:08 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eroman@chromium.org/253563002/80001
6 years, 8 months ago (2014-04-26 01:57:58 UTC) #10
commit-bot: I haz the power
6 years, 8 months ago (2014-04-26 03:29:42 UTC) #11
Message was sent while issue was closed.
Change committed as 172696

Powered by Google App Engine
This is Rietveld 408576698