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

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

Issue 2521001: AutoFill: Make PersonalDataManager RefCountedThreadSafe. (Closed)
Patch Set: Fix lints. Created 10 years, 6 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_AUTOFILL_MODEL_ASSOCIATOR_H_ 5 #ifndef CHROME_BROWSER_SYNC_GLUE_AUTOFILL_MODEL_ASSOCIATOR_H_
6 #define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_MODEL_ASSOCIATOR_H_ 6 #define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_MODEL_ASSOCIATOR_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/lock.h" 14 #include "base/lock.h"
15 #include "base/ref_counted.h"
15 #include "base/scoped_ptr.h" 16 #include "base/scoped_ptr.h"
16 #include "chrome/browser/autofill/personal_data_manager.h" 17 #include "chrome/browser/autofill/personal_data_manager.h"
17 #include "chrome/browser/chrome_thread.h" 18 #include "chrome/browser/chrome_thread.h"
18 #include "chrome/browser/sync/engine/syncapi.h" 19 #include "chrome/browser/sync/engine/syncapi.h"
19 #include "chrome/browser/sync/glue/model_associator.h" 20 #include "chrome/browser/sync/glue/model_associator.h"
20 #include "chrome/browser/sync/protocol/autofill_specifics.pb.h" 21 #include "chrome/browser/sync/protocol/autofill_specifics.pb.h"
21 #include "chrome/browser/webdata/autofill_entry.h" 22 #include "chrome/browser/webdata/autofill_entry.h"
22 23
23 class AutoFillProfile; 24 class AutoFillProfile;
24 25
(...skipping 30 matching lines...) Expand all
55 // A task used by this class and the change processor to inform the 56 // A task used by this class and the change processor to inform the
56 // PersonalDataManager living on the UI thread that it needs to refresh. 57 // PersonalDataManager living on the UI thread that it needs to refresh.
57 class DoOptimisticRefreshTask : public Task { 58 class DoOptimisticRefreshTask : public Task {
58 public: 59 public:
59 explicit DoOptimisticRefreshTask(PersonalDataManager* pdm) : pdm_(pdm) {} 60 explicit DoOptimisticRefreshTask(PersonalDataManager* pdm) : pdm_(pdm) {}
60 virtual void Run() { 61 virtual void Run() {
61 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); 62 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
62 pdm_->Refresh(); 63 pdm_->Refresh();
63 } 64 }
64 private: 65 private:
65 PersonalDataManager* pdm_; 66 scoped_refptr<PersonalDataManager> pdm_;
66 }; 67 };
67 68
68 // PerDataTypeAssociatorInterface implementation. 69 // PerDataTypeAssociatorInterface implementation.
69 // 70 //
70 // Iterates through the sync model looking for matched pairs of items. 71 // Iterates through the sync model looking for matched pairs of items.
71 virtual bool AssociateModels(); 72 virtual bool AssociateModels();
72 73
73 // Clears all associations. 74 // Clears all associations.
74 virtual bool DisassociateModels(); 75 virtual bool DisassociateModels();
75 76
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 // AssociateModels method as soon as possible. 215 // AssociateModels method as soon as possible.
215 Lock abort_association_pending_lock_; 216 Lock abort_association_pending_lock_;
216 bool abort_association_pending_; 217 bool abort_association_pending_;
217 218
218 DISALLOW_COPY_AND_ASSIGN(AutofillModelAssociator); 219 DISALLOW_COPY_AND_ASSIGN(AutofillModelAssociator);
219 }; 220 };
220 221
221 } // namespace browser_sync 222 } // namespace browser_sync
222 223
223 #endif // CHROME_BROWSER_SYNC_GLUE_AUTOFILL_MODEL_ASSOCIATOR_H_ 224 #endif // CHROME_BROWSER_SYNC_GLUE_AUTOFILL_MODEL_ASSOCIATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698