• Michael Giuffrida's avatar
    WindowActivityWatcher: Verify browser window exists · 3c2815cf
    Michael Giuffrida authored
    It's apparently possible for
    BrowserList::SetLastActive(Browser* browser) to be called before
    |browser| is added to the BrowserList. This might happen, e.g., if a
    BrowserView's widget receives an activation event before
    CreateBrowserWindow() returns.
    
    This will cause WindowActivityWatcher's UpdateMetrics() helper function
    to dereference the null pointer at browser->window().
    
    Bug: 811243,811191
    Change-Id: Ia377a810b73494f88d1cd2b4532367950f35b1f7
    Reviewed-on: https://chromium-review.googlesource.com/924353
    Commit-Queue: Michael Giuffrida <michaelpg@chromium.org>
    Reviewed-by: default avatarScott Violet <sky@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#537825}
    3c2815cf
window_activity_watcher.cc 7.47 KB