OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/sync/engine_impl/commit_util.h" | 5 #include "components/sync/engine_impl/commit_util.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <set> | 10 #include <set> |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "components/sync/syncable/syncable_changes_version.h" | 27 #include "components/sync/syncable/syncable_changes_version.h" |
28 #include "components/sync/syncable/syncable_proto_util.h" | 28 #include "components/sync/syncable/syncable_proto_util.h" |
29 #include "components/sync/syncable/syncable_util.h" | 29 #include "components/sync/syncable/syncable_util.h" |
30 | 30 |
31 using std::set; | 31 using std::set; |
32 using std::string; | 32 using std::string; |
33 using std::vector; | 33 using std::vector; |
34 | 34 |
35 namespace syncer { | 35 namespace syncer { |
36 | 36 |
37 using syncable::Entry; | 37 using syncer::syncable::Entry; |
38 using syncable::Id; | 38 using syncer::syncable::Id; |
39 | 39 |
40 namespace commit_util { | 40 namespace commit_util { |
41 | 41 |
42 void AddExtensionsActivityToMessage( | 42 void AddExtensionsActivityToMessage( |
43 ExtensionsActivity* activity, | 43 ExtensionsActivity* activity, |
44 ExtensionsActivity::Records* extensions_activity_buffer, | 44 ExtensionsActivity::Records* extensions_activity_buffer, |
45 sync_pb::CommitMessage* message) { | 45 sync_pb::CommitMessage* message) { |
46 // This isn't perfect, since the set of extensions activity may not correlate | 46 // This isn't perfect, since the set of extensions activity may not correlate |
47 // exactly with the items being committed. That's OK as long as we're looking | 47 // exactly with the items being committed. That's OK as long as we're looking |
48 // for a rough estimate of extensions activity, not an precise mapping of | 48 // for a rough estimate of extensions activity, not an precise mapping of |
(...skipping 18 matching lines...) Expand all Loading... |
67 void AddClientConfigParamsToMessage(ModelTypeSet enabled_types, | 67 void AddClientConfigParamsToMessage(ModelTypeSet enabled_types, |
68 bool cookie_jar_mismatch, | 68 bool cookie_jar_mismatch, |
69 sync_pb::CommitMessage* message) { | 69 sync_pb::CommitMessage* message) { |
70 sync_pb::ClientConfigParams* config_params = message->mutable_config_params(); | 70 sync_pb::ClientConfigParams* config_params = message->mutable_config_params(); |
71 for (ModelTypeSet::Iterator it = enabled_types.First(); it.Good(); it.Inc()) { | 71 for (ModelTypeSet::Iterator it = enabled_types.First(); it.Good(); it.Inc()) { |
72 if (ProxyTypes().Has(it.Get())) | 72 if (ProxyTypes().Has(it.Get())) |
73 continue; | 73 continue; |
74 int field_number = GetSpecificsFieldNumberFromModelType(it.Get()); | 74 int field_number = GetSpecificsFieldNumberFromModelType(it.Get()); |
75 config_params->mutable_enabled_type_ids()->Add(field_number); | 75 config_params->mutable_enabled_type_ids()->Add(field_number); |
76 } | 76 } |
77 config_params->set_tabs_datatype_enabled( | 77 config_params->set_tabs_datatype_enabled(enabled_types.Has(PROXY_TABS)); |
78 enabled_types.Has(syncer::PROXY_TABS)); | |
79 config_params->set_cookie_jar_mismatch(cookie_jar_mismatch); | 78 config_params->set_cookie_jar_mismatch(cookie_jar_mismatch); |
80 } | 79 } |
81 | 80 |
82 namespace { | 81 namespace { |
83 | 82 |
84 void SetEntrySpecifics(const Entry& meta_entry, | 83 void SetEntrySpecifics(const Entry& meta_entry, |
85 sync_pb::SyncEntity* sync_entry) { | 84 sync_pb::SyncEntity* sync_entry) { |
86 // Add the new style extension and the folder bit. | 85 // Add the new style extension and the folder bit. |
87 sync_entry->mutable_specifics()->CopyFrom(meta_entry.GetSpecifics()); | 86 sync_entry->mutable_specifics()->CopyFrom(meta_entry.GetSpecifics()); |
88 sync_entry->set_folder(meta_entry.GetIsDir()); | 87 sync_entry->set_folder(meta_entry.GetIsDir()); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 | 450 |
452 ProcessSuccessfulCommitResponse(commit_request_entry, server_entry, | 451 ProcessSuccessfulCommitResponse(commit_request_entry, server_entry, |
453 local_entry.GetId(), &local_entry, | 452 local_entry.GetId(), &local_entry, |
454 dirty_sync_was_set, deleted_folders); | 453 dirty_sync_was_set, deleted_folders); |
455 return response; | 454 return response; |
456 } | 455 } |
457 | 456 |
458 } // namespace commit_util | 457 } // namespace commit_util |
459 | 458 |
460 } // namespace syncer | 459 } // namespace syncer |
OLD | NEW |