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

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

Issue 600083003: Fix memory leak in Sync FakeServerEntity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 6 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
« no previous file with comments | « sync/test/fake_server/bookmark_entity.cc ('k') | sync/test/fake_server/fake_server_entity.h » ('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 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 "sync/test/fake_server/fake_server.h" 5 #include "sync/test/fake_server/fake_server.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 return false; 281 return false;
282 } 282 }
283 283
284 bool send_encryption_keys_based_on_nigori = false; 284 bool send_encryption_keys_based_on_nigori = false;
285 int64 max_response_version = 0; 285 int64 max_response_version = 0;
286 for (EntityMap::iterator it = entities_.begin(); it != entities_.end(); 286 for (EntityMap::iterator it = entities_.begin(); it != entities_.end();
287 ++it) { 287 ++it) {
288 FakeServerEntity* entity = it->second; 288 FakeServerEntity* entity = it->second;
289 if (sieve->ClientWantsItem(entity)) { 289 if (sieve->ClientWantsItem(entity)) {
290 sync_pb::SyncEntity* response_entity = response->add_entries(); 290 sync_pb::SyncEntity* response_entity = response->add_entries();
291 response_entity->CopyFrom(*(entity->SerializeAsProto())); 291 entity->SerializeAsProto(response_entity);
292 max_response_version = std::max(max_response_version, 292 max_response_version = std::max(max_response_version,
293 response_entity->version()); 293 response_entity->version());
294 294
295 if (entity->GetModelType() == syncer::NIGORI) { 295 if (entity->GetModelType() == syncer::NIGORI) {
296 send_encryption_keys_based_on_nigori = 296 send_encryption_keys_based_on_nigori =
297 response_entity->specifics().nigori().passphrase_type() == 297 response_entity->specifics().nigori().passphrase_type() ==
298 sync_pb::NigoriSpecifics::KEYSTORE_PASSPHRASE; 298 sync_pb::NigoriSpecifics::KEYSTORE_PASSPHRASE;
299 } 299 }
300 } 300 }
301 } 301 }
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 514
515 void FakeServer::AddObserver(Observer* observer) { 515 void FakeServer::AddObserver(Observer* observer) {
516 observers_.AddObserver(observer); 516 observers_.AddObserver(observer);
517 } 517 }
518 518
519 void FakeServer::RemoveObserver(Observer* observer) { 519 void FakeServer::RemoveObserver(Observer* observer) {
520 observers_.RemoveObserver(observer); 520 observers_.RemoveObserver(observer);
521 } 521 }
522 522
523 } // namespace fake_server 523 } // namespace fake_server
OLDNEW
« no previous file with comments | « sync/test/fake_server/bookmark_entity.cc ('k') | sync/test/fake_server/fake_server_entity.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698