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

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

Issue 10696087: [Sync] Move ModelType and related classes to 'syncer' namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sort headers, update copyrights 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_SHARED_CHANGE_PROCESSOR_H_ 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SHARED_CHANGE_PROCESSOR_H_
6 #define CHROME_BROWSER_SYNC_GLUE_SHARED_CHANGE_PROCESSOR_H_ 6 #define CHROME_BROWSER_SYNC_GLUE_SHARED_CHANGE_PROCESSOR_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 // Connect to the Syncer and prepare to handle changes for |type|. Will 58 // Connect to the Syncer and prepare to handle changes for |type|. Will
59 // create and store a new GenericChangeProcessor and return a weak pointer to 59 // create and store a new GenericChangeProcessor and return a weak pointer to
60 // the syncer::SyncableService associated with |type|. 60 // the syncer::SyncableService associated with |type|.
61 // Note: If this SharedChangeProcessor has been disconnected, or the 61 // Note: If this SharedChangeProcessor has been disconnected, or the
62 // syncer::SyncableService was not alive, will return a null weak pointer. 62 // syncer::SyncableService was not alive, will return a null weak pointer.
63 virtual base::WeakPtr<syncer::SyncableService> Connect( 63 virtual base::WeakPtr<syncer::SyncableService> Connect(
64 ProfileSyncComponentsFactory* sync_factory, 64 ProfileSyncComponentsFactory* sync_factory,
65 ProfileSyncService* sync_service, 65 ProfileSyncService* sync_service,
66 DataTypeErrorHandler* error_handler, 66 DataTypeErrorHandler* error_handler,
67 syncable::ModelType type); 67 syncer::ModelType type);
68 68
69 // Disconnects from the generic change processor. May be called from any 69 // Disconnects from the generic change processor. May be called from any
70 // thread. After this, all attempts to interact with the change processor by 70 // thread. After this, all attempts to interact with the change processor by
71 // |local_service_| are dropped and return errors. The syncer will be safe to 71 // |local_service_| are dropped and return errors. The syncer will be safe to
72 // shut down from the point of view of this datatype. 72 // shut down from the point of view of this datatype.
73 // Note: Once disconnected, you cannot reconnect without creating a new 73 // Note: Once disconnected, you cannot reconnect without creating a new
74 // SharedChangeProcessor. 74 // SharedChangeProcessor.
75 // Returns: true if we were previously succesfully connected, false if we were 75 // Returns: true if we were previously succesfully connected, false if we were
76 // already disconnected. 76 // already disconnected.
77 virtual bool Disconnect(); 77 virtual bool Disconnect();
(...skipping 24 matching lines...) Expand all
102 private: 102 private:
103 // Monitor lock for this object. All methods that interact with the change 103 // Monitor lock for this object. All methods that interact with the change
104 // processor must aquire this lock and check whether we're disconnected or 104 // processor must aquire this lock and check whether we're disconnected or
105 // not. Once disconnected, all attempted changes to or loads from the change 105 // not. Once disconnected, all attempted changes to or loads from the change
106 // processor return errors. This enables us to shut down the syncer without 106 // processor return errors. This enables us to shut down the syncer without
107 // having to wait for possibly non-UI thread datatypes to complete work. 107 // having to wait for possibly non-UI thread datatypes to complete work.
108 mutable base::Lock monitor_lock_; 108 mutable base::Lock monitor_lock_;
109 bool disconnected_; 109 bool disconnected_;
110 110
111 // The sync datatype we were last connected to. 111 // The sync datatype we were last connected to.
112 syncable::ModelType type_; 112 syncer::ModelType type_;
113 113
114 // The ProfileSyncService we're currently connected to. 114 // The ProfileSyncService we're currently connected to.
115 ProfileSyncService* sync_service_; 115 ProfileSyncService* sync_service_;
116 116
117 // The loop that all methods except the constructor, destructor, and 117 // The loop that all methods except the constructor, destructor, and
118 // Disconnect() should be called on. Set in Connect(). 118 // Disconnect() should be called on. Set in Connect().
119 scoped_refptr<base::MessageLoopProxy> backend_loop_; 119 scoped_refptr<base::MessageLoopProxy> backend_loop_;
120 120
121 // Used only on |backend_loop_|. 121 // Used only on |backend_loop_|.
122 GenericChangeProcessor* generic_change_processor_; 122 GenericChangeProcessor* generic_change_processor_;
123 123
124 DataTypeErrorHandler* error_handler_; 124 DataTypeErrorHandler* error_handler_;
125 125
126 DISALLOW_COPY_AND_ASSIGN(SharedChangeProcessor); 126 DISALLOW_COPY_AND_ASSIGN(SharedChangeProcessor);
127 }; 127 };
128 128
129 } // namespace browser_sync 129 } // namespace browser_sync
130 130
131 #endif // CHROME_BROWSER_SYNC_GLUE_SHARED_CHANGE_PROCESSOR_H_ 131 #endif // CHROME_BROWSER_SYNC_GLUE_SHARED_CHANGE_PROCESSOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/session_model_associator.cc ('k') | chrome/browser/sync/glue/shared_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698