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

Side by Side Diff: components/sync/syncable/model_type.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 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
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 #include "components/sync/base/model_type.h" 5 #include "components/sync/base/model_type.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 for (ModelTypeSet::Iterator it = model_types.First(); it.Good(); it.Inc()) { 646 for (ModelTypeSet::Iterator it = model_types.First(); it.Good(); it.Inc()) {
647 value->AppendString(ModelTypeToString(it.Get())); 647 value->AppendString(ModelTypeToString(it.Get()));
648 } 648 }
649 return value; 649 return value;
650 } 650 }
651 651
652 ModelTypeSet ModelTypeSetFromValue(const base::ListValue& value) { 652 ModelTypeSet ModelTypeSetFromValue(const base::ListValue& value) {
653 ModelTypeSet result; 653 ModelTypeSet result;
654 for (base::ListValue::const_iterator i = value.begin(); i != value.end(); 654 for (base::ListValue::const_iterator i = value.begin(); i != value.end();
655 ++i) { 655 ++i) {
656 result.Put(ModelTypeFromValue(*i)); 656 result.Put(ModelTypeFromValue(**i));
657 } 657 }
658 return result; 658 return result;
659 } 659 }
660 660
661 // TODO(zea): remove all hardcoded tags in model associators and have them use 661 // TODO(zea): remove all hardcoded tags in model associators and have them use
662 // this instead. 662 // this instead.
663 // NOTE: Proxy types should return empty strings (so that we don't NOTREACHED 663 // NOTE: Proxy types should return empty strings (so that we don't NOTREACHED
664 // in tests when we verify they have no root node). 664 // in tests when we verify they have no root node).
665 std::string ModelTypeToRootTag(ModelType type) { 665 std::string ModelTypeToRootTag(ModelType type) {
666 if (IsProxyType(type)) 666 if (IsProxyType(type))
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 bool TypeSupportsHierarchy(ModelType model_type) { 725 bool TypeSupportsHierarchy(ModelType model_type) {
726 // TODO(stanisc): crbug/438313: Should this also include TOP_LEVEL_FOLDER? 726 // TODO(stanisc): crbug/438313: Should this also include TOP_LEVEL_FOLDER?
727 return model_type == BOOKMARKS; 727 return model_type == BOOKMARKS;
728 } 728 }
729 729
730 bool TypeSupportsOrdering(ModelType model_type) { 730 bool TypeSupportsOrdering(ModelType model_type) {
731 return model_type == BOOKMARKS; 731 return model_type == BOOKMARKS;
732 } 732 }
733 733
734 } // namespace syncer 734 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/driver/about_sync_util.cc ('k') | components/sync/test/fake_server/fake_server_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698