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

Side by Side Diff: sync/engine/model_thread_sync_entity.cc

Issue 299963002: sync: Implement NonBlockingTypeProcessorCore (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Unbreak some tests Created 6 years, 6 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
« no previous file with comments | « no previous file | sync/engine/non_blocking_sync_common.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "sync/engine/model_thread_sync_entity.h" 5 #include "sync/engine/model_thread_sync_entity.h"
6 #include "sync/syncable/syncable_util.h" 6 #include "sync/syncable/syncable_util.h"
7 7
8 namespace syncer { 8 namespace syncer {
9 9
10 scoped_ptr<ModelThreadSyncEntity> ModelThreadSyncEntity::NewLocalItem( 10 scoped_ptr<ModelThreadSyncEntity> ModelThreadSyncEntity::NewLocalItem(
11 const std::string& client_tag, 11 const std::string& client_tag,
12 const sync_pb::EntitySpecifics& specifics, 12 const sync_pb::EntitySpecifics& specifics,
13 base::Time now) { 13 base::Time now) {
14 return scoped_ptr<ModelThreadSyncEntity>(new ModelThreadSyncEntity( 14 return scoped_ptr<ModelThreadSyncEntity>(new ModelThreadSyncEntity(
15 1, 15 1,
16 0, 16 0,
17 0, 17 0,
18 0, 18 kUncommittedVersion,
19 true, 19 true,
20 std::string(), // Sync thread will assign the initial ID. 20 std::string(), // Sync thread will assign the initial ID.
21 syncable::GenerateSyncableHash(GetModelTypeFromSpecifics(specifics), 21 syncable::GenerateSyncableHash(GetModelTypeFromSpecifics(specifics),
22 client_tag), 22 client_tag),
23 client_tag, // As non-unique name. 23 client_tag, // As non-unique name.
24 specifics, 24 specifics,
25 false, 25 false,
26 now, 26 now,
27 now)); 27 now));
28 } 28 }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 void ModelThreadSyncEntity::ReceiveCommitResponse(const std::string& id, 149 void ModelThreadSyncEntity::ReceiveCommitResponse(const std::string& id,
150 int64 sequence_number, 150 int64 sequence_number,
151 int64 response_version) { 151 int64 response_version) {
152 id_ = id; // The server can assign us a new ID in a commit response. 152 id_ = id; // The server can assign us a new ID in a commit response.
153 acked_sequence_number_ = sequence_number; 153 acked_sequence_number_ = sequence_number;
154 base_version_ = response_version; 154 base_version_ = response_version;
155 } 155 }
156 156
157 } // namespace syncer 157 } // namespace syncer
OLDNEW
« no previous file with comments | « no previous file | sync/engine/non_blocking_sync_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698