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

Side by Side Diff: chrome/browser/sessions/session_service.cc

Issue 2600583002: Remove ScopedVector from components/sessions. (Closed)
Patch Set: include 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/sessions/session_service.h" 5 #include "chrome/browser/sessions/session_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 } 707 }
708 708
709 void SessionService::OnBrowserSetLastActive(Browser* browser) { 709 void SessionService::OnBrowserSetLastActive(Browser* browser) {
710 if (ShouldTrackBrowser(browser)) 710 if (ShouldTrackBrowser(browser))
711 ScheduleCommand( 711 ScheduleCommand(
712 sessions::CreateSetActiveWindowCommand(browser->session_id())); 712 sessions::CreateSetActiveWindowCommand(browser->session_id()));
713 } 713 }
714 714
715 void SessionService::OnGotSessionCommands( 715 void SessionService::OnGotSessionCommands(
716 const sessions::GetLastSessionCallback& callback, 716 const sessions::GetLastSessionCallback& callback,
717 ScopedVector<sessions::SessionCommand> commands) { 717 std::vector<std::unique_ptr<sessions::SessionCommand>> commands) {
718 std::vector<std::unique_ptr<sessions::SessionWindow>> valid_windows; 718 std::vector<std::unique_ptr<sessions::SessionWindow>> valid_windows;
719 SessionID::id_type active_window_id = 0; 719 SessionID::id_type active_window_id = 0;
720 720
721 sessions::RestoreSessionFromCommands(commands, &valid_windows, 721 sessions::RestoreSessionFromCommands(commands, &valid_windows,
722 &active_window_id); 722 &active_window_id);
723 RemoveUnusedRestoreWindows(&valid_windows); 723 RemoveUnusedRestoreWindows(&valid_windows);
724 724
725 callback.Run(std::move(valid_windows), active_window_id); 725 callback.Run(std::move(valid_windows), active_window_id);
726 } 726 }
727 727
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 for (auto* browser : *BrowserList::GetInstance()) { 1100 for (auto* browser : *BrowserList::GetInstance()) {
1101 if (browser->profile() == profile()) 1101 if (browser->profile() == profile())
1102 return; 1102 return;
1103 } 1103 }
1104 DeleteSessionOnlyData(profile()); 1104 DeleteSessionOnlyData(profile());
1105 } 1105 }
1106 1106
1107 sessions::BaseSessionService* SessionService::GetBaseSessionServiceForTest() { 1107 sessions::BaseSessionService* SessionService::GetBaseSessionServiceForTest() {
1108 return base_session_service_.get(); 1108 return base_session_service_.get();
1109 } 1109 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_service.h ('k') | chrome/browser/sessions/session_service_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698