• Benedikt Meurer's avatar
    [devtools] Introduce and consistently use `CallClientMethod` helper. · d4f8a728
    Benedikt Meurer authored
    This refactors the `CallClientFunction` helper method into a new helper
    method `CallClientMethod`, which takes separate object and method name,
    and the arguments (as base::Values), with the intention of sending that
    information to the renderer in a second step, instead of generating a
    string with all the above embedded in it, which is then send to V8 as a
    new script.
    
    The motivation is that sending every single protocol message as a new
    script causes a lot of churn on the renderer, not only regarding the
    runtime performance, but also trashing the memory and resulting in
    fragmentation that can be avoided.
    
    Drive-by-refactoring: Reduce friction around the variable number of
    parameters passed to `CallClientMethod` and avoid the need to pass
    base::Value as pointers. This improves code readability a bit.
    
    Bug: chromium:1029427
    Change-Id: I5ac578e2071d7ba63b9b42dff7e3b137a9908043
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2042713
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
    Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#739363}
    d4f8a728
devtools_ui_bindings.cc 57.5 KB