blob: 6132a0362322b6c1d54250f4f2f831bce4df7345 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/sync/glue/password_model_worker.h"
#include "base/callback.h"
#include "base/ref_counted.h"
#include "base/task.h"
#include "base/synchronization/waitable_event.h"
#include "chrome/browser/password_manager/password_store.h"
using base::WaitableEvent;
namespace browser_sync {
PasswordModelWorker::PasswordModelWorker(PasswordStore* password_store)
: password_store_(password_store) {
DCHECK(password_store);
}
PasswordModelWorker::~PasswordModelWorker() {}
void PasswordModelWorker::DoWorkAndWaitUntilDone(Callback0::Type* work) {
WaitableEvent done(false, false);
password_store_->ScheduleTask(
NewRunnableMethod(this, &PasswordModelWorker::CallDoWorkAndSignalTask,
work, &done));
done.Wait();
}
void PasswordModelWorker::CallDoWorkAndSignalTask(Callback0::Type* work,
WaitableEvent* done) {
work->Run();
done->Signal();
}
ModelSafeGroup PasswordModelWorker::GetModelSafeGroup() {
return GROUP_PASSWORD;
}
bool PasswordModelWorker::CurrentThreadIsWorkThread() {
// TODO(ncarter): How to determine this?
return true;
}
} // namespace browser_sync
|