OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "content/browser/frame_host/navigation_handle_impl.h" | 5 #include "content/browser/frame_host/navigation_handle_impl.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "content/browser/appcache/appcache_navigation_handle.h" | 10 #include "content/browser/appcache/appcache_navigation_handle.h" |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 } | 658 } |
659 } | 659 } |
660 | 660 |
661 void NavigationHandleImpl::Transfer() { | 661 void NavigationHandleImpl::Transfer() { |
662 DCHECK(!IsBrowserSideNavigationEnabled()); | 662 DCHECK(!IsBrowserSideNavigationEnabled()); |
663 // This is an actual transfer. Inform the NavigationResourceThrottle. This | 663 // This is an actual transfer. Inform the NavigationResourceThrottle. This |
664 // will allow to mark the URLRequest as transferring. When it is marked as | 664 // will allow to mark the URLRequest as transferring. When it is marked as |
665 // transferring, the URLRequest can no longer be cancelled by its original | 665 // transferring, the URLRequest can no longer be cancelled by its original |
666 // RenderFrame. Instead it will persist until being picked up by the transfer | 666 // RenderFrame. Instead it will persist until being picked up by the transfer |
667 // RenderFrame, even if the original RenderFrame is destroyed. | 667 // RenderFrame, even if the original RenderFrame is destroyed. |
668 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, transfer_callback_); | 668 // Note: |transfer_callback_| can be null in unit tests. |
| 669 if (!transfer_callback_.is_null()) |
| 670 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, transfer_callback_); |
669 transfer_callback_.Reset(); | 671 transfer_callback_.Reset(); |
670 } | 672 } |
671 | 673 |
672 NavigationThrottle::ThrottleCheckResult | 674 NavigationThrottle::ThrottleCheckResult |
673 NavigationHandleImpl::CheckWillStartRequest() { | 675 NavigationHandleImpl::CheckWillStartRequest() { |
674 DCHECK(state_ == WILL_SEND_REQUEST || state_ == DEFERRING_START); | 676 DCHECK(state_ == WILL_SEND_REQUEST || state_ == DEFERRING_START); |
675 DCHECK(state_ != WILL_SEND_REQUEST || next_index_ == 0); | 677 DCHECK(state_ != WILL_SEND_REQUEST || next_index_ == 0); |
676 DCHECK(state_ != DEFERRING_START || next_index_ != 0); | 678 DCHECK(state_ != DEFERRING_START || next_index_ != 0); |
677 for (size_t i = next_index_; i < throttles_.size(); ++i) { | 679 for (size_t i = next_index_; i < throttles_.size(); ++i) { |
678 NavigationThrottle::ThrottleCheckResult result = | 680 NavigationThrottle::ThrottleCheckResult result = |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 if (node->current_url().EqualsIgnoringRef(url_)) { | 934 if (node->current_url().EqualsIgnoringRef(url_)) { |
933 if (found_self_reference) | 935 if (found_self_reference) |
934 return true; | 936 return true; |
935 found_self_reference = true; | 937 found_self_reference = true; |
936 } | 938 } |
937 } | 939 } |
938 return false; | 940 return false; |
939 } | 941 } |
940 | 942 |
941 } // namespace content | 943 } // namespace content |
OLD | NEW |