Chromium Code Reviews| Index: content/browser/frame_host/navigation_handle_impl.cc |
| diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc |
| index eba07da522c327c1ceb5d2da68d6918584214342..9c110edf9b052129f4017e09a5cfad8d925e85a3 100644 |
| --- a/content/browser/frame_host/navigation_handle_impl.cc |
| +++ b/content/browser/frame_host/navigation_handle_impl.cc |
| @@ -4,6 +4,8 @@ |
| #include "content/browser/frame_host/navigation_handle_impl.h" |
| +#include <iterator> |
| + |
| #include "base/debug/dump_without_crashing.h" |
| #include "base/logging.h" |
| #include "content/browser/appcache/appcache_navigation_handle.h" |
| @@ -779,11 +781,11 @@ void NavigationHandleImpl::RunCompleteCallback( |
| } |
| void NavigationHandleImpl::RegisterNavigationThrottles() { |
| - // Register the navigation throttles. The ScopedVector returned by |
| + // Register the navigation throttles. The vector returned by |
| // GetNavigationThrottles is not assigned to throttles_ directly because it |
| - // would overwrite any throttle previously added with |
| + // would overwrite any throttles previously added with |
| // RegisterThrottleForTesting. |
| - ScopedVector<NavigationThrottle> throttles_to_register = |
| + std::vector<std::unique_ptr<NavigationThrottle>> throttles_to_register = |
| GetDelegate()->CreateThrottlesForNavigation(this); |
| std::unique_ptr<NavigationThrottle> devtools_throttle = |
| RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this); |
| @@ -800,11 +802,9 @@ void NavigationHandleImpl::RegisterNavigationThrottles() { |
| if (ancestor_throttle) |
| throttles_.push_back(std::move(ancestor_throttle)); |
| - if (throttles_to_register.size() > 0) { |
| - throttles_.insert(throttles_.begin(), throttles_to_register.begin(), |
| - throttles_to_register.end()); |
| - throttles_to_register.weak_clear(); |
| - } |
| + throttles_.insert(throttles_.begin(), |
| + std::make_move_iterator(throttles_to_register.begin()), |
| + std::make_move_iterator(throttles_to_register.end())); |
|
Nico
2017/01/12 16:55:23
nice
Avi (use Gerrit)
2017/01/12 19:05:37
Thank you! Props to leon.han@intel who taught it t
|
| } |
| } // namespace content |