| 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 "chrome/browser/password_manager/password_store.h" | 10 #include "chrome/browser/password_manager/password_store.h" |
| 11 | 11 |
| 12 using base::WaitableEvent; | 12 using base::WaitableEvent; |
| 13 | 13 |
| 14 namespace browser_sync { | 14 namespace browser_sync { |
| 15 | 15 |
| 16 PasswordModelWorker::PasswordModelWorker(PasswordStore* password_store) | 16 PasswordModelWorker::PasswordModelWorker( |
| 17 const scoped_refptr<PasswordStore>& password_store) |
| 17 : password_store_(password_store) { | 18 : password_store_(password_store) { |
| 18 DCHECK(password_store); | 19 DCHECK(password_store); |
| 19 } | 20 } |
| 20 | 21 |
| 21 PasswordModelWorker::~PasswordModelWorker() {} | 22 PasswordModelWorker::~PasswordModelWorker() {} |
| 22 | 23 |
| 23 SyncerError PasswordModelWorker::DoWorkAndWaitUntilDone( | 24 SyncerError PasswordModelWorker::DoWorkAndWaitUntilDone( |
| 24 const WorkCallback& work) { | 25 const WorkCallback& work) { |
| 25 WaitableEvent done(false, false); | 26 WaitableEvent done(false, false); |
| 26 SyncerError error = UNSET; | 27 SyncerError error = UNSET; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 37 SyncerError *error) { | 38 SyncerError *error) { |
| 38 *error = work.Run(); | 39 *error = work.Run(); |
| 39 done->Signal(); | 40 done->Signal(); |
| 40 } | 41 } |
| 41 | 42 |
| 42 ModelSafeGroup PasswordModelWorker::GetModelSafeGroup() { | 43 ModelSafeGroup PasswordModelWorker::GetModelSafeGroup() { |
| 43 return GROUP_PASSWORD; | 44 return GROUP_PASSWORD; |
| 44 } | 45 } |
| 45 | 46 |
| 46 } // namespace browser_sync | 47 } // namespace browser_sync |
| OLD | NEW |