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

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

Issue 2951753002: Replace a DCHECK in BVC with an early return. (Closed)
Patch Set: comments Created 3 years, 6 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser/ui/browser_view_controller.h" 5 #import "ios/chrome/browser/ui/browser_view_controller.h"
6 6
7 #import <AssetsLibrary/AssetsLibrary.h> 7 #import <AssetsLibrary/AssetsLibrary.h>
8 #import <MobileCoreServices/MobileCoreServices.h> 8 #import <MobileCoreServices/MobileCoreServices.h>
9 #import <PassKit/PassKit.h> 9 #import <PassKit/PassKit.h>
10 #import <Photos/Photos.h> 10 #import <Photos/Photos.h>
(...skipping 4386 matching lines...) Expand 10 before | Expand all | Expand 10 after
4397 __weak BrowserViewController* weakSelf = self; 4397 __weak BrowserViewController* weakSelf = self;
4398 Tab* currentTab = [_model currentTab]; 4398 Tab* currentTab = [_model currentTab];
4399 if (currentTab) { 4399 if (currentTab) {
4400 FindTabHelper::FromWebState(currentTab.webState)->StopFinding(^{ 4400 FindTabHelper::FromWebState(currentTab.webState)->StopFinding(^{
4401 [weakSelf updateFindBar:NO shouldFocus:NO]; 4401 [weakSelf updateFindBar:NO shouldFocus:NO];
4402 }); 4402 });
4403 } 4403 }
4404 } 4404 }
4405 4405
4406 - (void)updateFindBar:(BOOL)initialUpdate shouldFocus:(BOOL)shouldFocus { 4406 - (void)updateFindBar:(BOOL)initialUpdate shouldFocus:(BOOL)shouldFocus {
4407 DCHECK([_model currentTab]); 4407 // TODO(crbug.com/731045): This early return temporarily replaces a DCHECK.
4408 // For unknown reasons, this DCHECK sometimes was hit in the wild, resulting
4409 // in a crash.
4410 if (![_model currentTab]) {
4411 return;
4412 }
4408 auto* helper = FindTabHelper::FromWebState([_model currentTab].webState); 4413 auto* helper = FindTabHelper::FromWebState([_model currentTab].webState);
4409 if (helper && helper->IsFindUIActive()) { 4414 if (helper && helper->IsFindUIActive()) {
4410 if (initialUpdate && !_isOffTheRecord) { 4415 if (initialUpdate && !_isOffTheRecord) {
4411 helper->RestoreSearchTerm(); 4416 helper->RestoreSearchTerm();
4412 } 4417 }
4413 4418
4414 [self setFramesForHeaders:[self headerViews] 4419 [self setFramesForHeaders:[self headerViews]
4415 atOffset:[self currentHeaderOffset]]; 4420 atOffset:[self currentHeaderOffset]];
4416 [_findBarController updateView:helper->GetFindResult() 4421 [_findBarController updateView:helper->GetFindResult()
4417 initialUpdate:initialUpdate 4422 initialUpdate:initialUpdate
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
5240 5245
5241 - (UIView*)voiceSearchButton { 5246 - (UIView*)voiceSearchButton {
5242 return _voiceSearchButton; 5247 return _voiceSearchButton;
5243 } 5248 }
5244 5249
5245 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { 5250 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
5246 return [self currentLogoAnimationControllerOwner]; 5251 return [self currentLogoAnimationControllerOwner];
5247 } 5252 }
5248 5253
5249 @end 5254 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698