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

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

Issue 2424673002: Remove usage of FOR_EACH_OBSERVER macro in components/sync (Closed)
Patch Set: tidy Created 4 years, 2 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 // Record the ID if it was renamed. 502 // Record the ID if it was renamed.
503 if (entity_id != client_entity.id_string()) { 503 if (entity_id != client_entity.id_string()) {
504 client_to_server_ids[client_entity.id_string()] = entity_id; 504 client_to_server_ids[client_entity.id_string()] = entity_id;
505 } 505 }
506 506
507 EntityMap::const_iterator iter = entities_.find(entity_id); 507 EntityMap::const_iterator iter = entities_.find(entity_id);
508 CHECK(iter != entities_.end()); 508 CHECK(iter != entities_.end());
509 committed_model_types.Put(iter->second->model_type()); 509 committed_model_types.Put(iter->second->model_type());
510 } 510 }
511 511
512 FOR_EACH_OBSERVER(Observer, observers_, 512 for (auto& observer : observers_)
513 OnCommit(invalidator_client_id, committed_model_types)); 513 observer.OnCommit(invalidator_client_id, committed_model_types);
514 return true; 514 return true;
maxbogue 2016/10/17 16:54:58 This sort of thing gives me anxiety, and is why I'
515 } 515 }
516 516
517 std::unique_ptr<base::DictionaryValue> 517 std::unique_ptr<base::DictionaryValue>
518 FakeServer::GetEntitiesAsDictionaryValue() { 518 FakeServer::GetEntitiesAsDictionaryValue() {
519 DCHECK(thread_checker_.CalledOnValidThread()); 519 DCHECK(thread_checker_.CalledOnValidThread());
520 std::unique_ptr<base::DictionaryValue> dictionary( 520 std::unique_ptr<base::DictionaryValue> dictionary(
521 new base::DictionaryValue()); 521 new base::DictionaryValue());
522 522
523 // Initialize an empty ListValue for all ModelTypes. 523 // Initialize an empty ListValue for all ModelTypes.
524 ModelTypeSet all_types = ModelTypeSet::All(); 524 ModelTypeSet all_types = ModelTypeSet::All();
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 DCHECK(thread_checker_.CalledOnValidThread()); 719 DCHECK(thread_checker_.CalledOnValidThread());
720 return weak_ptr_factory_.GetWeakPtr(); 720 return weak_ptr_factory_.GetWeakPtr();
721 } 721 }
722 722
723 std::string FakeServer::GetStoreBirthday() const { 723 std::string FakeServer::GetStoreBirthday() const {
724 DCHECK(thread_checker_.CalledOnValidThread()); 724 DCHECK(thread_checker_.CalledOnValidThread());
725 return base::Int64ToString(store_birthday_); 725 return base::Int64ToString(store_birthday_);
726 } 726 }
727 727
728 } // namespace fake_server 728 } // namespace fake_server
OLDNEW
« no previous file with comments | « components/sync/js/sync_js_controller.cc ('k') | components/sync/test/fake_sync_encryption_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698