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

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

Issue 2889163002: Remove raw DictionaryValue::Set in //components (Closed)
Patch Set: Nits Created 3 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
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 "components/sync/test/fake_server/fake_server.h" 5 #include "components/sync/test/fake_server/fake_server.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 497
498 std::unique_ptr<base::DictionaryValue> 498 std::unique_ptr<base::DictionaryValue>
499 FakeServer::GetEntitiesAsDictionaryValue() { 499 FakeServer::GetEntitiesAsDictionaryValue() {
500 DCHECK(thread_checker_.CalledOnValidThread()); 500 DCHECK(thread_checker_.CalledOnValidThread());
501 std::unique_ptr<base::DictionaryValue> dictionary( 501 std::unique_ptr<base::DictionaryValue> dictionary(
502 new base::DictionaryValue()); 502 new base::DictionaryValue());
503 503
504 // Initialize an empty ListValue for all ModelTypes. 504 // Initialize an empty ListValue for all ModelTypes.
505 ModelTypeSet all_types = ModelTypeSet::All(); 505 ModelTypeSet all_types = ModelTypeSet::All();
506 for (ModelTypeSet::Iterator it = all_types.First(); it.Good(); it.Inc()) { 506 for (ModelTypeSet::Iterator it = all_types.First(); it.Good(); it.Inc()) {
507 dictionary->Set(ModelTypeToString(it.Get()), new base::ListValue()); 507 dictionary->Set(ModelTypeToString(it.Get()),
508 base::MakeUnique<base::ListValue>());
508 } 509 }
509 510
510 for (EntityMap::const_iterator it = entities_.begin(); it != entities_.end(); 511 for (EntityMap::const_iterator it = entities_.begin(); it != entities_.end();
511 ++it) { 512 ++it) {
512 const FakeServerEntity& entity = *it->second; 513 const FakeServerEntity& entity = *it->second;
513 if (IsDeletedOrPermanent(entity)) { 514 if (IsDeletedOrPermanent(entity)) {
514 // Tombstones are ignored as they don't represent current data. Folders 515 // Tombstones are ignored as they don't represent current data. Folders
515 // are also ignored as current verification infrastructure does not 516 // are also ignored as current verification infrastructure does not
516 // consider them. 517 // consider them.
517 continue; 518 continue;
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 DCHECK(thread_checker_.CalledOnValidThread()); 701 DCHECK(thread_checker_.CalledOnValidThread());
701 return weak_ptr_factory_.GetWeakPtr(); 702 return weak_ptr_factory_.GetWeakPtr();
702 } 703 }
703 704
704 std::string FakeServer::GetStoreBirthday() const { 705 std::string FakeServer::GetStoreBirthday() const {
705 DCHECK(thread_checker_.CalledOnValidThread()); 706 DCHECK(thread_checker_.CalledOnValidThread());
706 return base::Int64ToString(store_birthday_); 707 return base::Int64ToString(store_birthday_);
707 } 708 }
708 709
709 } // namespace fake_server 710 } // namespace fake_server
OLDNEW
« no previous file with comments | « components/sync/syncable/write_transaction_info.cc ('k') | components/sync_wifi/wifi_credential.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698