• Sylvain Defresne's avatar
    [ios] Ensure _largeIconTaskTracker is destroyed in -shutdown · 0555c7e2
    Sylvain Defresne authored
    base::CancelableTaskTracker is sequence-affine. Since it is not
    possible to ensure that -dealloc is called at a specific point
    in time nor on a specific thread for an Objective-C instance,
    change _largeIconTaskTracker to be heap allocated and stored in
    a std::unique_ptr<> so that it can be destroyed from -shutdown.
    
    Add DCHECK that method accessing _largeIconTaskTracker are not
    called after -shutdown as been called (as they would otherwise
    try to dereference null which is Undefined Behaviour).
    
    Convert _pendingTasks to a std::set<URL> since the value are
    never used, and check that the scheduling of the task was a
    success before storing the object in _pendingTasks (failure
    probably mean that the sequence has been shutdown which only
    happen at app shutdown, so it is okay to do nothing in that
    case).
    
    Bug: 1122991
    Change-Id: I9f312bf6b8ac844e6a28d4e10042e9b9c1a7b529
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2388061
    Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
    Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
    Reviewed-by: default avatarMark Cogan <marq@chromium.org>
    Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#804952}
    0555c7e2
base_spotlight_manager.mm 10.8 KB