| Index: ios/web/web_state/ui/crw_web_controller.mm
|
| diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
|
| index b23cfb16c1e4fef17d51286b85b821fd13d90438..faa73dfd8ad6f306f7405e63b3ecfea762337b1e 100644
|
| --- a/ios/web/web_state/ui/crw_web_controller.mm
|
| +++ b/ios/web/web_state/ui/crw_web_controller.mm
|
| @@ -277,8 +277,8 @@ WKWebViewErrorSource WKWebViewErrorSourceFromError(NSError* error) {
|
|
|
| std::unique_ptr<web::NewWindowInfo> _externalRequest;
|
|
|
| - // The WebStateImpl instance associated with this CRWWebController.
|
| - std::unique_ptr<WebStateImpl> _webStateImpl;
|
| + // Unowned WebStateImpl instance associated with this CRWWebController.
|
| + WebStateImpl* _webStateImpl;
|
|
|
| // A set of URLs opened in external applications; stored so that errors
|
| // from the web view can be identified as resulting from these events.
|
| @@ -578,12 +578,11 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| return [super allocWithZone:zone];
|
| }
|
|
|
| -- (instancetype)initWithWebState:(std::unique_ptr<WebStateImpl>)webState {
|
| +- (instancetype)initWithWebState:(WebStateImpl*)webState {
|
| self = [super init];
|
| if (self) {
|
| - _webStateImpl = std::move(webState);
|
| + _webStateImpl = webState;
|
| DCHECK(_webStateImpl);
|
| - _webStateImpl->SetWebController(self);
|
| _webStateImpl->InitializeRequestTracker(self);
|
| // Load phase when no WebView present is 'loaded' because this represents
|
| // the idle state.
|
| @@ -630,11 +629,11 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| }
|
|
|
| - (WebState*)webState {
|
| - return _webStateImpl.get();
|
| + return _webStateImpl;
|
| }
|
|
|
| - (WebStateImpl*)webStateImpl {
|
| - return _webStateImpl.get();
|
| + return _webStateImpl;
|
| }
|
|
|
| - (void)clearTransientContentView {
|
| @@ -873,9 +872,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| // Remove the web view now. Otherwise, delegate callbacks occur.
|
| [self removeWebViewAllowingCachedReconstruction:NO];
|
|
|
| - // Tear down web ui (in case this is part of this tab) and web state now,
|
| - // since the timing of dealloc can't be guaranteed.
|
| - _webStateImpl.reset();
|
| + _webStateImpl = nullptr;
|
| }
|
|
|
| - (void)checkLinkPresenceUnderGesture:(UIGestureRecognizer*)gestureRecognizer
|
|
|