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 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 return true; | 865 return true; |
866 } | 866 } |
867 | 867 |
868 void NavigationHandleImpl::RunCompleteCallback( | 868 void NavigationHandleImpl::RunCompleteCallback( |
869 NavigationThrottle::ThrottleCheckResult result) { | 869 NavigationThrottle::ThrottleCheckResult result) { |
870 DCHECK(result != NavigationThrottle::DEFER); | 870 DCHECK(result != NavigationThrottle::DEFER); |
871 | 871 |
872 ThrottleChecksFinishedCallback callback = complete_callback_; | 872 ThrottleChecksFinishedCallback callback = complete_callback_; |
873 complete_callback_.Reset(); | 873 complete_callback_.Reset(); |
874 | 874 |
| 875 if (!complete_callback_for_testing_.is_null()) { |
| 876 complete_callback_for_testing_.Run(result); |
| 877 complete_callback_for_testing_.Reset(); |
| 878 } |
| 879 |
875 if (!callback.is_null()) | 880 if (!callback.is_null()) |
876 callback.Run(result); | 881 callback.Run(result); |
877 | 882 |
878 // No code after running the callback, as it might have resulted in our | 883 // No code after running the callback, as it might have resulted in our |
879 // destruction. | 884 // destruction. |
880 } | 885 } |
881 | 886 |
882 void NavigationHandleImpl::RegisterNavigationThrottles() { | 887 void NavigationHandleImpl::RegisterNavigationThrottles() { |
883 // Register the navigation throttles. The vector returned by | 888 // Register the navigation throttles. The vector returned by |
884 // CreateThrottlesForNavigation is not assigned to throttles_ directly because | 889 // CreateThrottlesForNavigation is not assigned to throttles_ directly because |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 if (node->current_url().EqualsIgnoringRef(url_)) { | 939 if (node->current_url().EqualsIgnoringRef(url_)) { |
935 if (found_self_reference) | 940 if (found_self_reference) |
936 return true; | 941 return true; |
937 found_self_reference = true; | 942 found_self_reference = true; |
938 } | 943 } |
939 } | 944 } |
940 return false; | 945 return false; |
941 } | 946 } |
942 | 947 |
943 } // namespace content | 948 } // namespace content |
OLD | NEW |