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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 } | 1084 } |
1085 | 1085 |
1086 if (!callback.is_null()) | 1086 if (!callback.is_null()) |
1087 callback.Run(result); | 1087 callback.Run(result); |
1088 | 1088 |
1089 // No code after running the callback, as it might have resulted in our | 1089 // No code after running the callback, as it might have resulted in our |
1090 // destruction. | 1090 // destruction. |
1091 } | 1091 } |
1092 | 1092 |
1093 void NavigationHandleImpl::RegisterNavigationThrottles() { | 1093 void NavigationHandleImpl::RegisterNavigationThrottles() { |
1094 // TODO(clamy): Remove this when we understand the root cause behind | |
1095 // crbug.com/736658. | |
1096 CHECK(!throttles_have_been_added_); | |
1097 throttles_have_been_added_ = true; | |
1098 | |
1099 // Register the navigation throttles. The vector returned by | 1094 // Register the navigation throttles. The vector returned by |
1100 // CreateThrottlesForNavigation is not assigned to throttles_ directly because | 1095 // CreateThrottlesForNavigation is not assigned to throttles_ directly because |
1101 // it would overwrite any throttles previously added with | 1096 // it would overwrite any throttles previously added with |
1102 // RegisterThrottleForTesting. | 1097 // RegisterThrottleForTesting. |
1103 // TODO(carlosk, arthursonzogni): should simplify this to either use | 1098 // TODO(carlosk, arthursonzogni): should simplify this to either use |
1104 // |throttles_| directly (except for the case described above) or | 1099 // |throttles_| directly (except for the case described above) or |
1105 // |throttles_to_register| for registering all throttles. | 1100 // |throttles_to_register| for registering all throttles. |
1106 std::vector<std::unique_ptr<NavigationThrottle>> throttles_to_register = | 1101 std::vector<std::unique_ptr<NavigationThrottle>> throttles_to_register = |
1107 GetDelegate()->CreateThrottlesForNavigation(this); | 1102 GetDelegate()->CreateThrottlesForNavigation(this); |
1108 | 1103 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 // Stop expecting a navigation to the current site URL in the current expected | 1184 // Stop expecting a navigation to the current site URL in the current expected |
1190 // process. | 1185 // process. |
1191 SetExpectedProcess(nullptr); | 1186 SetExpectedProcess(nullptr); |
1192 | 1187 |
1193 // Update the site URL and the expected process. | 1188 // Update the site URL and the expected process. |
1194 site_url_ = new_site_url; | 1189 site_url_ = new_site_url; |
1195 SetExpectedProcess(post_redirect_process); | 1190 SetExpectedProcess(post_redirect_process); |
1196 } | 1191 } |
1197 | 1192 |
1198 } // namespace content | 1193 } // namespace content |
OLD | NEW |