• Side Yilmaz's avatar
    Use correct profile_key in DownloadController. · 789341a3
    Side Yilmaz authored
    DownloadController defaults profile key to regular profile key in case
    of the profile is not reachable over download item. This CL changes the
    logic as below to prevent using regular profile key in incognito mode:
    - If download item provides a profile, use its key.
    - If not, get key from ProfileKeyStartupAccessor, as this means the code
    block runs in reduced mode.
    - If there is no key from ProfileKeyStartupAccessor, this means the
    incognito tab is closed and download will be destroyed when incognito
    goes away. In this case, just return.
    
    Bug: 1041781, 1075562
    Change-Id: Id53485735891d9089cbf1e7a1c8c6e43cabc84a5
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2413947
    Commit-Queue: Side YILMAZ <sideyilmaz@chromium.org>
    Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#809273}
    789341a3
download_controller.cc 19.1 KB