Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: content/browser/frame_host/navigation_handle_impl.cc

Issue 2618393003: Remove ScopedVector from ContentBrowserClient. (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 8ed60813cfc8592fe75bd843f6931c59c078c1ba..30536bd306c76c4da490f9ea142210612c907d0c 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"
@@ -784,11 +786,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);
@@ -805,11 +807,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()));
}
} // namespace content
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.h ('k') | content/browser/frame_host/navigator_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698