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

Unified Diff: session_manager_service.h

Issue 6604012: [login_manager] Fix thread-safety issues at shutdown (Closed) Base URL: http://git.chromium.org/git/login_manager.git@master
Patch Set: Created 9 years, 10 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 | « no previous file | session_manager_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: session_manager_service.h
diff --git a/session_manager_service.h b/session_manager_service.h
index 86a5615f69da60506ac7b40df4e492bd3f76f748..ce59c918dc51d31cc4cc596bb4d3bc1646131b02 100644
--- a/session_manager_service.h
+++ b/session_manager_service.h
@@ -19,6 +19,7 @@
#include <base/ref_counted.h>
#include <base/scoped_ptr.h>
#include <base/thread.h>
+#include <base/waitable_event.h>
#include <chromeos/dbus/abstract_dbus_service.h>
#include <chromeos/dbus/dbus.h>
#include <chromeos/dbus/service_constants.h>
@@ -55,27 +56,6 @@ class SessionManagerService
: public base::RefCountedThreadSafe<SessionManagerService>,
public chromeos::dbus::AbstractDbusService {
public:
- struct PersistKeyData {
- public:
- PersistKeyData(SystemUtils* utils, OwnerKey* key)
- : signaler(utils),
- to_persist(key) {
- }
- ~PersistKeyData() {}
- SystemUtils* signaler;
- OwnerKey* to_persist;
- };
-
- struct PersistStoreData {
- public:
- PersistStoreData(SystemUtils* utils, PrefStore* store)
- : signaler(utils),
- to_persist(store) {
- }
- ~PersistStoreData() {}
- SystemUtils* signaler;
- PrefStore* to_persist;
- };
SessionManagerService(std::vector<ChildJobInterface*> child_jobs);
virtual ~SessionManagerService();
@@ -471,6 +451,10 @@ class SessionManagerService
// to signal Chromium when done.
void PersistStore();
+ // |store_| is persisted to disk, and |event| is signaled when done. This
+ // is used to provide synchronous, threadsafe persisting.
+ void PersistStoreSync(base::WaitableEvent* event);
+
void StartKeyGeneration();
// Uses |system_| to send |signal_name| to Chromium. Attaches a payload
« no previous file with comments | « no previous file | session_manager_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698