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

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

Issue 10698014: [Sync] Rename csync namespace to syncer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 5 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) 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_CHANGE_PROCESSOR_H_ 5 #ifndef CHROME_BROWSER_SYNC_GLUE_PASSWORD_CHANGE_PROCESSOR_H_
6 #define CHROME_BROWSER_SYNC_GLUE_PASSWORD_CHANGE_PROCESSOR_H_ 6 #define CHROME_BROWSER_SYNC_GLUE_PASSWORD_CHANGE_PROCESSOR_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/sync/glue/change_processor.h" 9 #include "chrome/browser/sync/glue/change_processor.h"
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "chrome/browser/sync/glue/data_type_error_handler.h" 13 #include "chrome/browser/sync/glue/data_type_error_handler.h"
14 #include "chrome/browser/sync/glue/password_model_associator.h" 14 #include "chrome/browser/sync/glue/password_model_associator.h"
15 #include "chrome/browser/sync/glue/sync_backend_host.h" 15 #include "chrome/browser/sync/glue/sync_backend_host.h"
16 #include "content/public/browser/notification_observer.h" 16 #include "content/public/browser/notification_observer.h"
17 #include "content/public/browser/notification_registrar.h" 17 #include "content/public/browser/notification_registrar.h"
18 #include "content/public/browser/notification_types.h" 18 #include "content/public/browser/notification_types.h"
19 19
20 class PasswordStore; 20 class PasswordStore;
21 class MessageLoop; 21 class MessageLoop;
22 22
23 namespace browser_sync { 23 namespace browser_sync {
24 24
25 class DataTypeErrorHandler; 25 class DataTypeErrorHandler;
26 26
27 // This class is responsible for taking changes from the password backend and 27 // This class is responsible for taking changes from the password backend and
28 // applying them to the csync 'syncable' model, and vice versa. All 28 // applying them to the sync API 'syncable' model, and vice versa. All
29 // operations and use of this class are from the DB thread on Windows and Linux, 29 // operations and use of this class are from the DB thread on Windows and Linux,
30 // or the password thread on Mac. 30 // or the password thread on Mac.
31 class PasswordChangeProcessor : public ChangeProcessor, 31 class PasswordChangeProcessor : public ChangeProcessor,
32 public content::NotificationObserver { 32 public content::NotificationObserver {
33 public: 33 public:
34 PasswordChangeProcessor(PasswordModelAssociator* model_associator, 34 PasswordChangeProcessor(PasswordModelAssociator* model_associator,
35 PasswordStore* password_store, 35 PasswordStore* password_store,
36 DataTypeErrorHandler* error_handler); 36 DataTypeErrorHandler* error_handler);
37 virtual ~PasswordChangeProcessor(); 37 virtual ~PasswordChangeProcessor();
38 38
39 // content::NotificationObserver implementation. 39 // content::NotificationObserver implementation.
40 // Passwords -> csync model change application. 40 // Passwords -> sync API model change application.
41 virtual void Observe(int type, 41 virtual void Observe(int type,
42 const content::NotificationSource& source, 42 const content::NotificationSource& source,
43 const content::NotificationDetails& details) OVERRIDE; 43 const content::NotificationDetails& details) OVERRIDE;
44 44
45 // csync model -> WebDataService change application. 45 // sync API model -> WebDataService change application.
46 virtual void ApplyChangesFromSyncModel( 46 virtual void ApplyChangesFromSyncModel(
47 const csync::BaseTransaction* trans, 47 const syncer::BaseTransaction* trans,
48 const csync::ImmutableChangeRecordList& changes) OVERRIDE; 48 const syncer::ImmutableChangeRecordList& changes) OVERRIDE;
49 49
50 // Commit changes buffered during ApplyChanges. We must commit them to the 50 // Commit changes buffered during ApplyChanges. We must commit them to the
51 // password store only after the csync transaction is released, else there 51 // password store only after the sync API transaction is released, else there
52 // is risk of deadlock due to the password store posting tasks to the UI 52 // is risk of deadlock due to the password store posting tasks to the UI
53 // thread (http://crbug.com/70658). 53 // thread (http://crbug.com/70658).
54 virtual void CommitChangesFromSyncModel() OVERRIDE; 54 virtual void CommitChangesFromSyncModel() OVERRIDE;
55 55
56 protected: 56 protected:
57 virtual void StartImpl(Profile* profile) OVERRIDE; 57 virtual void StartImpl(Profile* profile) OVERRIDE;
58 virtual void StopImpl() OVERRIDE; 58 virtual void StopImpl() OVERRIDE;
59 59
60 private: 60 private:
61 friend class ScopedStopObserving<PasswordChangeProcessor>; 61 friend class ScopedStopObserving<PasswordChangeProcessor>;
(...skipping 19 matching lines...) Expand all
81 bool observing_; 81 bool observing_;
82 82
83 MessageLoop* expected_loop_; 83 MessageLoop* expected_loop_;
84 84
85 DISALLOW_COPY_AND_ASSIGN(PasswordChangeProcessor); 85 DISALLOW_COPY_AND_ASSIGN(PasswordChangeProcessor);
86 }; 86 };
87 87
88 } // namespace browser_sync 88 } // namespace browser_sync
89 89
90 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_CHANGE_PROCESSOR_H_ 90 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_CHANGE_PROCESSOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698