Chromium Code Reviews| Index: ios/web/web_state/ui/crw_wk_navigation_states.mm |
| diff --git a/ios/web/web_state/ui/crw_wk_navigation_states.mm b/ios/web/web_state/ui/crw_wk_navigation_states.mm |
| index 235562e4f5ebbeb90f9dc63d04a1d92b996bebd5..13d852a80d28029f03f7ed5e62987e71f4885686 100644 |
| --- a/ios/web/web_state/ui/crw_wk_navigation_states.mm |
| +++ b/ios/web/web_state/ui/crw_wk_navigation_states.mm |
| @@ -122,14 +122,22 @@ |
| [[CRWWKNavigationsStateRecord alloc] initWithState:state |
| index:++_lastStateIndex]; |
| } else { |
| - DCHECK( |
| - record.state < state || |
| - (record.state == state && state == web::WKNavigationState::REDIRECTED)); |
| + DCHECK(record.state < state || |
| + (record.state == state && |
| + state == web::WKNavigationState::REDIRECTED) || |
| + (record.state == web::WKNavigationState::FINISHED && |
| + state == web::WKNavigationState::COMMITTED)); |
|
kkhorimoto
2017/06/22 00:49:02
Can you add some comments for this DCHECK explaini
Eugene But (OOO till 7-30)
2017/06/22 01:58:06
Done.
|
| record.state = state; |
| } |
| [_records setObject:record forKey:key]; |
| } |
| +- (web::WKNavigationState)stateForNavigation:(WKNavigation*)navigation { |
| + id key = [self keyForNavigation:navigation]; |
| + CRWWKNavigationsStateRecord* record = [_records objectForKey:key]; |
| + return record ? record.state : web::WKNavigationState::NONE; |
| +} |
| + |
| - (void)removeNavigation:(WKNavigation*)navigation { |
| id key = [self keyForNavigation:navigation]; |
| DCHECK([_records objectForKey:key]); |