| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "components/password_manager/sync/browser/password_model_worker.h" | 5 #include "components/password_manager/sync/browser/password_model_worker.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 work_done_or_abandoned.Wait(); | 55 work_done_or_abandoned.Wait(); |
| 56 else | 56 else |
| 57 error = syncer::CANNOT_DO_WORK; | 57 error = syncer::CANNOT_DO_WORK; |
| 58 return error; | 58 return error; |
| 59 } | 59 } |
| 60 | 60 |
| 61 syncer::ModelSafeGroup PasswordModelWorker::GetModelSafeGroup() { | 61 syncer::ModelSafeGroup PasswordModelWorker::GetModelSafeGroup() { |
| 62 return syncer::GROUP_PASSWORD; | 62 return syncer::GROUP_PASSWORD; |
| 63 } | 63 } |
| 64 | 64 |
| 65 bool PasswordModelWorker::IsOnModelThread() { |
| 66 // Ideally PasswordStore would expose a way to check whether this is the |
| 67 // thread it does work on. Since it doesn't, just return true to bypass a |
| 68 // CHECK in the sync code. |
| 69 return true; |
| 70 } |
| 71 |
| 65 PasswordModelWorker::~PasswordModelWorker() {} | 72 PasswordModelWorker::~PasswordModelWorker() {} |
| 66 | 73 |
| 67 void PasswordModelWorker::RequestStop() { | 74 void PasswordModelWorker::RequestStop() { |
| 68 ModelSafeWorker::RequestStop(); | 75 ModelSafeWorker::RequestStop(); |
| 69 | 76 |
| 70 base::AutoLock lock(password_store_lock_); | 77 base::AutoLock lock(password_store_lock_); |
| 71 password_store_ = NULL; | 78 password_store_ = NULL; |
| 72 } | 79 } |
| 73 | 80 |
| 74 } // namespace browser_sync | 81 } // namespace browser_sync |
| OLD | NEW |