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

Unified Diff: chrome/browser/sync/glue/data_type_manager_impl2.h

Issue 6528042: sync: rewrite DataTypeManagerImpl without pause/resume logic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: comments Created 9 years, 10 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/glue/data_type_manager.h ('k') | chrome/browser/sync/glue/data_type_manager_impl2.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/data_type_manager_impl2.h
diff --git a/chrome/browser/sync/glue/data_type_manager_impl2.h b/chrome/browser/sync/glue/data_type_manager_impl2.h
new file mode 100644
index 0000000000000000000000000000000000000000..570a38b1fc6ad2f185bee56572c0bec064ba777f
--- /dev/null
+++ b/chrome/browser/sync/glue/data_type_manager_impl2.h
@@ -0,0 +1,70 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SYNC_GLUE_DATA_TYPE_MANAGER_IMPL2_H__
+#define CHROME_BROWSER_SYNC_GLUE_DATA_TYPE_MANAGER_IMPL2_H__
+#pragma once
+
+#include "chrome/browser/sync/glue/data_type_manager.h"
+
+#include <map>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/task.h"
+
+namespace browser_sync {
+
+class DataTypeController;
+class SyncBackendHost;
+
+class DataTypeManagerImpl2 : public DataTypeManager {
+ public:
+ DataTypeManagerImpl2(SyncBackendHost* backend,
+ const DataTypeController::TypeMap& controllers);
+ virtual ~DataTypeManagerImpl2();
+
+ // DataTypeManager interface.
+ virtual void Configure(const TypeSet& desired_types);
+ virtual void Stop();
+ virtual const DataTypeController::TypeMap& controllers();
+ virtual State state();
+
+ private:
+ // Starts the next data type in the kStartOrder list, indicated by
+ // the current_type_ member. If there are no more data types to
+ // start, the stashed start_callback_ is invoked.
+ void StartNextType();
+
+ // Callback passed to each data type controller on startup.
+ void TypeStartCallback(DataTypeController::StartResult result);
+
+ // Stops all data types.
+ void FinishStop();
+ void FinishStopAndNotify(ConfigureResult result);
+
+ void Restart();
+ void DownloadReady();
+ void NotifyStart();
+ void NotifyDone(ConfigureResult result);
+
+ SyncBackendHost* backend_;
+ // Map of all data type controllers that are available for sync.
+ // This list is determined at startup by various command line flags.
+ const DataTypeController::TypeMap controllers_;
+ State state_;
+ DataTypeController* current_dtc_;
+ std::map<syncable::ModelType, int> start_order_;
+ TypeSet last_requested_types_;
+ std::vector<DataTypeController*> needs_start_;
+ std::vector<DataTypeController*> needs_stop_;
+
+ ScopedRunnableMethodFactory<DataTypeManagerImpl2> method_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(DataTypeManagerImpl2);
+};
+
+} // namespace browser_sync
+
+#endif // CHROME_BROWSER_SYNC_GLUE_DATA_TYPE_MANAGER_IMPL2_H__
« no previous file with comments | « chrome/browser/sync/glue/data_type_manager.h ('k') | chrome/browser/sync/glue/data_type_manager_impl2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698