• Greg Kerr's avatar
    Fix non-signal-safe calls in BrokerClient · a722110a
    Greg Kerr authored
    The current BrokerClient is not signal-safe because of its use of base::Pickle
    which uses new and delete, and also its use of std::vector, which is not
    technically signal safe either. These are used in messaging IPCs with the
    BrokerHost when a syscall is trapped, thus BrokerClient must be made signal
    safe. This is discussed in https://crbug.com/255063.
    
    This CL creates a new BrokerSimpleMessage class to handle simple IPC messaging
    with strings and ints only. It uses fixed sized messages to simplify logic and
    allow it to allocate all its memory on the stack. It creates send, receive, and
    a synchronous send-and-receive method. It also adds a basic set of unit tests
    to sanity check behavior.
    
    Bug: 255063
    Change-Id: I8077a515921b62969a1b8b173d903f2a118ed186
    Reviewed-on: https://chromium-review.googlesource.com/553400
    Commit-Queue: Greg Kerr <kerrnel@chromium.org>
    Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
    Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#558415}
    a722110a
broker_host.cc 13.6 KB