• Hongchan Choi's avatar
    Initialize sampleRate in AudioWorkletGlobalScope upon construction · 70d15d5d
    Hongchan Choi authored
    This CL changes how |sampleRate| in AudioWorkletGlobalScope is updated.
    
    Previously, the sample rate was updated when the first processor was
    created, thus accessing the sample rate in the class definition phase
    gives 0 value. With this CL, the sample rate is initialized as soon
    as the global scope is created, before the script is loaded/parsed.
    
    Bug: 815313
    Test: http/tests/webaudio/audio-worklet/global-sample-rate.html
    Change-Id: I994ee70c10ed93618b28c7d29df42b5d458c74f8
    Reviewed-on: https://chromium-review.googlesource.com/935747
    Commit-Queue: Hongchan Choi <hongchan@chromium.org>
    Reviewed-by: default avatarRaymond Toy <rtoy@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#539254}
    70d15d5d
AudioWorkletGlobalScope.cpp 15.4 KB