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

Side by Side Diff: ios/web/web_state/ui/crw_wk_web_view_web_controller.mm

Issue 1874903003: Reversed WebState <-> CRWWebController ownership. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/web/web_state/ui/crw_wk_web_view_web_controller.h" 5 #import "ios/web/web_state/ui/crw_wk_web_view_web_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 345
346 // Called when WKWebView URL has been changed. 346 // Called when WKWebView URL has been changed.
347 - (void)webViewURLDidChange; 347 - (void)webViewURLDidChange;
348 348
349 @end 349 @end
350 350
351 @implementation CRWWKWebViewWebController 351 @implementation CRWWKWebViewWebController
352 352
353 #pragma mark CRWWebController public methods 353 #pragma mark CRWWebController public methods
354 354
355 - (instancetype)initWithWebState:(std::unique_ptr<web::WebStateImpl>)webState { 355 - (instancetype)initWithWebState:(web::WebStateImpl*)webState {
356 DCHECK(webState); 356 self = [super initWithWebState:webState];
357 web::BrowserState* browserState = webState->GetBrowserState();
358 self = [super initWithWebState:std::move(webState)];
359 if (self) { 357 if (self) {
358 DCHECK(webState);
359 web::BrowserState* browserState = webState->GetBrowserState();
360 _certVerificationController.reset([[CRWCertVerificationController alloc] 360 _certVerificationController.reset([[CRWCertVerificationController alloc]
361 initWithBrowserState:browserState]); 361 initWithBrowserState:browserState]);
362 _certVerificationErrors.reset( 362 _certVerificationErrors.reset(
363 new CertVerificationErrorsCacheType(kMaxCertErrorsCount)); 363 new CertVerificationErrorsCacheType(kMaxCertErrorsCount));
364 } 364 }
365 return self; 365 return self;
366 } 366 }
367 367
368 - (void)terminateNetworkActivity { 368 - (void)terminateNetworkActivity {
369 web::CertStore::GetInstance()->RemoveCertsForGroup(self.certGroupID); 369 web::CertStore::GetInstance()->RemoveCertsForGroup(self.certGroupID);
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 runJavaScriptTextInputPanelWithPrompt:prompt 1722 runJavaScriptTextInputPanelWithPrompt:prompt
1723 defaultText:defaultText 1723 defaultText:defaultText
1724 requestURL:requestURL 1724 requestURL:requestURL
1725 completionHandler:completionHandler]; 1725 completionHandler:completionHandler];
1726 } else if (completionHandler) { 1726 } else if (completionHandler) {
1727 completionHandler(nil); 1727 completionHandler(nil);
1728 } 1728 }
1729 } 1729 }
1730 1730
1731 @end 1731 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698