| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ios/web/web_state/ui/crw_web_controller.h" | 5 #import "ios/web/web_state/ui/crw_web_controller.h" |
| 6 | 6 |
| 7 #import <WebKit/WebKit.h> | 7 #import <WebKit/WebKit.h> |
| 8 | 8 |
| 9 #import <objc/runtime.h> | 9 #import <objc/runtime.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 4581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4592 [self abortLoad]; | 4592 [self abortLoad]; |
| 4593 NavigationManager::WebLoadParams params(webViewURL); | 4593 NavigationManager::WebLoadParams params(webViewURL); |
| 4594 [self loadWithParams:params]; | 4594 [self loadWithParams:params]; |
| 4595 } | 4595 } |
| 4596 return; | 4596 return; |
| 4597 } else { | 4597 } else { |
| 4598 [self registerLoadRequest:webViewURL]; | 4598 [self registerLoadRequest:webViewURL]; |
| 4599 } | 4599 } |
| 4600 } | 4600 } |
| 4601 | 4601 |
| 4602 if (![self currentSessionEntry]) { | |
| 4603 // In this state CRWWebController will crash in |didCommitNavigation:| | |
| 4604 // (crbug.com/676458). It's unclear if web controller could get into this | |
| 4605 // state but it's one of the guesses for crbug.com/676458 root cause. Report | |
| 4606 // UMA historgam if that happens. | |
| 4607 // TODO(crbug.com/677552): Remove this historgam. | |
| 4608 UMA_HISTOGRAM_BOOLEAN( | |
| 4609 "WebController." | |
| 4610 "StartProvisionalNavigationExitedWithEmptyNavigationManager", | |
| 4611 true); | |
| 4612 } | |
| 4613 | |
| 4614 // Ensure the URL is registered and loadPhase is as expected. | 4602 // Ensure the URL is registered and loadPhase is as expected. |
| 4615 DCHECK(_lastRegisteredRequestURL == webViewURL); | 4603 DCHECK(_lastRegisteredRequestURL == webViewURL); |
| 4616 DCHECK(self.loadPhase == web::LOAD_REQUESTED); | 4604 DCHECK(self.loadPhase == web::LOAD_REQUESTED); |
| 4617 } | 4605 } |
| 4618 | 4606 |
| 4619 - (void)webView:(WKWebView*)webView | 4607 - (void)webView:(WKWebView*)webView |
| 4620 didReceiveServerRedirectForProvisionalNavigation:(WKNavigation*)navigation { | 4608 didReceiveServerRedirectForProvisionalNavigation:(WKNavigation*)navigation { |
| 4621 [_navigationStates setState:web::WKNavigationState::REDIRECTED | 4609 [_navigationStates setState:web::WKNavigationState::REDIRECTED |
| 4622 forNavigation:navigation]; | 4610 forNavigation:navigation]; |
| 4623 | 4611 |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5244 - (void)simulateLoadRequestWithURL:(const GURL&)URL { | 5232 - (void)simulateLoadRequestWithURL:(const GURL&)URL { |
| 5245 _lastRegisteredRequestURL = URL; | 5233 _lastRegisteredRequestURL = URL; |
| 5246 _loadPhase = web::LOAD_REQUESTED; | 5234 _loadPhase = web::LOAD_REQUESTED; |
| 5247 } | 5235 } |
| 5248 | 5236 |
| 5249 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { | 5237 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { |
| 5250 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; | 5238 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; |
| 5251 } | 5239 } |
| 5252 | 5240 |
| 5253 @end | 5241 @end |
| OLD | NEW |