This function is added as the compiler seems to not handle pointers to pointers correctly in C++ functions with regards to ARC. Once all files are converted to ARC, this can be removed and the C++ function used.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326 commit 4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326 Author: Sylvain Defresne <sdefresne@chromium.org> Date: Mon Sep 18 14:16:34 2017 Convert __unsafe_unretained to __weak when possible. As (almost) all of the code is build with ARC enabled on iOS, convert uses of __unsafe_unretained to __weak. Two classes of uses are kept as they are imposed by the API: - NSInvocation - NSFastEnumeration Add a PRESUBMIT check to prevent adding new usages. Bug: 690057, 730062 Change-Id: Icc12bfcaa288df1a03846e4755fce64bd45e3a33 Reviewed-on: https://chromium-review.googlesource.com/668404 Reviewed-by: Eric Noyau <noyau@chromium.org> Reviewed-by: Stepan Khapugin <stkhapugin@chromium.org> Reviewed-by: Dirk Pranke <dpranke@chromium.org> Commit-Queue: Sylvain Defresne <sdefresne@chromium.org> Cr-Commit-Position: refs/heads/master@{#502572} [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/PRESUBMIT.py [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/autofill/form_input_egtest.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/autofill/form_suggestion_controller.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/content_suggestions/content_suggestions_service_bridge_observer.h [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/net/cookies_egtest.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/net/retryable_url_fetcher.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/prefs/pref_observer_bridge.h [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/signin/chrome_identity_service_observer_bridge.h [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/ui/autofill/autofill_edit_accessory_view.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/ui/contextual_search/contextual_search_header_view.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/ui/contextual_search/contextual_search_js_unittest.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/ui/elements/selector_coordinator.h [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/ui/elements/selector_coordinator.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/ui/elements/selector_picker_view_controller.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/ui/main/browser_view_wrangler.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/ui/page_info/page_info_view_controller.h [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/ui/settings/block_popups_egtest.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/ui/settings/save_passwords_collection_view_controller.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/ui/side_swipe/card_side_swipe_view.h [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/web/navigation_egtest.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/browser/web/window_open_by_dom_egtest.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/common/physical_web/physical_web_scanner.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/test/earl_grey/chrome_earl_grey.h [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/chrome/test/earl_grey/chrome_earl_grey.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/web/browser_state_web_view_partition_inttest.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/web/public/test/js_test_util.h [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/web/public/test/js_test_util.mm [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/web/public/web_state/web_state_observer_bridge.h [modify] https://crrev.com/4cf1d18ae046ec0fdcdb7fc56b3e12819f40f326/ios/web_view/internal/web_view_web_state_policy_decider.h
Comment 1 by eugene...@chromium.org
, Sep 14 2017Labels: -Type-Bug -Pri-2 Pri-3 Type-Task