| 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/debug/dump_without_crashing.h" | 9 #include "base/debug/dump_without_crashing.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 } | 652 } |
| 653 } | 653 } |
| 654 | 654 |
| 655 void NavigationHandleImpl::Transfer() { | 655 void NavigationHandleImpl::Transfer() { |
| 656 DCHECK(!IsBrowserSideNavigationEnabled()); | 656 DCHECK(!IsBrowserSideNavigationEnabled()); |
| 657 // This is an actual transfer. Inform the NavigationResourceThrottle. This | 657 // This is an actual transfer. Inform the NavigationResourceThrottle. This |
| 658 // will allow to mark the URLRequest as transferring. When it is marked as | 658 // will allow to mark the URLRequest as transferring. When it is marked as |
| 659 // transferring, the URLRequest can no longer be cancelled by its original | 659 // transferring, the URLRequest can no longer be cancelled by its original |
| 660 // RenderFrame. Instead it will persist until being picked up by the transfer | 660 // RenderFrame. Instead it will persist until being picked up by the transfer |
| 661 // RenderFrame, even if the original RenderFrame is destroyed. | 661 // RenderFrame, even if the original RenderFrame is destroyed. |
| 662 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, transfer_callback_); | 662 // Note: |transfer_callback_| can be null in unit tests. |
| 663 if (!transfer_callback_.is_null()) |
| 664 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, transfer_callback_); |
| 663 transfer_callback_.Reset(); | 665 transfer_callback_.Reset(); |
| 664 } | 666 } |
| 665 | 667 |
| 666 NavigationThrottle::ThrottleCheckResult | 668 NavigationThrottle::ThrottleCheckResult |
| 667 NavigationHandleImpl::CheckWillStartRequest() { | 669 NavigationHandleImpl::CheckWillStartRequest() { |
| 668 DCHECK(state_ == WILL_SEND_REQUEST || state_ == DEFERRING_START); | 670 DCHECK(state_ == WILL_SEND_REQUEST || state_ == DEFERRING_START); |
| 669 DCHECK(state_ != WILL_SEND_REQUEST || next_index_ == 0); | 671 DCHECK(state_ != WILL_SEND_REQUEST || next_index_ == 0); |
| 670 DCHECK(state_ != DEFERRING_START || next_index_ != 0); | 672 DCHECK(state_ != DEFERRING_START || next_index_ != 0); |
| 671 for (size_t i = next_index_; i < throttles_.size(); ++i) { | 673 for (size_t i = next_index_; i < throttles_.size(); ++i) { |
| 672 NavigationThrottle::ThrottleCheckResult result = | 674 NavigationThrottle::ThrottleCheckResult result = |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 if (node->current_url().EqualsIgnoringRef(url_)) { | 931 if (node->current_url().EqualsIgnoringRef(url_)) { |
| 930 if (found_self_reference) | 932 if (found_self_reference) |
| 931 return true; | 933 return true; |
| 932 found_self_reference = true; | 934 found_self_reference = true; |
| 933 } | 935 } |
| 934 } | 936 } |
| 935 return false; | 937 return false; |
| 936 } | 938 } |
| 937 | 939 |
| 938 } // namespace content | 940 } // namespace content |
| OLD | NEW |