| 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
|
|
|