| Index: chrome/browser/sessions/session_service.cc
|
| diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc
|
| index 6db79705ece69a44f19b9d48d6340154a9abbf68..e8403ec0221b89d676bb23f680c4bf488f5707ca 100644
|
| --- a/chrome/browser/sessions/session_service.cc
|
| +++ b/chrome/browser/sessions/session_service.cc
|
| @@ -24,7 +24,7 @@
|
| #include "chrome/browser/prefs/session_startup_pref.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| -#include "chrome/browser/sessions/base_session_service_delegate_impl.h"
|
| +#include "chrome/browser/sessions/session_common_utils.h"
|
| #include "chrome/browser/sessions/session_data_deleter.h"
|
| #include "chrome/browser/sessions/session_restore.h"
|
| #include "chrome/browser/sessions/session_service_utils.h"
|
| @@ -64,13 +64,12 @@ static const int kWritesPerReset = 250;
|
| // SessionService -------------------------------------------------------------
|
|
|
| SessionService::SessionService(Profile* profile)
|
| - : BaseSessionServiceDelegateImpl(true),
|
| - profile_(profile),
|
| - base_session_service_(
|
| - new sessions::BaseSessionService(
|
| - sessions::BaseSessionService::SESSION_RESTORE,
|
| - profile->GetPath(),
|
| - this)),
|
| + : profile_(profile),
|
| + should_use_delayed_save_(true),
|
| + base_session_service_(new sessions::BaseSessionService(
|
| + sessions::BaseSessionService::SESSION_RESTORE,
|
| + profile->GetPath(),
|
| + this)),
|
| has_open_trackable_browsers_(false),
|
| move_on_new_browser_(false),
|
| save_delay_in_millis_(base::TimeDelta::FromMilliseconds(2500)),
|
| @@ -84,13 +83,12 @@ SessionService::SessionService(Profile* profile)
|
| }
|
|
|
| SessionService::SessionService(const base::FilePath& save_path)
|
| - : BaseSessionServiceDelegateImpl(false),
|
| - profile_(NULL),
|
| - base_session_service_(
|
| - new sessions::BaseSessionService(
|
| - sessions::BaseSessionService::SESSION_RESTORE,
|
| - save_path,
|
| - this)),
|
| + : profile_(NULL),
|
| + should_use_delayed_save_(false),
|
| + base_session_service_(new sessions::BaseSessionService(
|
| + sessions::BaseSessionService::SESSION_RESTORE,
|
| + save_path,
|
| + this)),
|
| has_open_trackable_browsers_(false),
|
| move_on_new_browser_(false),
|
| save_delay_in_millis_(base::TimeDelta::FromMilliseconds(2500)),
|
| @@ -413,7 +411,7 @@ void SessionService::UpdateTabNavigation(
|
| const SessionID& window_id,
|
| const SessionID& tab_id,
|
| const SerializedNavigationEntry& navigation) {
|
| - if (!ShouldTrackEntry(navigation.virtual_url()) ||
|
| + if (!ShouldTrackURLForRestore(navigation.virtual_url()) ||
|
| !ShouldTrackChangesToWindow(window_id)) {
|
| return;
|
| }
|
| @@ -509,6 +507,15 @@ base::CancelableTaskTracker::TaskId SessionService::GetLastSession(
|
| tracker);
|
| }
|
|
|
| +base::SequencedWorkerPool* SessionService::GetBlockingPool() {
|
| + DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
| + return content::BrowserThread::GetBlockingPool();
|
| +}
|
| +
|
| +bool SessionService::ShouldUseDelayedSave() {
|
| + return should_use_delayed_save_;
|
| +}
|
| +
|
| void SessionService::OnSavedCommands() {
|
| RecordSessionUpdateHistogramData(chrome::NOTIFICATION_SESSION_SERVICE_SAVED,
|
| &last_updated_save_time_);
|
| @@ -764,7 +771,7 @@ void SessionService::BuildCommandsForTab(const SessionID& window_id,
|
| tab->GetController().GetPendingEntry() :
|
| tab->GetController().GetEntryAtIndex(i);
|
| DCHECK(entry);
|
| - if (ShouldTrackEntry(entry->GetVirtualURL())) {
|
| + if (ShouldTrackURLForRestore(entry->GetVirtualURL())) {
|
| const SerializedNavigationEntry navigation =
|
| ContentSerializedNavigationBuilder::FromNavigationEntry(i, *entry);
|
| base_session_service_->AppendRebuildCommand(
|
|
|