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

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

Issue 8366030: Introduce the plumbing necessary to report Unrecoverable error from model safe workers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 9 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 | 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 #ifndef CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_ 5 #ifndef CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_
6 #define CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_ 6 #define CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/sync/engine/model_safe_worker.h" 9 #include "chrome/browser/sync/engine/model_safe_worker.h"
10 #include "chrome/browser/sync/sessions/unrecoverable_error_info.h"
10 11
11 #include "base/basictypes.h" 12 #include "base/basictypes.h"
12 #include "base/callback.h" 13 #include "base/callback.h"
13 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
14 15
15 class PasswordStore; 16 class PasswordStore;
16 17
17 namespace base { 18 namespace base {
18 class WaitableEvent; 19 class WaitableEvent;
19 } 20 }
20 21
21 namespace browser_sync { 22 namespace browser_sync {
22 23
23 // A ModelSafeWorker for password models that accepts requests 24 // A ModelSafeWorker for password models that accepts requests
24 // from the syncapi that need to be fulfilled on the password thread, 25 // from the syncapi that need to be fulfilled on the password thread,
25 // which is the DB thread on Linux and Windows. 26 // which is the DB thread on Linux and Windows.
26 class PasswordModelWorker : public browser_sync::ModelSafeWorker { 27 class PasswordModelWorker : public browser_sync::ModelSafeWorker {
27 public: 28 public:
28 explicit PasswordModelWorker(PasswordStore* password_store); 29 explicit PasswordModelWorker(PasswordStore* password_store);
29 virtual ~PasswordModelWorker(); 30 virtual ~PasswordModelWorker();
30 31
31 // ModelSafeWorker implementation. Called on syncapi SyncerThread. 32 // ModelSafeWorker implementation. Called on syncapi SyncerThread.
32 virtual void DoWorkAndWaitUntilDone(Callback0::Type* work); 33 virtual sessions::UnrecoverableErrorInfo DoWorkAndWaitUntilDone(
34 Callback1<sessions::UnrecoverableErrorInfo*>::Type* work) OVERRIDE;
33 virtual ModelSafeGroup GetModelSafeGroup(); 35 virtual ModelSafeGroup GetModelSafeGroup();
34 36
35 private: 37 private:
36 void CallDoWorkAndSignalTask(Callback0::Type* work, 38 void CallDoWorkAndSignalTask(
37 base::WaitableEvent* done); 39 Callback1<sessions::UnrecoverableErrorInfo*>::Type* work,
40 base::WaitableEvent* done,
41 sessions::UnrecoverableErrorInfo* error_info);
38 42
39 scoped_refptr<PasswordStore> password_store_; 43 scoped_refptr<PasswordStore> password_store_;
40 DISALLOW_COPY_AND_ASSIGN(PasswordModelWorker); 44 DISALLOW_COPY_AND_ASSIGN(PasswordModelWorker);
41 }; 45 };
42 46
43 } // namespace browser_sync 47 } // namespace browser_sync
44 48
45 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_ 49 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698