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

Side by Side Diff: sync/test/fake_server/fake_server_entity.h

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/fake_server.cc ('k') | sync/test/fake_server/permanent_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 #ifndef SYNC_TEST_FAKE_SERVER_FAKE_SERVER_ENTITY_H_ 5 #ifndef SYNC_TEST_FAKE_SERVER_FAKE_SERVER_ENTITY_H_
6 #define SYNC_TEST_FAKE_SERVER_FAKE_SERVER_ENTITY_H_ 6 #define SYNC_TEST_FAKE_SERVER_FAKE_SERVER_ENTITY_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 20 matching lines...) Expand all
31 31
32 virtual ~FakeServerEntity(); 32 virtual ~FakeServerEntity();
33 const std::string& GetId() const; 33 const std::string& GetId() const;
34 syncer::ModelType GetModelType() const; 34 syncer::ModelType GetModelType() const;
35 int64 GetVersion() const; 35 int64 GetVersion() const;
36 void SetVersion(int64 version); 36 void SetVersion(int64 version);
37 const std::string& GetName() const; 37 const std::string& GetName() const;
38 38
39 // Common data items needed by server 39 // Common data items needed by server
40 virtual std::string GetParentId() const = 0; 40 virtual std::string GetParentId() const = 0;
41 virtual sync_pb::SyncEntity* SerializeAsProto() = 0; 41 virtual void SerializeAsProto(sync_pb::SyncEntity* proto) = 0;
42 virtual bool IsDeleted() const = 0; 42 virtual bool IsDeleted() const = 0;
43 virtual bool IsFolder() const = 0; 43 virtual bool IsFolder() const = 0;
44 44
45 protected: 45 protected:
46 // Extracts the ModelType from |id|. If |id| is malformed or does not contain 46 // Extracts the ModelType from |id|. If |id| is malformed or does not contain
47 // a valid ModelType, UNSPECIFIED is returned. 47 // a valid ModelType, UNSPECIFIED is returned.
48 static syncer::ModelType GetModelTypeFromId(const std::string& id); 48 static syncer::ModelType GetModelTypeFromId(const std::string& id);
49 49
50 FakeServerEntity(const std::string& id, 50 FakeServerEntity(const std::string& id,
51 const syncer::ModelType& model_type, 51 const syncer::ModelType& model_type,
(...skipping 12 matching lines...) Expand all
64 // The version of this entity. 64 // The version of this entity.
65 int64 version_; 65 int64 version_;
66 66
67 // The name of the entity. 67 // The name of the entity.
68 std::string name_; 68 std::string name_;
69 }; 69 };
70 70
71 } // namespace fake_server 71 } // namespace fake_server
72 72
73 #endif // SYNC_TEST_FAKE_SERVER_FAKE_SERVER_ENTITY_H_ 73 #endif // SYNC_TEST_FAKE_SERVER_FAKE_SERVER_ENTITY_H_
OLDNEW
« no previous file with comments | « sync/test/fake_server/fake_server.cc ('k') | sync/test/fake_server/permanent_entity.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698