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

Unified Diff: ios/web/navigation/crw_session_controller.mm

Issue 2600583002: Remove ScopedVector from components/sessions. (Closed)
Patch Set: include Created 3 years, 12 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
« no previous file with comments | « ios/chrome/browser/tabs/tab.mm ('k') | ios/web/navigation/crw_session_controller+private_constructors.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/navigation/crw_session_controller.mm
diff --git a/ios/web/navigation/crw_session_controller.mm b/ios/web/navigation/crw_session_controller.mm
index ca01cfc1d7ccb10c36a395445ea7be7edf192f40..2c7db40a76162a88c382ef833f0370e47e6fb585 100644
--- a/ios/web/navigation/crw_session_controller.mm
+++ b/ios/web/navigation/crw_session_controller.mm
@@ -164,7 +164,8 @@ NSString* const kWindowNameKey = @"windowName";
return self;
}
-- (id)initWithNavigationItems:(ScopedVector<web::NavigationItem>)scoped_items
+- (id)initWithNavigationItems:
+ (std::vector<std::unique_ptr<web::NavigationItem>>)items
currentIndex:(NSUInteger)currentIndex
browserState:(web::BrowserState*)browserState {
self = [super init];
@@ -174,12 +175,9 @@ NSString* const kWindowNameKey = @"windowName";
_browserState = browserState;
// Create entries array from list of navigations.
- _entries = [[NSMutableArray alloc] initWithCapacity:scoped_items.size()];
- std::vector<web::NavigationItem*> items;
- scoped_items.release(&items);
+ _entries = [[NSMutableArray alloc] initWithCapacity:items.size()];
- for (size_t i = 0; i < items.size(); ++i) {
- std::unique_ptr<web::NavigationItem> item(items[i]);
+ for (auto& item : items) {
base::scoped_nsobject<CRWSessionEntry> entry(
[[CRWSessionEntry alloc] initWithNavigationItem:std::move(item)]);
[_entries addObject:entry];
« no previous file with comments | « ios/chrome/browser/tabs/tab.mm ('k') | ios/web/navigation/crw_session_controller+private_constructors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698