DescriptionPasswordController initialization: WebStateObserverBridge to the end
The associated bug has a crash where a WebStateObserverBridge method of
PasswordController dereferences a null pointer. The block where the dereference
happens is:
if (weakSelf) {
weakSelf.get()->passwordManager_->OnPasswordFormSubmitted(
weakSelf.get()->passwordManagerDriver_.get(), form);
}
While the most likely cause of that bug is being addressed in
https://codereview.chromium.org/1941363002/, the initialization order in
PasswordController's -initWithWebState is also suspicious: PasswordController
starts observing the WebState before it creates the supporting objects like
passwordManager_.
This CL changes the initialisation order to only create the bridge once the two
pointers are non-null.
BUG=608090
Committed: https://crrev.com/bcd8636b075e7bcf9f5861f981695236dd533baf
Cr-Commit-Position: refs/heads/master@{#392588}
Patch Set 1 #Patch Set 2 : #
Total comments: 2
Depends on Patchset: Messages
Total messages: 10 (3 generated)
|