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

Unified Diff: ios/chrome/browser/passwords/password_controller.mm

Issue 1950983002: PasswordController initialization: WebStateObserverBridge to the end (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@608090_isbeingdestroyed
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/passwords/password_controller.mm
diff --git a/ios/chrome/browser/passwords/password_controller.mm b/ios/chrome/browser/passwords/password_controller.mm
index 60f7cae51f10067215f61d36e62c62bcf9f66c35..fc5d885b3bc2553709c48354ab7457b59e3033a7 100644
--- a/ios/chrome/browser/passwords/password_controller.mm
+++ b/ios/chrome/browser/passwords/password_controller.mm
@@ -241,6 +241,7 @@ bool GetPageURLAndCheckTrustLevel(web::WebState* web_state, GURL* page_url) {
base::scoped_nsobject<PasswordGenerationAgent> passwordGenerationAgent_;
JsPasswordManager* passwordJsManager_; // weak
+ web::WebState* webState_; // weak
vasilii 2016/05/10 12:38:47 Why is the new member required?
vabr (Chromium) 2016/05/10 12:48:47 Before it, the WebState was accessed through the W
// The pending form data.
std::unique_ptr<autofill::PasswordFormFillData> formData_;
@@ -266,8 +267,7 @@ bool GetPageURLAndCheckTrustLevel(web::WebState* web_state, GURL* page_url) {
DCHECK(webState);
self = [super init];
if (self) {
- webStateObserverBridge_.reset(
- new web::WebStateObserverBridge(webState, self));
+ webState_ = webState;
if (passwordManagerClient)
passwordManagerClient_ = std::move(passwordManagerClient);
else
@@ -288,6 +288,8 @@ bool GetPageURLAndCheckTrustLevel(web::WebState* web_state, GURL* page_url) {
passwordJsManager_ = base::mac::ObjCCastStrict<JsPasswordManager>(
[webState->GetJSInjectionReceiver()
instanceOfClass:[JsPasswordManager class]]);
+ webStateObserverBridge_.reset(
+ new web::WebStateObserverBridge(webState, self));
}
return self;
}
@@ -303,10 +305,9 @@ bool GetPageURLAndCheckTrustLevel(web::WebState* web_state, GURL* page_url) {
}
- (ios::ChromeBrowserState*)browserState {
- return webStateObserverBridge_ && webStateObserverBridge_->web_state()
- ? ios::ChromeBrowserState::FromBrowserState(
- webStateObserverBridge_->web_state()->GetBrowserState())
- : nullptr;
+ return webState_ ? ios::ChromeBrowserState::FromBrowserState(
+ webState_->GetBrowserState())
+ : nullptr;
}
- (const GURL&)lastCommittedURL {
@@ -316,6 +317,7 @@ bool GetPageURLAndCheckTrustLevel(web::WebState* web_state, GURL* page_url) {
}
- (void)detach {
+ webState_ = nullptr;
webStateObserverBridge_.reset();
passwordGenerationAgent_.reset();
passwordGenerationManager_.reset();
« 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