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

Side by Side Diff: sync/engine/build_commit_command.cc

Issue 11958029: [Sync] Add support for proxy types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch to ProxyTypes Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | sync/engine/download_updates_command.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/engine/build_commit_command.h" 5 #include "sync/engine/build_commit_command.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 96 }
97 } 97 }
98 } 98 }
99 99
100 void BuildCommitCommand::AddClientConfigParamsToMessage( 100 void BuildCommitCommand::AddClientConfigParamsToMessage(
101 SyncSession* session, sync_pb::CommitMessage* message) { 101 SyncSession* session, sync_pb::CommitMessage* message) {
102 const ModelSafeRoutingInfo& routing_info = session->routing_info(); 102 const ModelSafeRoutingInfo& routing_info = session->routing_info();
103 sync_pb::ClientConfigParams* config_params = message->mutable_config_params(); 103 sync_pb::ClientConfigParams* config_params = message->mutable_config_params();
104 for (std::map<ModelType, ModelSafeGroup>::const_iterator iter = 104 for (std::map<ModelType, ModelSafeGroup>::const_iterator iter =
105 routing_info.begin(); iter != routing_info.end(); ++iter) { 105 routing_info.begin(); iter != routing_info.end(); ++iter) {
106 if (ProxyTypes().Has(iter->first))
107 continue;
106 int field_number = GetSpecificsFieldNumberFromModelType(iter->first); 108 int field_number = GetSpecificsFieldNumberFromModelType(iter->first);
107 config_params->mutable_enabled_type_ids()->Add(field_number); 109 config_params->mutable_enabled_type_ids()->Add(field_number);
108 } 110 }
109 } 111 }
110 112
111 namespace { 113 namespace {
112 void SetEntrySpecifics(MutableEntry* meta_entry, 114 void SetEntrySpecifics(MutableEntry* meta_entry,
113 sync_pb::SyncEntity* sync_entry) { 115 sync_pb::SyncEntity* sync_entry) {
114 // Add the new style extension and the folder bit. 116 // Add the new style extension and the folder bit.
115 sync_entry->mutable_specifics()->CopyFrom(meta_entry->Get(SPECIFICS)); 117 sync_entry->mutable_specifics()->CopyFrom(meta_entry->Get(SPECIFICS));
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 if (delta <= static_cast<uint64>(GetGap()*2)) 274 if (delta <= static_cast<uint64>(GetGap()*2))
273 return lo + (static_cast<int64>(delta) + 7) / 8; // Interpolate. 275 return lo + (static_cast<int64>(delta) + 7) / 8; // Interpolate.
274 else if (lo == GetFirstPosition()) 276 else if (lo == GetFirstPosition())
275 return hi - GetGap(); // Extend range just before successor. 277 return hi - GetGap(); // Extend range just before successor.
276 else 278 else
277 return lo + GetGap(); // Use or extend range just after predecessor. 279 return lo + GetGap(); // Use or extend range just after predecessor.
278 } 280 }
279 281
280 282
281 } // namespace syncer 283 } // namespace syncer
OLDNEW
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | sync/engine/download_updates_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698