OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sync/glue/password_model_worker.h" | 5 #include "chrome/browser/sync/glue/password_model_worker.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "components/password_manager/core/browser/password_store.h" | 10 #include "components/password_manager/core/browser/password_store.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 void PasswordModelWorker::CallDoWorkAndSignalTask( | 58 void PasswordModelWorker::CallDoWorkAndSignalTask( |
59 const syncer::WorkCallback& work, | 59 const syncer::WorkCallback& work, |
60 WaitableEvent* done, | 60 WaitableEvent* done, |
61 syncer::SyncerError *error) { | 61 syncer::SyncerError *error) { |
62 *error = work.Run(); | 62 *error = work.Run(); |
63 done->Signal(); | 63 done->Signal(); |
64 } | 64 } |
65 | 65 |
66 void PasswordModelWorker::RegisterForPasswordLoopDestruction() { | 66 void PasswordModelWorker::RegisterForPasswordLoopDestruction() { |
| 67 base::MessageLoop::current()->AddDestructionObserver(this); |
67 SetWorkingLoopToCurrent(); | 68 SetWorkingLoopToCurrent(); |
68 } | 69 } |
69 | 70 |
70 void PasswordModelWorker::RequestStop() { | 71 void PasswordModelWorker::RequestStop() { |
71 ModelSafeWorker::RequestStop(); | 72 ModelSafeWorker::RequestStop(); |
72 | 73 |
73 base::AutoLock lock(password_store_lock_); | 74 base::AutoLock lock(password_store_lock_); |
74 password_store_ = NULL; | 75 password_store_ = NULL; |
75 } | 76 } |
76 | 77 |
77 } // namespace browser_sync | 78 } // namespace browser_sync |
OLD | NEW |