New issue
Advanced search Search tips

Issue 798685 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Task



Sign in to add a comment

[iOS] No longer necessary to end notification center observation on dealloc.

Project Member Reported by marq@chromium.org, Jan 3 2018

Issue description

As of iOS9, it is no longer an error for an object observing NSNotifications to deallocate.

Thus, any calls to [[NSNotificationCenter defaultCenter] removeObserver:self] in -dealloc methods in iOS Chrome code (which is only running on iOS10+) can be removed. In many cases, this call is the only reason to have a -dealloc implementation at all.



 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7cc1ca383389e75de5af73ed73adeed7561877e9

commit 7cc1ca383389e75de5af73ed73adeed7561877e9
Author: Mark Cogan <marq@google.com>
Date: Wed Jan 03 17:56:32 2018

[iOS] Remove NSNotification un-observing in deallocs in ios/chrome/

As of iOS 9, it's not necessary to stop observing notifications on
dealloc.

Bug:  798685 
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ib1a330d9dc9145fc9d5c546f0eca1b6faec401f8
Reviewed-on: https://chromium-review.googlesource.com/848932
Reviewed-by: Stepan Khapugin <stkhapugin@chromium.org>
Commit-Queue: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526732}
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/app/chrome_overlay_window.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/app/main_controller.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/autofill/form_input_accessory_view_controller.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/find_in_page/find_in_page_controller.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/geolocation/location_manager.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/memory/memory_debugger.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/prerender/preload_controller.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/ui/authentication/chrome_signin_view_controller.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/ui/browser_view_controller.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/ui/fullscreen/legacy_fullscreen_controller.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/ui/ntp/new_tab_page_controller.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/ui/omnibox/omnibox_popup_view_controller.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/ui/settings/accounts_collection_view_controller.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/ui/settings/autofill_edit_collection_view_controller.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/ui/settings/password_details_collection_view_controller.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/ui/voice/text_to_speech_player.mm
[modify] https://crrev.com/7cc1ca383389e75de5af73ed73adeed7561877e9/ios/chrome/browser/ui/voice/text_to_speech_player_unittest.mm

Comment 2 by marq@chromium.org, Mar 29 2018

Status: Fixed (was: Assigned)

Sign in to add a comment