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

Side by Side Diff: sync/test/fake_server/fake_server.cc

Issue 2034503003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « sync/internal_api/js_sync_encryption_handler_observer_unittest.cc ('k') | no next file » | 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/test/fake_server/fake_server.h" 5 #include "sync/test/fake_server/fake_server.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 continue; 543 continue;
544 } 544 }
545 base::ListValue* list_value; 545 base::ListValue* list_value;
546 if (!dictionary->GetList(ModelTypeToString(entity.GetModelType()), 546 if (!dictionary->GetList(ModelTypeToString(entity.GetModelType()),
547 &list_value)) { 547 &list_value)) {
548 return std::unique_ptr<base::DictionaryValue>(); 548 return std::unique_ptr<base::DictionaryValue>();
549 } 549 }
550 // TODO(pvalenzuela): Store more data for each entity so additional 550 // TODO(pvalenzuela): Store more data for each entity so additional
551 // verification can be performed. One example of additional verification 551 // verification can be performed. One example of additional verification
552 // is checking the correctness of the bookmark hierarchy. 552 // is checking the correctness of the bookmark hierarchy.
553 list_value->Append(new base::StringValue(entity.GetName())); 553 list_value->AppendString(entity.GetName());
554 } 554 }
555 555
556 return dictionary; 556 return dictionary;
557 } 557 }
558 558
559 std::vector<sync_pb::SyncEntity> FakeServer::GetSyncEntitiesByModelType( 559 std::vector<sync_pb::SyncEntity> FakeServer::GetSyncEntitiesByModelType(
560 ModelType model_type) { 560 ModelType model_type) {
561 std::vector<sync_pb::SyncEntity> sync_entities; 561 std::vector<sync_pb::SyncEntity> sync_entities;
562 DCHECK(thread_checker_.CalledOnValidThread()); 562 DCHECK(thread_checker_.CalledOnValidThread());
563 for (EntityMap::const_iterator it = entities_.begin(); it != entities_.end(); 563 for (EntityMap::const_iterator it = entities_.begin(); it != entities_.end();
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 DCHECK(thread_checker_.CalledOnValidThread()); 727 DCHECK(thread_checker_.CalledOnValidThread());
728 return weak_ptr_factory_.GetWeakPtr(); 728 return weak_ptr_factory_.GetWeakPtr();
729 } 729 }
730 730
731 std::string FakeServer::GetStoreBirthday() const { 731 std::string FakeServer::GetStoreBirthday() const {
732 DCHECK(thread_checker_.CalledOnValidThread()); 732 DCHECK(thread_checker_.CalledOnValidThread());
733 return base::Int64ToString(store_birthday_); 733 return base::Int64ToString(store_birthday_);
734 } 734 }
735 735
736 } // namespace fake_server 736 } // namespace fake_server
OLDNEW
« no previous file with comments | « sync/internal_api/js_sync_encryption_handler_observer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698