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 |
1094 // Register the navigation throttles. The vector returned by | 1099 // Register the navigation throttles. The vector returned by |
1095 // CreateThrottlesForNavigation is not assigned to throttles_ directly because | 1100 // CreateThrottlesForNavigation is not assigned to throttles_ directly because |
1096 // it would overwrite any throttles previously added with | 1101 // it would overwrite any throttles previously added with |
1097 // RegisterThrottleForTesting. | 1102 // RegisterThrottleForTesting. |
1098 // TODO(carlosk, arthursonzogni): should simplify this to either use | 1103 // TODO(carlosk, arthursonzogni): should simplify this to either use |
1099 // |throttles_| directly (except for the case described above) or | 1104 // |throttles_| directly (except for the case described above) or |
1100 // |throttles_to_register| for registering all throttles. | 1105 // |throttles_to_register| for registering all throttles. |
1101 std::vector<std::unique_ptr<NavigationThrottle>> throttles_to_register = | 1106 std::vector<std::unique_ptr<NavigationThrottle>> throttles_to_register = |
1102 GetDelegate()->CreateThrottlesForNavigation(this); | 1107 GetDelegate()->CreateThrottlesForNavigation(this); |
1103 | 1108 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1184 // Stop expecting a navigation to the current site URL in the current expected | 1189 // Stop expecting a navigation to the current site URL in the current expected |
1185 // process. | 1190 // process. |
1186 SetExpectedProcess(nullptr); | 1191 SetExpectedProcess(nullptr); |
1187 | 1192 |
1188 // Update the site URL and the expected process. | 1193 // Update the site URL and the expected process. |
1189 site_url_ = new_site_url; | 1194 site_url_ = new_site_url; |
1190 SetExpectedProcess(post_redirect_process); | 1195 SetExpectedProcess(post_redirect_process); |
1191 } | 1196 } |
1192 | 1197 |
1193 } // namespace content | 1198 } // namespace content |
OLD | NEW |