OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_SYNC_MODEL_ENTITY_DATA_H_ | 5 #ifndef COMPONENTS_SYNC_MODEL_ENTITY_DATA_H_ |
6 #define COMPONENTS_SYNC_MODEL_ENTITY_DATA_H_ | 6 #define COMPONENTS_SYNC_MODEL_ENTITY_DATA_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // specifics hasn't been set. | 72 // specifics hasn't been set. |
73 bool is_deleted() const { return specifics.ByteSize() == 0; } | 73 bool is_deleted() const { return specifics.ByteSize() == 0; } |
74 | 74 |
75 // Transfers this struct's data to EntityDataPtr. | 75 // Transfers this struct's data to EntityDataPtr. |
76 // The return value must be assigned into another EntityDataPtr. | 76 // The return value must be assigned into another EntityDataPtr. |
77 EntityDataPtr PassToPtr() WARN_UNUSED_RESULT; | 77 EntityDataPtr PassToPtr() WARN_UNUSED_RESULT; |
78 | 78 |
79 // Dumps all info into a DictionaryValue and returns it. | 79 // Dumps all info into a DictionaryValue and returns it. |
80 std::unique_ptr<base::DictionaryValue> ToDictionaryValue(); | 80 std::unique_ptr<base::DictionaryValue> ToDictionaryValue(); |
81 | 81 |
| 82 // Returns the estimate of dynamically allocated memory in bytes. |
| 83 size_t EstimateMemoryUsage() const; |
| 84 |
82 private: | 85 private: |
83 friend struct EntityDataTraits; | 86 friend struct EntityDataTraits; |
84 // Used to transfer the data without copying. | 87 // Used to transfer the data without copying. |
85 void Swap(EntityData* other); | 88 void Swap(EntityData* other); |
86 | 89 |
87 DISALLOW_COPY_AND_ASSIGN(EntityData); | 90 DISALLOW_COPY_AND_ASSIGN(EntityData); |
88 }; | 91 }; |
89 | 92 |
90 } // namespace syncer | 93 } // namespace syncer |
91 | 94 |
92 #endif // COMPONENTS_SYNC_MODEL_ENTITY_DATA_H_ | 95 #endif // COMPONENTS_SYNC_MODEL_ENTITY_DATA_H_ |
OLD | NEW |