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

Side by Side Diff: sync/protocol/proto_value_conversions.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 | « sync/protocol/proto_value_conversions.h ('k') | sync/sessions/model_type_registry.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Keep this file in sync with the .proto files in this directory. 5 // Keep this file in sync with the .proto files in this directory.
6 6
7 #include "sync/protocol/proto_value_conversions.h" 7 #include "sync/protocol/proto_value_conversions.h"
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 } 806 }
807 807
808 namespace { 808 namespace {
809 809
810 base::StringValue* UniquePositionToStringValue( 810 base::StringValue* UniquePositionToStringValue(
811 const sync_pb::UniquePosition& proto) { 811 const sync_pb::UniquePosition& proto) {
812 UniquePosition pos = UniquePosition::FromProto(proto); 812 UniquePosition pos = UniquePosition::FromProto(proto);
813 return new base::StringValue(pos.ToDebugString()); 813 return new base::StringValue(pos.ToDebugString());
814 } 814 }
815 815
816 } // namespace
817
816 base::DictionaryValue* SyncEntityToValue(const sync_pb::SyncEntity& proto, 818 base::DictionaryValue* SyncEntityToValue(const sync_pb::SyncEntity& proto,
817 bool include_specifics) { 819 bool include_specifics) {
818 base::DictionaryValue* value = new base::DictionaryValue(); 820 base::DictionaryValue* value = new base::DictionaryValue();
819 SET_STR(id_string); 821 SET_STR(id_string);
820 SET_STR(parent_id_string); 822 SET_STR(parent_id_string);
821 SET_STR(old_parent_id); 823 SET_STR(old_parent_id);
822 SET_INT64(version); 824 SET_INT64(version);
823 SET_INT64(mtime); 825 SET_INT64(mtime);
824 SET_INT64(ctime); 826 SET_INT64(ctime);
825 SET_STR(name); 827 SET_STR(name);
826 SET_STR(non_unique_name); 828 SET_STR(non_unique_name);
827 SET_INT64(sync_timestamp); 829 SET_INT64(sync_timestamp);
828 SET_STR(server_defined_unique_tag); 830 SET_STR(server_defined_unique_tag);
829 SET_INT64(position_in_parent); 831 SET_INT64(position_in_parent);
830 SET(unique_position, UniquePositionToStringValue); 832 SET(unique_position, UniquePositionToStringValue);
831 SET_STR(insert_after_item_id); 833 SET_STR(insert_after_item_id);
832 SET_BOOL(deleted); 834 SET_BOOL(deleted);
833 SET_STR(originator_cache_guid); 835 SET_STR(originator_cache_guid);
834 SET_STR(originator_client_item_id); 836 SET_STR(originator_client_item_id);
835 if (include_specifics) 837 if (include_specifics)
836 SET(specifics, EntitySpecificsToValue); 838 SET(specifics, EntitySpecificsToValue);
837 SET_BOOL(folder); 839 SET_BOOL(folder);
838 SET_STR(client_defined_unique_tag); 840 SET_STR(client_defined_unique_tag);
839 return value; 841 return value;
840 } 842 }
841 843
844 namespace {
845
842 base::ListValue* SyncEntitiesToValue( 846 base::ListValue* SyncEntitiesToValue(
843 const ::google::protobuf::RepeatedPtrField<sync_pb::SyncEntity>& entities, 847 const ::google::protobuf::RepeatedPtrField<sync_pb::SyncEntity>& entities,
844 bool include_specifics) { 848 bool include_specifics) {
845 base::ListValue* list = new base::ListValue(); 849 base::ListValue* list = new base::ListValue();
846 ::google::protobuf::RepeatedPtrField<sync_pb::SyncEntity>::const_iterator it; 850 ::google::protobuf::RepeatedPtrField<sync_pb::SyncEntity>::const_iterator it;
847 for (it = entities.begin(); it != entities.end(); ++it) { 851 for (it = entities.begin(); it != entities.end(); ++it) {
848 list->Append(SyncEntityToValue(*it, include_specifics)); 852 list->Append(SyncEntityToValue(*it, include_specifics));
849 } 853 }
850 854
851 return list; 855 return list;
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 #undef SET_BYTES 1108 #undef SET_BYTES
1105 #undef SET_INT32 1109 #undef SET_INT32
1106 #undef SET_INT64 1110 #undef SET_INT64
1107 #undef SET_INT64_REP 1111 #undef SET_INT64_REP
1108 #undef SET_STR 1112 #undef SET_STR
1109 #undef SET_STR_REP 1113 #undef SET_STR_REP
1110 1114
1111 #undef SET_FIELD 1115 #undef SET_FIELD
1112 1116
1113 } // namespace syncer 1117 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/protocol/proto_value_conversions.h ('k') | sync/sessions/model_type_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698