• Raphael Kubo da Costa's avatar
    sensors: Ensure a document without an associated frame does not crash · c30292f9
    Raphael Kubo da Costa authored
    Commit d1034e1e ("sensors: Make SensorProviderProxy supplement Document,
    not LocalFrame") tied a sensor's lifetime to a document rather than a frame,
    but we continued to assume Document::GetFrame() would never return null.
    
    This is not true, as evidenced by the crash reports in bug 889754, caused by
    SensorProxy::ShouldSuspendUpdates() trying to invoke methods on a LocalFrame
    that can actually be a nullptr.
    
    The original backtrace in the bug report seems to come from sensor creation,
    but it is easier to trigger the same crash with a focus change after
    destroying a sensor's document's frame.
    
    Bug: 861675, 889754
    Change-Id: Idb9ed5c18a655e113e2fb76cde6615aeefcc544a
    Reviewed-on: https://chromium-review.googlesource.com/1256826Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
    Commit-Queue: Raphael Kubo da Costa (CET) <raphael.kubo.da.costa@intel.com>
    Cr-Commit-Position: refs/heads/master@{#595958}
    c30292f9
Magnetometer-iframe-access.https-expected.txt 764 Bytes