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

Side by Side Diff: chrome/browser/sync/glue/password_model_worker.cc

Issue 667573007: Revert "Sync: Avoid deadlock in SyncBackendRegistrar / ModelSafeWorker on sync backend shutdown." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/history_model_worker.cc ('k') | chrome/browser/sync/glue/sync_backend_registrar_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698