• Samuel Huang's avatar
    [DevUI DFM] Add API and backend to install and load the DFM. · 568a975f
    Samuel Huang authored
    This CL adds DevUiModuleProvider classes (Java and C++) as backend to
    install and load the DevUI DFM. The C++ API must be called from the UI
    thread. It consists of query helpers:
    * DevUiModuleProvider::GetInstance().ModuleInstalled(),
    * DevUiModuleProvider::GetInstance().ModuleLoaded(),
    and asynchronous (i.e., takes callbacks) actions:
    * DevUiModuleProvider::GetInstance().InstallModule(),
    * DevUiModuleProvider::GetInstance().LoadModule().
    
    The Java backend handles DFM installation, and implements standard
    on-demand DFM installation flow. For simplicity, no Java UI elements
    (e.g., using Toast or InfoBar) as used. Instead, an interstitial page
    that calls the C++ API will be used.
    
    Some sources of complexity, also encountered by VrModuleProvider (upon
    which the code is based) are:
    * Interaction between C++ and Java DevUiModuleProvider via JNI calls
      and interaction between the singletons.
    * Queue management for InstallModule() and LoadModule(), to handle the
      corner case of multiple concurrent install / load requests.
    
    Bug: 927131
    Change-Id: I4a6f3e4209857542a63e49ff79871a50bc5da4ab
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769170
    Commit-Queue: Samuel Huang <huangs@chromium.org>
    Reviewed-by: default avatarNico Weber <thakis@chromium.org>
    Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#692087}
    568a975f
BUILD.gn 115 KB