Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |