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

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

Issue 2689773002: [Sync] Replace typedef with using. (Closed)
Patch Set: [Sync] Replace typedef with using. Created 3 years, 10 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 bool ClientWantsItem(const FakeServerEntity& entity) { 81 bool ClientWantsItem(const FakeServerEntity& entity) {
82 int64_t version = entity.GetVersion(); 82 int64_t version = entity.GetVersion();
83 ModelType type = entity.model_type(); 83 ModelType type = entity.model_type();
84 response_version_map_[type] = 84 response_version_map_[type] =
85 std::max(response_version_map_[type], version); 85 std::max(response_version_map_[type], version);
86 auto it = request_version_map_.find(type); 86 auto it = request_version_map_.find(type);
87 return it == request_version_map_.end() ? false : it->second < version; 87 return it == request_version_map_.end() ? false : it->second < version;
88 } 88 }
89 89
90 private: 90 private:
91 typedef std::map<ModelType, int64_t> ModelTypeToVersionMap; 91 using ModelTypeToVersionMap = std::map<ModelType, int64_t>;
92 92
93 static UpdateSieve::ModelTypeToVersionMap MessageToVersionMap( 93 static UpdateSieve::ModelTypeToVersionMap MessageToVersionMap(
94 const sync_pb::GetUpdatesMessage& get_updates_message) { 94 const sync_pb::GetUpdatesMessage& get_updates_message) {
95 CHECK_GT(get_updates_message.from_progress_marker_size(), 0) 95 CHECK_GT(get_updates_message.from_progress_marker_size(), 0)
96 << "A GetUpdates request must have at least one progress marker."; 96 << "A GetUpdates request must have at least one progress marker.";
97 ModelTypeToVersionMap request_version_map; 97 ModelTypeToVersionMap request_version_map;
98 98
99 for (int i = 0; i < get_updates_message.from_progress_marker_size(); i++) { 99 for (int i = 0; i < get_updates_message.from_progress_marker_size(); i++) {
100 sync_pb::DataTypeProgressMarker marker = 100 sync_pb::DataTypeProgressMarker marker =
101 get_updates_message.from_progress_marker(i); 101 get_updates_message.from_progress_marker(i);
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 DCHECK(thread_checker_.CalledOnValidThread()); 700 DCHECK(thread_checker_.CalledOnValidThread());
701 return weak_ptr_factory_.GetWeakPtr(); 701 return weak_ptr_factory_.GetWeakPtr();
702 } 702 }
703 703
704 std::string FakeServer::GetStoreBirthday() const { 704 std::string FakeServer::GetStoreBirthday() const {
705 DCHECK(thread_checker_.CalledOnValidThread()); 705 DCHECK(thread_checker_.CalledOnValidThread());
706 return base::Int64ToString(store_birthday_); 706 return base::Int64ToString(store_birthday_);
707 } 707 }
708 708
709 } // namespace fake_server 709 } // namespace fake_server
OLDNEW
« no previous file with comments | « components/sync/test/engine/mock_model_type_processor.h ('k') | components/sync/test/fake_server/sessions_hierarchy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698