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 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 return true; | 873 return true; |
874 } | 874 } |
875 | 875 |
876 void NavigationHandleImpl::RunCompleteCallback( | 876 void NavigationHandleImpl::RunCompleteCallback( |
877 NavigationThrottle::ThrottleCheckResult result) { | 877 NavigationThrottle::ThrottleCheckResult result) { |
878 DCHECK(result != NavigationThrottle::DEFER); | 878 DCHECK(result != NavigationThrottle::DEFER); |
879 | 879 |
880 ThrottleChecksFinishedCallback callback = complete_callback_; | 880 ThrottleChecksFinishedCallback callback = complete_callback_; |
881 complete_callback_.Reset(); | 881 complete_callback_.Reset(); |
882 | 882 |
| 883 if (!complete_callback_for_testing_.is_null()) { |
| 884 complete_callback_for_testing_.Run(result); |
| 885 complete_callback_for_testing_.Reset(); |
| 886 } |
| 887 |
883 if (!callback.is_null()) | 888 if (!callback.is_null()) |
884 callback.Run(result); | 889 callback.Run(result); |
885 | 890 |
886 // No code after running the callback, as it might have resulted in our | 891 // No code after running the callback, as it might have resulted in our |
887 // destruction. | 892 // destruction. |
888 } | 893 } |
889 | 894 |
890 void NavigationHandleImpl::RegisterNavigationThrottles() { | 895 void NavigationHandleImpl::RegisterNavigationThrottles() { |
891 // Register the navigation throttles. The vector returned by | 896 // Register the navigation throttles. The vector returned by |
892 // CreateThrottlesForNavigation is not assigned to throttles_ directly because | 897 // CreateThrottlesForNavigation is not assigned to throttles_ directly because |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 if (node->current_url().EqualsIgnoringRef(url_)) { | 947 if (node->current_url().EqualsIgnoringRef(url_)) { |
943 if (found_self_reference) | 948 if (found_self_reference) |
944 return true; | 949 return true; |
945 found_self_reference = true; | 950 found_self_reference = true; |
946 } | 951 } |
947 } | 952 } |
948 return false; | 953 return false; |
949 } | 954 } |
950 | 955 |
951 } // namespace content | 956 } // namespace content |
OLD | NEW |