 Chromium Code Reviews
 Chromium Code Reviews Issue 2566993002:
  [ObjC ARC] Converts ios/chrome/browser:browser to ARC.  (Closed)
    
  
    Issue 2566993002:
  [ObjC ARC] Converts ios/chrome/browser:browser to ARC.  (Closed) 
  | OLD | NEW | 
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/browser/root_coordinator.h" | 5 #import "ios/chrome/browser/root_coordinator.h" | 
| 6 | 6 | 
| 7 #include "base/ios/weak_nsobject.h" | |
| 8 #include "base/logging.h" | 7 #include "base/logging.h" | 
| 9 | 8 | 
| 9 #if !defined(__has_feature) || !__has_feature(objc_arc) | |
| 10 #error "This file requires ARC support." | |
| 11 #endif | |
| 12 | |
| 10 @interface RootCoordinator () { | 13 @interface RootCoordinator () { | 
| 11 base::WeakNSObject<UIWindow> _window; | 14 __weak UIWindow* _window; | 
| 
sdefresne
2016/12/12 19:37:00
I think you can synthesize this property.
@synthe
 
stkhapugin
2016/12/13 13:31:11
Done.
 | |
| 12 } | 15 } | 
| 13 @end | 16 @end | 
| 14 | 17 | 
| 15 @implementation RootCoordinator | 18 @implementation RootCoordinator | 
| 16 | 19 | 
| 17 - (instancetype)initWithWindow:(UIWindow*)window { | 20 - (instancetype)initWithWindow:(UIWindow*)window { | 
| 18 if ((self = [super initWithBaseViewController:nil])) { | 21 if ((self = [super initWithBaseViewController:nil])) { | 
| 19 _window.reset(window); | 22 _window = window; | 
| 20 } | 23 } | 
| 21 return self; | 24 return self; | 
| 22 } | 25 } | 
| 23 | 26 | 
| 24 - (instancetype)initWithBaseViewController:(UIViewController*)viewController { | 27 - (instancetype)initWithBaseViewController:(UIViewController*)viewController { | 
| 25 NOTREACHED(); | 28 NOTREACHED(); | 
| 26 return nil; | 29 return nil; | 
| 27 } | 30 } | 
| 28 | 31 | 
| 29 #pragma mark - property implementation | 32 #pragma mark - property implementation | 
| 30 | 33 | 
| 31 - (nullable UIWindow*)window { | 34 - (nullable UIWindow*)window { | 
| 32 return _window; | 35 return _window; | 
| 33 } | 36 } | 
| 34 | 37 | 
| 35 @end | 38 @end | 
| OLD | NEW |