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

Unified Diff: chrome/browser/sync/glue/password_model_worker.cc

Issue 1851004: Adding sync support for Passwords (Closed)
Patch Set: Ready for checkin Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/glue/password_model_worker.h ('k') | chrome/browser/sync/glue/sync_backend_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/password_model_worker.cc
diff --git a/chrome/browser/sync/glue/password_model_worker.cc b/chrome/browser/sync/glue/password_model_worker.cc
new file mode 100644
index 0000000000000000000000000000000000000000..be7531b89fb8886b133e5f9d62acf4fc53dc4a60
--- /dev/null
+++ b/chrome/browser/sync/glue/password_model_worker.cc
@@ -0,0 +1,41 @@
+// 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/logging.h"
+#include "base/ref_counted.h"
+#include "base/task.h"
+#include "base/waitable_event.h"
+#include "chrome/browser/password_manager/password_store.h"
+#include "chrome/browser/sync/util/closure.h"
+
+using base::WaitableEvent;
+
+namespace browser_sync {
+
+PasswordModelWorker::PasswordModelWorker(PasswordStore* password_store)
+ : password_store_(password_store) {
+}
+
+void PasswordModelWorker::DoWorkAndWaitUntilDone(Closure* work) {
+ WaitableEvent done(false, false);
+ password_store_->ScheduleTask(
+ NewRunnableMethod(this, &PasswordModelWorker::CallDoWorkAndSignalTask,
+ work, &done));
+ done.Wait();
+}
+
+void PasswordModelWorker::CallDoWorkAndSignalTask(Closure* work,
+ WaitableEvent* done) {
+ work->Run();
+ done->Signal();
+}
+
+bool PasswordModelWorker::CurrentThreadIsWorkThread() {
+ // TODO(ncarter): How to determine this?
+ return true;
+}
+
+} // namespace browser_sync
« no previous file with comments | « chrome/browser/sync/glue/password_model_worker.h ('k') | chrome/browser/sync/glue/sync_backend_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698