• Matt Menke's avatar
    HttpServerPropertiesManager: Remove use of two threads. · 258cfcba
    Matt Menke authored
    All consumers now use a single thread for prefs and the network stack,
    so there's no need for it to have thread hopping logic.
    
    This also makes HttpServerPropertiesManager better support the case
    where prefs aren't loaded when it's created (Always the case in
    consumers), and makes it flush to prefs on destruction, which can
    now be done, since the net and prefs threads are the same.
    
    This also fixes a crasher in the single-thread case, due to the use of
    base::Unretained when calling from the prefs thread to the network
    thread, which doesn't work when they're the same thread.
    
    Bug: 768884, 770179
    NOPRESUBMIT=true
    (Unfortunately, the tests use banned APIs. This use predates this CL,
        and this CL doesn't introduce new uses of them. Fixing a crasher
        is more important than removing banned APIs).
    
    Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
    Change-Id: I2692e3c02ff6028b585416808b60cabcf9d2e2e6
    Reviewed-on: https://chromium-review.googlesource.com/693054Reviewed-by: default avatarAndrei Kapishnikov <kapishnikov@chromium.org>
    Reviewed-by: default avatarDavid Roger <droger@chromium.org>
    Reviewed-by: default avatarBence Béky <bnc@chromium.org>
    Commit-Queue: Matt Menke <mmenke@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#506897}
    258cfcba
http_server_properties_manager.cc 52.2 KB