Commit 84963cd3 authored by Olivier Robin's avatar Olivier Robin Committed by Commit Bot

Fix DCHECK on form activity post page unload with frame message disabled

Without frame messaging, messages can be receive after the frame is
deleted.
The current code DCHECKs because the frameID is empty in that case.

Change-Id: I008803da50f166bfefe29159addaac2a69f15ec1
Reviewed-on: https://chromium-review.googlesource.com/c/1256804
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596154}
parent 617e24c9
...@@ -371,8 +371,7 @@ autofillManagerFromWebState:(web::WebState*)webState ...@@ -371,8 +371,7 @@ autofillManagerFromWebState:(web::WebState*)webState
webState:(web::WebState*)webState webState:(web::WebState*)webState
completionHandler:(SuggestionsAvailableCompletion)completion { completionHandler:(SuggestionsAvailableCompletion)completion {
web::WebFrame* frame = web::WebFrame* frame =
web::WebFramesManager::FromWebState(webState)->GetFrameWithId( GetWebFrameWithId(webState, base::SysNSStringToUTF8(frameID));
base::SysNSStringToUTF8(frameID));
autofill::AutofillManager* autofillManager = autofill::AutofillManager* autofillManager =
[self autofillManagerFromWebState:webState webFrame:frame]; [self autofillManagerFromWebState:webState webFrame:frame];
if (!autofillManager) if (!autofillManager)
...@@ -574,6 +573,7 @@ autofillManagerFromWebState:(web::WebState*)webState ...@@ -574,6 +573,7 @@ autofillManagerFromWebState:(web::WebState*)webState
- (void)processPage:(web::WebState*)webState { - (void)processPage:(web::WebState*)webState {
web::WebFramesManager* framesManager = web::WebFramesManager* framesManager =
web::WebFramesManager::FromWebState(webState); web::WebFramesManager::FromWebState(webState);
DCHECK(framesManager);
if (!autofill::switches::IsAutofillIFrameMessagingEnabled()) { if (!autofill::switches::IsAutofillIFrameMessagingEnabled()) {
[self processFrame:framesManager->GetMainWebFrame() inWebState:webState]; [self processFrame:framesManager->GetMainWebFrame() inWebState:webState];
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment