[ios] Ensure _largeIconTaskTracker is destroyed in -shutdown
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:Olivier Robin <olivierrobin@chromium.org> Reviewed-by:
Mark Cogan <marq@chromium.org> Auto-Submit: Sylvain Defresne <sdefresne@chromium.org> Cr-Commit-Position: refs/heads/master@{#804952}
Showing
Please register or sign in to comment