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

Unified Diff: chrome/browser/sessions/base_session_service.cc

Issue 9751015: ~Browser: Don't create TabRestoreService on exit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | « chrome/browser/sessions/base_session_service.h ('k') | chrome/browser/sessions/session_service_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/base_session_service.cc
diff --git a/chrome/browser/sessions/base_session_service.cc b/chrome/browser/sessions/base_session_service.cc
index 6925d91d52645c80f497a46b0cb75242c47ac60f..d5e4b576d131c25a1dde343ea55540e4df0abb72 100644
--- a/chrome/browser/sessions/base_session_service.cc
+++ b/chrome/browser/sessions/base_session_service.cc
@@ -91,15 +91,8 @@ BaseSessionService::BaseSessionService(SessionType type,
profile_ ? profile_->GetPath() : path_);
DCHECK(backend_.get());
- if (!RunningInProduction()) {
- // We seem to be running as part of a test, in which case we need
- // to explicitly initialize the backend. In production, the
- // backend will automatically initialize itself just in time.
- //
- // Note that it's important not to initialize too early in
- // production; this can cause e.g. http://crbug.com/110785.
- backend_->Init();
- }
+ RunTaskOnBackendThread(FROM_HERE,
+ base::Bind(&SessionBackend::Init, backend_));
}
BaseSessionService::~BaseSessionService() {
@@ -364,14 +357,10 @@ BaseSessionService::Handle BaseSessionService::ScheduleGetLastSessionCommands(
return request->handle();
}
-bool BaseSessionService::RunningInProduction() const {
- return profile_ && BrowserThread::IsMessageLoopValid(BrowserThread::FILE);
-}
-
bool BaseSessionService::RunTaskOnBackendThread(
const tracked_objects::Location& from_here,
const base::Closure& task) {
- if (RunningInProduction()) {
+ if (profile_ && BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) {
return BrowserThread::PostTask(BrowserThread::FILE, from_here, task);
} else {
// Fall back to executing on the main thread if the file thread
« no previous file with comments | « chrome/browser/sessions/base_session_service.h ('k') | chrome/browser/sessions/session_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698