Commit 668e5f3b authored by John Z Wu's avatar John Z Wu Committed by Commit Bot

Remove script handlers on shutdown.

This avoids a DCHECK.

Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: If764659a3b0d12955e79d155f1408e44db10277d
Reviewed-on: https://chromium-review.googlesource.com/1129962
Commit-Queue: John Wu <jzw@chromium.org>
Reviewed-by: default avatarHiroshi Ichikawa <ichikawa@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574185}
parent ef561eec
...@@ -252,6 +252,10 @@ static NSString* gUserAgentProduct = nil; ...@@ -252,6 +252,10 @@ static NSString* gUserAgentProduct = nil;
- (void)webStateDestroyed:(web::WebState*)webState { - (void)webStateDestroyed:(web::WebState*)webState {
webState->RemoveObserver(_webStateObserver.get()); webState->RemoveObserver(_webStateObserver.get());
_webStateObserver.reset(); _webStateObserver.reset();
for (const auto& pair : _scriptCommandCallbacks) {
webState->RemoveScriptCommandCallback(pair.first);
}
_scriptCommandCallbacks.clear();
} }
- (void)webState:(web::WebState*)webState - (void)webState:(web::WebState*)webState
......
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