• Hongchan Choi's avatar
    Add currentFrame in AudioWorkletGlobalScope · d8b32f76
    Hongchan Choi authored
    This CL adds |currentFrame| property to AudioWorkletGlobalScope according
    to: https://github.com/WebAudio/web-audio-api/pull/1493.
    
    1. Previously the time stamp (currentTime) was updated when the first
       worklet processor gets called, and it was inconsistent with how it is
       updated in the other nodes. Now updating the frame number is
       streamlined, so the worklet processor also gets the same treatment.
    
    2. In order to streamline this process, WorkerThread reference was
       added to BaseAudioContext. Due to the GC rule, BaseAudioContext cannot
       keep a reference of WorkletGlobalScope, so it always derives the
       global scope from the worker thread.
    
    Bug: 814794
    Test: http/tests/webaudio/audio-worklet/timing-info.html
    Change-Id: I4b313377d80f8678c473cf788211e373fd1644cb
    Reviewed-on: https://chromium-review.googlesource.com/935157
    Commit-Queue: Hongchan Choi <hongchan@chromium.org>
    Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
    Reviewed-by: default avatarRaymond Toy <rtoy@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#539300}
    d8b32f76
AudioWorkletNode.cpp 14.2 KB