OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/base_session_service.h" | 5 #include "chrome/browser/sessions/base_session_service.h" |
6 | 6 |
7 #include "base/pickle.h" | 7 #include "base/pickle.h" |
8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 BaseSessionService::BaseSessionService(SessionType type, | 62 BaseSessionService::BaseSessionService(SessionType type, |
63 Profile* profile, | 63 Profile* profile, |
64 const FilePath& path) | 64 const FilePath& path) |
65 : profile_(profile), | 65 : profile_(profile), |
66 path_(path), | 66 path_(path), |
67 backend_thread_(NULL), | 67 backend_thread_(NULL), |
68 ALLOW_THIS_IN_INITIALIZER_LIST(save_factory_(this)), | 68 ALLOW_THIS_IN_INITIALIZER_LIST(save_factory_(this)), |
69 pending_reset_(false), | 69 pending_reset_(false), |
70 commands_since_reset_(0) { | 70 commands_since_reset_(0) { |
71 if (profile) { | 71 if (profile) { |
72 // We should never be created when off the record. | 72 // We should never be created when incognito. |
73 DCHECK(!profile->IsOffTheRecord()); | 73 DCHECK(!profile->IsOffTheRecord()); |
74 } | 74 } |
75 backend_ = new SessionBackend(type, | 75 backend_ = new SessionBackend(type, |
76 profile_ ? profile_->GetPath() : path_); | 76 profile_ ? profile_->GetPath() : path_); |
77 DCHECK(backend_.get()); | 77 DCHECK(backend_.get()); |
78 backend_thread_ = g_browser_process->file_thread(); | 78 backend_thread_ = g_browser_process->file_thread(); |
79 if (!backend_thread_) | 79 if (!backend_thread_) |
80 backend_->Init(); | 80 backend_->Init(); |
81 // If backend_thread is non-null, backend will init itself as appropriate. | 81 // If backend_thread is non-null, backend will init itself as appropriate. |
82 } | 82 } |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 if (backend_thread()) { | 277 if (backend_thread()) { |
278 backend_thread()->message_loop()->PostTask(FROM_HERE, | 278 backend_thread()->message_loop()->PostTask(FROM_HERE, |
279 NewRunnableMethod(backend(), | 279 NewRunnableMethod(backend(), |
280 &SessionBackend::ReadCurrentSessionCommands, | 280 &SessionBackend::ReadCurrentSessionCommands, |
281 request_wrapper)); | 281 request_wrapper)); |
282 } else { | 282 } else { |
283 backend()->ReadCurrentSessionCommands(request); | 283 backend()->ReadCurrentSessionCommands(request); |
284 } | 284 } |
285 return request->handle(); | 285 return request->handle(); |
286 } | 286 } |
OLD | NEW |