• Etienne Bergeron's avatar
    Ensures TTS platform is not null · e0987ee4
    Etienne Bergeron authored
    This CL is moving a branch to a DCHECK.
    
    The GetTtsPlatform() can't safely be null since other piece of code
    in the same file are using the pointer without any safety check.
    
    Example:
      if (GetTtsPlatform()->PlatformImplAvailable()) {
        GetTtsPlatform()->ClearError();
        GetTtsPlatform()->StopSpeaking();
      }
    
    After reading the code, I came to the conclusion that it can't be
    null.
    
    The TtsPlatform::GetInstance(...) will take the tts platform
    from:
      GetContentClient()->browser()->GetTtsPlatform();
    If this is null, it will returns:
     TtsPlatformImpl::GetInstance() instead.
    
    Each platform has the proper implementation PlatformImpl.
    
    Change-Id: Ib4e88dd1be3b557dd30c3c55041e7d8d4f0e1401
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2438198
    Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
    Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
    Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#812254}
    e0987ee4
tts_controller_impl.cc 25.7 KB