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

Side by Side Diff: chrome/browser/sync/api/syncable_service.h

Issue 8065016: [Sync] Refactor non-frontend DTC to handle new API properly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase++++ Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_API_SYNCABLE_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SYNC_API_SYNCABLE_SERVICE_H_
6 #define CHROME_BROWSER_SYNC_API_SYNCABLE_SERVICE_H_ 6 #define CHROME_BROWSER_SYNC_API_SYNCABLE_SERVICE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/weak_ptr.h"
12 #include "chrome/browser/sync/syncable/model_type.h" 13 #include "chrome/browser/sync/syncable/model_type.h"
13 #include "chrome/browser/sync/api/sync_change_processor.h" 14 #include "chrome/browser/sync/api/sync_change_processor.h"
14 #include "chrome/browser/sync/api/sync_data.h" 15 #include "chrome/browser/sync/api/sync_data.h"
15 #include "chrome/browser/sync/api/sync_error.h" 16 #include "chrome/browser/sync/api/sync_error.h"
16 17
17 class SyncData; 18 class SyncData;
18 19
19 typedef std::vector<SyncData> SyncDataList; 20 typedef std::vector<SyncData> SyncDataList;
20 21
21 class SyncableService : public SyncChangeProcessor { 22 // TODO(zea): remove SupportsWeakPtr in favor of having all SyncableService
23 // implementers provide a way of getting a weak pointer to themselves.
24 // See crbug.com/100114.
25 class SyncableService : public SyncChangeProcessor,
26 public base::SupportsWeakPtr<SyncableService> {
22 public: 27 public:
23 // Informs the service to begin syncing the specified synced datatype |type|. 28 // Informs the service to begin syncing the specified synced datatype |type|.
24 // The service should then merge |initial_sync_data| into it's local data, 29 // The service should then merge |initial_sync_data| into it's local data,
25 // calling |sync_processor|'s ProcessSyncChanges as necessary to reconcile the 30 // calling |sync_processor|'s ProcessSyncChanges as necessary to reconcile the
26 // two. After this, the SyncableService's local data should match the server 31 // two. After this, the SyncableService's local data should match the server
27 // data, and the service should be ready to receive and process any further 32 // data, and the service should be ready to receive and process any further
28 // SyncChange's as they occur. 33 // SyncChange's as they occur.
29 // Returns: A default SyncError (IsSet() == false) if no errors were 34 // Returns: A default SyncError (IsSet() == false) if no errors were
30 // encountered, and a filled SyncError (IsSet() == true) 35 // encountered, and a filled SyncError (IsSet() == true)
31 // otherwise. 36 // otherwise.
(...skipping 17 matching lines...) Expand all
49 // otherwise. 54 // otherwise.
50 virtual SyncError ProcessSyncChanges( 55 virtual SyncError ProcessSyncChanges(
51 const tracked_objects::Location& from_here, 56 const tracked_objects::Location& from_here,
52 const SyncChangeList& change_list) OVERRIDE = 0; 57 const SyncChangeList& change_list) OVERRIDE = 0;
53 58
54 protected: 59 protected:
55 virtual ~SyncableService(); 60 virtual ~SyncableService();
56 }; 61 };
57 62
58 #endif // CHROME_BROWSER_SYNC_API_SYNCABLE_SERVICE_H_ 63 #endif // CHROME_BROWSER_SYNC_API_SYNCABLE_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/api/sync_change_processor.cc ('k') | chrome/browser/sync/glue/app_data_type_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698