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

Unified Diff: chrome/browser/sync/engine/syncapi.h

Issue 553015: Support for multiple sync ModelSafeWorkers.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/engine/process_updates_command.cc ('k') | chrome/browser/sync/engine/syncapi.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncapi.h
===================================================================
--- chrome/browser/sync/engine/syncapi.h (revision 36603)
+++ chrome/browser/sync/engine/syncapi.h (working copy)
@@ -52,6 +52,10 @@
// on all platforms.
#define SYNC_EXPORT
+namespace browser_sync {
+class ModelSafeWorkerRegistrar;
+}
+
// Forward declarations of internal class types so that sync API objects
// may have opaque pointers to these types.
namespace syncable {
@@ -69,7 +73,6 @@
// Forward declarations of classes to be defined later in this file.
class BaseTransaction;
class HttpPostProviderFactory;
-class ModelSafeWorkerInterface;
class SyncManager;
class WriteTransaction;
struct UserShare;
@@ -509,7 +512,7 @@
bool use_ssl,
HttpPostProviderFactory* post_factory,
HttpPostProviderFactory* auth_post_factory,
- ModelSafeWorkerInterface* model_safe_worker,
+ browser_sync::ModelSafeWorkerRegistrar* registrar,
bool attempt_last_user_authentication,
const char* user_agent,
const char* lsid);
@@ -639,33 +642,6 @@
virtual ~HttpPostProviderFactory() { }
};
-// A class syncapi clients should use whenever the underlying model is bound to
-// a particular thread in the embedding application. This exposes an interface
-// by which any model-modifying invocations will be forwarded to the
-// appropriate thread in the embedding application.
-// "model safe" refers to not allowing an embedding application model to fall
-// out of sync with the syncable::Directory due to race conditions.
-class ModelSafeWorkerInterface {
- public:
- virtual ~ModelSafeWorkerInterface() { }
- // A Visitor is passed to CallDoWorkFromModelSafeThreadAndWait invocations,
- // and it's sole purpose is to provide a way for the ModelSafeWorkerInterface
- // implementation to actually _do_ the work required, by calling the only
- // method on this class, DoWork().
- class Visitor {
- public:
- virtual ~Visitor() { }
- // When on a model safe thread, this should be called to have the syncapi
- // actually perform the work needing to be done.
- virtual void DoWork() = 0;
- };
- // Subclasses should implement to invoke DoWork on |visitor| once on a thread
- // appropriate for data model modifications.
- // While it doesn't hurt, the impl does not need to be re-entrant (for now).
- // Note: |visitor| is owned by caller.
- virtual void CallDoWorkFromModelSafeThreadAndWait(Visitor* visitor) = 0;
-};
-
} // namespace sync_api
#endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_
« no previous file with comments | « chrome/browser/sync/engine/process_updates_command.cc ('k') | chrome/browser/sync/engine/syncapi.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698