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

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

Issue 10831308: Revert 151036 - Speculative revert to see if this change introduced a performance regression on Mac… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
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/tab_restore_service.h" 5 #include "chrome/browser/sessions/tab_restore_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <map> 9 #include <map>
10 10
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 } 212 }
213 213
214 void TabRestoreService::AddObserver(TabRestoreServiceObserver* observer) { 214 void TabRestoreService::AddObserver(TabRestoreServiceObserver* observer) {
215 observer_list_.AddObserver(observer); 215 observer_list_.AddObserver(observer);
216 } 216 }
217 217
218 void TabRestoreService::RemoveObserver(TabRestoreServiceObserver* observer) { 218 void TabRestoreService::RemoveObserver(TabRestoreServiceObserver* observer) {
219 observer_list_.RemoveObserver(observer); 219 observer_list_.RemoveObserver(observer);
220 } 220 }
221 221
222 void TabRestoreService::CreateHistoricalTab(NavigationController* tab, 222 void TabRestoreService::CreateHistoricalTab(content::WebContents* contents,
223 int index) { 223 int index) {
224 if (restoring_) 224 if (restoring_)
225 return; 225 return;
226 226
227 TabRestoreServiceDelegate* delegate = 227 TabRestoreServiceDelegate* delegate =
228 TabRestoreServiceDelegate::FindDelegateForController(tab, NULL); 228 TabRestoreServiceDelegate::FindDelegateForWebContents(contents);
229 if (closing_delegates_.find(delegate) != closing_delegates_.end()) 229 if (closing_delegates_.find(delegate) != closing_delegates_.end())
230 return; 230 return;
231 231
232 scoped_ptr<Tab> local_tab(new Tab()); 232 scoped_ptr<Tab> local_tab(new Tab());
233 PopulateTab(local_tab.get(), index, delegate, tab); 233 PopulateTab(local_tab.get(), index, delegate, &contents->GetController());
234 if (local_tab->navigations.empty()) 234 if (local_tab->navigations.empty())
235 return; 235 return;
236 236
237 AddEntry(local_tab.release(), true, true); 237 AddEntry(local_tab.release(), true, true);
238 } 238 }
239 239
240 void TabRestoreService::BrowserClosing(TabRestoreServiceDelegate* delegate) { 240 void TabRestoreService::BrowserClosing(TabRestoreServiceDelegate* delegate) {
241 closing_delegates_.insert(delegate); 241 closing_delegates_.insert(delegate);
242 242
243 scoped_ptr<Window> window(new Window()); 243 scoped_ptr<Window> window(new Window());
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 // the front, not the end and we just added the entries to the end). 1246 // the front, not the end and we just added the entries to the end).
1247 entries_to_write_ = staging_entries_.size(); 1247 entries_to_write_ = staging_entries_.size();
1248 1248
1249 PruneEntries(); 1249 PruneEntries();
1250 NotifyTabsChanged(); 1250 NotifyTabsChanged();
1251 } 1251 }
1252 1252
1253 Time TabRestoreService::TimeNow() const { 1253 Time TabRestoreService::TimeNow() const {
1254 return time_factory_ ? time_factory_->TimeNow() : Time::Now(); 1254 return time_factory_ ? time_factory_->TimeNow() : Time::Now();
1255 } 1255 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/tab_restore_service.h ('k') | chrome/browser/sessions/tab_restore_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698