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

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

Issue 23463033: Release password store on UI loop when worker is stopped so that password (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/sync/glue/password_model_worker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 7
8 #include "sync/internal_api/public/engine/model_safe_worker.h" 8 #include "sync/internal_api/public/engine/model_safe_worker.h"
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 13 matching lines...) Expand all
24 // from the syncapi that need to be fulfilled on the password thread, 24 // from the syncapi that need to be fulfilled on the password thread,
25 // which is the DB thread on Linux and Windows. 25 // which is the DB thread on Linux and Windows.
26 class PasswordModelWorker : public syncer::ModelSafeWorker { 26 class PasswordModelWorker : public syncer::ModelSafeWorker {
27 public: 27 public:
28 PasswordModelWorker(const scoped_refptr<PasswordStore>& password_store, 28 PasswordModelWorker(const scoped_refptr<PasswordStore>& password_store,
29 syncer::WorkerLoopDestructionObserver* observer); 29 syncer::WorkerLoopDestructionObserver* observer);
30 30
31 // syncer::ModelSafeWorker implementation. Called on syncapi SyncerThread. 31 // syncer::ModelSafeWorker implementation. Called on syncapi SyncerThread.
32 virtual void RegisterForLoopDestruction() OVERRIDE; 32 virtual void RegisterForLoopDestruction() OVERRIDE;
33 virtual syncer::ModelSafeGroup GetModelSafeGroup() OVERRIDE; 33 virtual syncer::ModelSafeGroup GetModelSafeGroup() OVERRIDE;
34 virtual void RequestStop() OVERRIDE;
34 35
35 protected: 36 protected:
36 virtual syncer::SyncerError DoWorkAndWaitUntilDoneImpl( 37 virtual syncer::SyncerError DoWorkAndWaitUntilDoneImpl(
37 const syncer::WorkCallback& work) OVERRIDE; 38 const syncer::WorkCallback& work) OVERRIDE;
38 39
39 private: 40 private:
40 virtual ~PasswordModelWorker(); 41 virtual ~PasswordModelWorker();
41 42
42 void CallDoWorkAndSignalTask( 43 void CallDoWorkAndSignalTask(
43 const syncer::WorkCallback& work, 44 const syncer::WorkCallback& work,
44 base::WaitableEvent* done, 45 base::WaitableEvent* done,
45 syncer::SyncerError* error); 46 syncer::SyncerError* error);
46 47
47 // Called on password thread to add PasswordModelWorker as destruction 48 // Called on password thread to add PasswordModelWorker as destruction
48 // observer. 49 // observer.
49 void RegisterForPasswordLoopDestruction(); 50 void RegisterForPasswordLoopDestruction();
50 51
52 // |password_store_| is used on password thread but released on UI thread.
53 // Protected by |password_store_lock_|.
54 base::Lock password_store_lock_;
51 scoped_refptr<PasswordStore> password_store_; 55 scoped_refptr<PasswordStore> password_store_;
52 DISALLOW_COPY_AND_ASSIGN(PasswordModelWorker); 56 DISALLOW_COPY_AND_ASSIGN(PasswordModelWorker);
53 }; 57 };
54 58
55 } // namespace browser_sync 59 } // namespace browser_sync
56 60
57 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_ 61 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/glue/password_model_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698