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

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

Issue 8341117: Converted top-level NewRunnable* to Bind for Sync module (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Indenting. Removed trailing whitespace. Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/callback.h" 7 #include "base/callback.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/task.h" 9 #include "base/task.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
11 #include "chrome/browser/password_manager/password_store.h" 11 #include "chrome/browser/password_manager/password_store.h"
12 12
13 using base::WaitableEvent; 13 using base::WaitableEvent;
14 14
15 namespace browser_sync { 15 namespace browser_sync {
16 16
17 PasswordModelWorker::PasswordModelWorker(PasswordStore* password_store) 17 PasswordModelWorker::PasswordModelWorker(PasswordStore* password_store)
18 : password_store_(password_store) { 18 : password_store_(password_store) {
19 DCHECK(password_store); 19 DCHECK(password_store);
20 } 20 }
21 21
22 PasswordModelWorker::~PasswordModelWorker() {} 22 PasswordModelWorker::~PasswordModelWorker() {}
23 23
24 UnrecoverableErrorInfo PasswordModelWorker::DoWorkAndWaitUntilDone( 24 UnrecoverableErrorInfo PasswordModelWorker::DoWorkAndWaitUntilDone(
25 const WorkCallback& work) { 25 const WorkCallback& work) {
26 WaitableEvent done(false, false); 26 WaitableEvent done(false, false);
27 UnrecoverableErrorInfo error_info; 27 UnrecoverableErrorInfo error_info;
28 password_store_->ScheduleTask( 28 password_store_->ScheduleTask(
29 NewRunnableMethod(this, &PasswordModelWorker::CallDoWorkAndSignalTask, 29 base::Bind(&PasswordModelWorker::CallDoWorkAndSignalTask,
30 work, &done, &error_info)); 30 this, work, &done, &error_info));
31 done.Wait(); 31 done.Wait();
32 return error_info; 32 return error_info;
33 } 33 }
34 34
35 void PasswordModelWorker::CallDoWorkAndSignalTask( 35 void PasswordModelWorker::CallDoWorkAndSignalTask(
36 const WorkCallback& work, 36 const WorkCallback& work,
37 WaitableEvent* done, 37 WaitableEvent* done,
38 UnrecoverableErrorInfo* error_info) { 38 UnrecoverableErrorInfo* error_info) {
39 *error_info = work.Run(); 39 *error_info = work.Run();
40 done->Signal(); 40 done->Signal();
41 } 41 }
42 42
43 ModelSafeGroup PasswordModelWorker::GetModelSafeGroup() { 43 ModelSafeGroup PasswordModelWorker::GetModelSafeGroup() {
44 return GROUP_PASSWORD; 44 return GROUP_PASSWORD;
45 } 45 }
46 46
47 } // namespace browser_sync 47 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/password_data_type_controller.cc ('k') | chrome/browser/sync/glue/sync_backend_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698