Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: ios/chrome/app/main_controller.mm

Issue 2881183002: Revert of Replace ObjCPropertyReleaser with ReleaseProperties() project-wide. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/chrome/app/main_controller.h" 5 #import "ios/chrome/app/main_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #import <CoreSpotlight/CoreSpotlight.h> 10 #import <CoreSpotlight/CoreSpotlight.h>
11 #import <objc/objc.h> 11 #import <objc/objc.h>
12 #import <objc/runtime.h> 12 #import <objc/runtime.h>
13 13
14 #include "base/bind.h" 14 #include "base/bind.h"
15 #include "base/callback_helpers.h" 15 #include "base/callback_helpers.h"
16 #include "base/files/file_path.h" 16 #include "base/files/file_path.h"
17 #include "base/ios/block_types.h" 17 #include "base/ios/block_types.h"
18 #import "base/mac/bind_objc_block.h" 18 #import "base/mac/bind_objc_block.h"
19 #include "base/mac/bundle_locations.h" 19 #include "base/mac/bundle_locations.h"
20 #include "base/mac/foundation_util.h" 20 #include "base/mac/foundation_util.h"
21 #include "base/mac/objc_release_properties.h" 21 #include "base/mac/objc_property_releaser.h"
22 #import "base/mac/scoped_nsobject.h" 22 #import "base/mac/scoped_nsobject.h"
23 #include "base/macros.h" 23 #include "base/macros.h"
24 #include "base/path_service.h" 24 #include "base/path_service.h"
25 #include "base/strings/sys_string_conversions.h" 25 #include "base/strings/sys_string_conversions.h"
26 #include "base/time/time.h" 26 #include "base/time/time.h"
27 #include "components/component_updater/component_updater_service.h" 27 #include "components/component_updater/component_updater_service.h"
28 #include "components/content_settings/core/browser/host_content_settings_map.h" 28 #include "components/content_settings/core/browser/host_content_settings_map.h"
29 #include "components/metrics/metrics_pref_names.h" 29 #include "components/metrics/metrics_pref_names.h"
30 #include "components/metrics/metrics_service.h" 30 #include "components/metrics/metrics_service.h"
31 #include "components/prefs/pref_change_registrar.h" 31 #include "components/prefs/pref_change_registrar.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 #import "ios/chrome/browser/ui/webui/chrome_web_ui_ios_controller_factory.h" 125 #import "ios/chrome/browser/ui/webui/chrome_web_ui_ios_controller_factory.h"
126 #include "ios/chrome/browser/xcallback_parameters.h" 126 #include "ios/chrome/browser/xcallback_parameters.h"
127 #include "ios/net/cookies/cookie_store_ios.h" 127 #include "ios/net/cookies/cookie_store_ios.h"
128 #import "ios/net/crn_http_protocol_handler.h" 128 #import "ios/net/crn_http_protocol_handler.h"
129 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" 129 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
130 #include "ios/public/provider/chrome/browser/distribution/app_distribution_provi der.h" 130 #include "ios/public/provider/chrome/browser/distribution/app_distribution_provi der.h"
131 #import "ios/public/provider/chrome/browser/native_app_launcher/native_app_white list_manager.h" 131 #import "ios/public/provider/chrome/browser/native_app_launcher/native_app_white list_manager.h"
132 #include "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" 132 #include "ios/public/provider/chrome/browser/signin/chrome_identity_service.h"
133 #import "ios/public/provider/chrome/browser/user_feedback/user_feedback_provider .h" 133 #import "ios/public/provider/chrome/browser/user_feedback/user_feedback_provider .h"
134 #import "ios/third_party/material_components_ios/src/components/Typography/src/M aterialTypography.h" 134 #import "ios/third_party/material_components_ios/src/components/Typography/src/M aterialTypography.h"
135 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF ontLoader.h"
135 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MDCTypographyAd ditions/MDFRobotoFontLoader+MDCTypographyAdditions.h" 136 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MDCTypographyAd ditions/MDFRobotoFontLoader+MDCTypographyAdditions.h"
136 #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoF ontLoader.h"
137 #include "ios/web/net/request_tracker_factory_impl.h" 137 #include "ios/web/net/request_tracker_factory_impl.h"
138 #include "ios/web/net/request_tracker_impl.h" 138 #include "ios/web/net/request_tracker_impl.h"
139 #include "ios/web/net/web_http_protocol_handler_delegate.h" 139 #include "ios/web/net/web_http_protocol_handler_delegate.h"
140 #import "ios/web/public/navigation_manager.h" 140 #import "ios/web/public/navigation_manager.h"
141 #include "ios/web/public/web_capabilities.h" 141 #include "ios/web/public/web_capabilities.h"
142 #include "ios/web/public/web_state/web_state.h" 142 #include "ios/web/public/web_state/web_state.h"
143 #import "ios/web/public/web_view_creation_util.h" 143 #import "ios/web/public/web_view_creation_util.h"
144 #include "ios/web/public/webui/web_ui_ios_controller_factory.h" 144 #include "ios/web/public/webui/web_ui_ios_controller_factory.h"
145 #include "mojo/edk/embedder/embedder.h" 145 #include "mojo/edk/embedder/embedder.h"
146 #import "net/base/mac/url_conversions.h" 146 #import "net/base/mac/url_conversions.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 PrefChangeRegistrar _localStatePrefChangeRegistrar; 324 PrefChangeRegistrar _localStatePrefChangeRegistrar;
325 325
326 // Clears browsing data from ChromeBrowserStates. 326 // Clears browsing data from ChromeBrowserStates.
327 base::scoped_nsobject<BrowsingDataRemovalController> 327 base::scoped_nsobject<BrowsingDataRemovalController>
328 _browsingDataRemovalController; 328 _browsingDataRemovalController;
329 329
330 // The class in charge of showing/hiding the memory debugger when the 330 // The class in charge of showing/hiding the memory debugger when the
331 // appropriate pref changes. 331 // appropriate pref changes.
332 base::scoped_nsobject<MemoryDebuggerManager> _memoryDebuggerManager; 332 base::scoped_nsobject<MemoryDebuggerManager> _memoryDebuggerManager;
333 333
334 base::mac::ObjCPropertyReleaser _propertyReleaser_MainController;
335
334 // Responsible for indexing chrome links (such as bookmarks, most likely...) 336 // Responsible for indexing chrome links (such as bookmarks, most likely...)
335 // in system Spotlight index. 337 // in system Spotlight index.
336 base::scoped_nsobject<SpotlightManager> _spotlightManager; 338 base::scoped_nsobject<SpotlightManager> _spotlightManager;
337 339
338 // Cached launchOptions from -didFinishLaunchingWithOptions. 340 // Cached launchOptions from -didFinishLaunchingWithOptions.
339 base::scoped_nsobject<NSDictionary> _launchOptions; 341 base::scoped_nsobject<NSDictionary> _launchOptions;
340 342
341 // View controller for displaying the history panel. 343 // View controller for displaying the history panel.
342 base::scoped_nsobject<UIViewController> _historyPanelViewController; 344 base::scoped_nsobject<UIViewController> _historyPanelViewController;
343 345
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 _startVoiceSearchAfterTabSwitcherDismissal; 542 _startVoiceSearchAfterTabSwitcherDismissal;
541 @synthesize startQRScannerAfterTabSwitcherDismissal = 543 @synthesize startQRScannerAfterTabSwitcherDismissal =
542 _startQRScannerAfterTabSwitcherDismissal; 544 _startQRScannerAfterTabSwitcherDismissal;
543 @synthesize startFocusOmniboxAfterTabSwitcherDismissal = 545 @synthesize startFocusOmniboxAfterTabSwitcherDismissal =
544 _startFocusOmniboxAfterTabSwitcherDismissal; 546 _startFocusOmniboxAfterTabSwitcherDismissal;
545 547
546 #pragma mark - Application lifecycle 548 #pragma mark - Application lifecycle
547 549
548 - (instancetype)init { 550 - (instancetype)init {
549 if ((self = [super init])) { 551 if ((self = [super init])) {
552 _propertyReleaser_MainController.Init(self, [MainController class]);
550 _startupTasks.reset([[StartupTasks alloc] init]); 553 _startupTasks.reset([[StartupTasks alloc] init]);
551 } 554 }
552 return self; 555 return self;
553 } 556 }
554 557
555 - (void)dealloc { 558 - (void)dealloc {
556 [[NSNotificationCenter defaultCenter] removeObserver:self]; 559 [[NSNotificationCenter defaultCenter] removeObserver:self];
557 net::HTTPProtocolHandlerDelegate::SetInstance(nullptr); 560 net::HTTPProtocolHandlerDelegate::SetInstance(nullptr);
558 net::RequestTracker::SetRequestTrackerFactory(nullptr); 561 net::RequestTracker::SetRequestTrackerFactory(nullptr);
559 [NSObject cancelPreviousPerformRequestsWithTarget:self]; 562 [NSObject cancelPreviousPerformRequestsWithTarget:self];
560 base::mac::ReleaseProperties(self);
561 [super dealloc]; 563 [super dealloc];
562 } 564 }
563 565
564 // This function starts up to only what is needed at each stage of the 566 // This function starts up to only what is needed at each stage of the
565 // initialization. It is possible to continue initialization later. 567 // initialization. It is possible to continue initialization later.
566 - (void)startUpBrowserToStage:(BrowserInitializationStageType)stage { 568 - (void)startUpBrowserToStage:(BrowserInitializationStageType)stage {
567 if (_browserInitializationStage < INITIALIZATION_STAGE_BASIC && 569 if (_browserInitializationStage < INITIALIZATION_STAGE_BASIC &&
568 stage >= INITIALIZATION_STAGE_BASIC) { 570 stage >= INITIALIZATION_STAGE_BASIC) {
569 [self startUpBrowserBasicInitialization]; 571 [self startUpBrowserBasicInitialization];
570 _browserInitializationStage = INITIALIZATION_STAGE_BASIC; 572 _browserInitializationStage = INITIALIZATION_STAGE_BASIC;
(...skipping 2051 matching lines...) Expand 10 before | Expand all | Expand 10 after
2622 }; 2624 };
2623 2625
2624 callbackCounter->IncrementCount(); 2626 callbackCounter->IncrementCount();
2625 [self removeBrowsingDataFromBrowserState:_mainBrowserState 2627 [self removeBrowsingDataFromBrowserState:_mainBrowserState
2626 mask:removeAllMask 2628 mask:removeAllMask
2627 timePeriod:browsing_data::TimePeriod::ALL_TIME 2629 timePeriod:browsing_data::TimePeriod::ALL_TIME
2628 completionHandler:decrementCallbackCounterCount]; 2630 completionHandler:decrementCallbackCounterCount];
2629 } 2631 }
2630 2632
2631 @end 2633 @end
OLDNEW
« no previous file with comments | « components/handoff/handoff_manager.mm ('k') | ios/chrome/browser/passwords/update_password_infobar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698