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

Issue 1617383003: Move PlatformSpeechSynthesisVoice off the heap. (Closed)

Created:
4 years, 11 months ago by sof
Modified:
4 years, 11 months ago
CC:
blink-reviews, chromium-reviews, kinuko+watch
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Keep PlatformSpeechSynthesisVoice off the Oilpan heap. Keeping this object on the heap makes some sense in terms of regularity: all the other Blink objects that refer to it are on the heap. However, it is problematic to do so for this value object considering how the embedder might use its WebSpeechSynthesisVoice wrapper object. That is, creating or allocating a WebSpeechSynthesisVoice on the stack by the embedder will bring about a heap allocation, which in turn can trigger a GC when the embedder isn't prepared for that -- see associated bug for stack trace and details. This is normally a detail the embedder doesn't need to worry about, but as TtsDispatcher keeps an (unsavory) weak reference to its speech synthesizer client we're forced to consider GC safety and take that into account. Embedder code that keep these bare, but intended weak, references to Oilpan heap objects should be reworked into something safer, but to address this local problem, PlatformSpeechSynthesisVoice is moved off the heap where it can reside just as well. By doing so, WebSpeechSynthesisVoice allocations won't allocate on the Oilpan heap, avoid said GC unsafety. R=dmazzoni,jochen BUG=539511 Committed: https://crrev.com/3ebb67d8abcd3d39dc4d67947dfc6a586583fc7e Cr-Commit-Position: refs/heads/master@{#370960}

Patch Set 1 #

Patch Set 2 : fix oilpan compilation #

Messages

Total messages: 20 (10 generated)
sof
please take a look. TtsDispatcher::OnSetVoiceList() is the only problematic method; WebSpeechSynthesisUtterance usage in its other ...
4 years, 11 months ago (2016-01-22 12:17:07 UTC) #5
dmazzoni
lgtm Thanks, this makes sense. It sounds like a better solution would be for TtsDispatcher ...
4 years, 11 months ago (2016-01-22 14:04:18 UTC) #6
sof
On 2016/01/22 14:04:18, dmazzoni wrote: > lgtm > > Thanks, this makes sense. It sounds ...
4 years, 11 months ago (2016-01-22 14:10:43 UTC) #7
sof
Need Source/platform/ approval to land this - jochen@ wouldn't happen to be around..? :)
4 years, 11 months ago (2016-01-22 14:14:22 UTC) #9
jochen (gone - plz use gerrit)
lgtm
4 years, 11 months ago (2016-01-22 14:18:37 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1617383003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1617383003/20001
4 years, 11 months ago (2016-01-22 14:20:06 UTC) #14
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 11 months ago (2016-01-22 14:24:33 UTC) #16
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/3ebb67d8abcd3d39dc4d67947dfc6a586583fc7e Cr-Commit-Position: refs/heads/master@{#370960}
4 years, 11 months ago (2016-01-22 14:25:32 UTC) #18
haraken
LGTM
4 years, 11 months ago (2016-01-22 15:24:52 UTC) #19
sof
4 years, 11 months ago (2016-01-25 22:04:47 UTC) #20
Message was sent while issue was closed.
On 2016/01/22 14:10:43, sof wrote:
> On 2016/01/22 14:04:18, dmazzoni wrote:
> > lgtm
> > 
> > Thanks, this makes sense. It sounds like a better solution would be for
> > TtsDispatcher to have a true weak reference to WebSpeechSynthesizerClient.
> > 
> > Would it work if WebSpeechSynthesizerClient is a wrapper class where the
> > WebSpeechSynthesizerClientImpl is a weak member?
> 
> thanks; not having thought this through, but a WebPrivatePtr<> which allowed a
> WeakPersistent<> to be kept/wrapped, might be a way to do it. That
> WebSpeechSynthesizerClient layer would then have to check & delegate.

https://codereview.chromium.org/1618043003/ extends WebPrivatePtr<> to support
weak persistent references.

Powered by Google App Engine
This is Rietveld 408576698