| 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 4925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4936 } | 4936 } |
| 4937 | 4937 |
| 4938 // This must be reset at the end, since code above may need information about | 4938 // This must be reset at the end, since code above may need information about |
| 4939 // the pending load. | 4939 // the pending load. |
| 4940 _pendingNavigationInfo.reset(); | 4940 _pendingNavigationInfo.reset(); |
| 4941 _certVerificationErrors->Clear(); | 4941 _certVerificationErrors->Clear(); |
| 4942 } | 4942 } |
| 4943 | 4943 |
| 4944 - (void)webView:(WKWebView*)webView | 4944 - (void)webView:(WKWebView*)webView |
| 4945 didCommitNavigation:(WKNavigation*)navigation { | 4945 didCommitNavigation:(WKNavigation*)navigation { |
| 4946 // This method will crash if |currentSessionEntry| is null. If this check is | |
| 4947 // hit it means that |didStartProvisionalNavigation| was called as expected | |
| 4948 // but it did not call |registerLoadRequest|. TODO(crbug.com/676721): remove | |
| 4949 // this CHECK once there is at least one crash on this line (which means that | |
| 4950 // |didStartProvisionalNavigation| did not call |registerLoadRequest| and it | |
| 4951 // should be fixed. | |
| 4952 CHECK([self currentSessionEntry] || !navigation || | |
| 4953 [_navigationStates stateForNavigation:navigation] == | |
| 4954 web::WKNavigationState::STARTED); | |
| 4955 | |
| 4956 [_navigationStates setState:web::WKNavigationState::COMMITTED | 4946 [_navigationStates setState:web::WKNavigationState::COMMITTED |
| 4957 forNavigation:navigation]; | 4947 forNavigation:navigation]; |
| 4958 | 4948 |
| 4959 DCHECK_EQ(_webView, webView); | 4949 DCHECK_EQ(_webView, webView); |
| 4960 _certVerificationErrors->Clear(); | 4950 _certVerificationErrors->Clear(); |
| 4961 | 4951 |
| 4962 // This is the point where the document's URL has actually changed, and | 4952 // This is the point where the document's URL has actually changed, and |
| 4963 // pending navigation information should be applied to state information. | 4953 // pending navigation information should be applied to state information. |
| 4964 [self setDocumentURL:net::GURLWithNSURL([_webView URL])]; | 4954 [self setDocumentURL:net::GURLWithNSURL([_webView URL])]; |
| 4965 | 4955 |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5532 } | 5522 } |
| 5533 | 5523 |
| 5534 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 5524 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 5535 } | 5525 } |
| 5536 | 5526 |
| 5537 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { | 5527 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { |
| 5538 return [action.request valueForHTTPHeaderField:@"Referer"]; | 5528 return [action.request valueForHTTPHeaderField:@"Referer"]; |
| 5539 } | 5529 } |
| 5540 | 5530 |
| 5541 @end | 5531 @end |
| OLD | NEW |