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

Side by Side Diff: ios/chrome/browser/ui/browser_container_view.mm

Issue 2798903003: [ObjC ARC] Converts ios/chrome/browser/ui:ui_internal to ARC. (Closed)
Patch Set: missing weaks from another patch Created 3 years, 8 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
« no previous file with comments | « ios/chrome/browser/ui/BUILD.gn ('k') | ios/chrome/browser/ui/browser_view_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ui/browser_container_view.h" 5 #import "ios/chrome/browser/ui/browser_container_view.h"
6 6
7 #import "base/ios/weak_nsobject.h" 7 #include "base/logging.h"
8 8
9 @implementation BrowserContainerView { 9 @implementation BrowserContainerView {
10 // Weak reference to content view, so old _contentView can be removed from 10 // Weak reference to content view, so old _contentView can be removed from
11 // superview when new one is added. 11 // superview when new one is added.
12 base::WeakNSObject<UIView> _contentView; 12 __weak UIView* _contentView;
13 } 13 }
14 14
15 - (void)dealloc { 15 - (void)dealloc {
16 DCHECK(![_contentView superview] || [_contentView superview] == self); 16 DCHECK(![_contentView superview] || [_contentView superview] == self);
17
18 [super dealloc];
19 } 17 }
20 18
21 - (void)displayContentView:(UIView*)contentView { 19 - (void)displayContentView:(UIView*)contentView {
22 DCHECK(![_contentView superview] || [_contentView superview] == self); 20 DCHECK(![_contentView superview] || [_contentView superview] == self);
23 [_contentView removeFromSuperview]; 21 [_contentView removeFromSuperview];
24 _contentView.reset(contentView); 22 _contentView = contentView;
25 23
26 if (contentView) { 24 if (contentView) {
27 [self addSubview:contentView]; 25 [self addSubview:contentView];
28 } 26 }
29 } 27 }
30 28
31 @end 29 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/BUILD.gn ('k') | ios/chrome/browser/ui/browser_view_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698