| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 // Keep this file in sync with the .proto files in this directory. | 5 // Keep this file in sync with the .proto files in this directory. |
| 6 | 6 |
| 7 #include "components/sync/protocol/proto_memory_estimations.h" | 7 #include "components/sync/protocol/proto_memory_estimations.h" |
| 8 | 8 |
| 9 #include <string> |
| 10 |
| 9 #include "base/trace_event/memory_usage_estimator.h" | 11 #include "base/trace_event/memory_usage_estimator.h" |
| 10 #include "components/sync/protocol/proto_visitors.h" | 12 #include "components/sync/protocol/proto_visitors.h" |
| 11 | 13 |
| 12 namespace { | 14 namespace { |
| 13 | 15 |
| 14 // This class is a VisitProtoFields()-compatible visitor that estimates | 16 // This class is a VisitProtoFields()-compatible visitor that estimates |
| 15 // proto's memory usage: | 17 // proto's memory usage: |
| 16 // | 18 // |
| 17 // MemoryUsageVisitor visitor; | 19 // MemoryUsageVisitor visitor; |
| 18 // VisitProtoFields(visitor, proto); | 20 // VisitProtoFields(visitor, proto); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Explicit instantiations | 119 // Explicit instantiations |
| 118 | 120 |
| 119 #define INSTANTIATE(Proto) \ | 121 #define INSTANTIATE(Proto) \ |
| 120 template size_t EstimateMemoryUsage<Proto>(const Proto&); | 122 template size_t EstimateMemoryUsage<Proto>(const Proto&); |
| 121 | 123 |
| 122 INSTANTIATE(EntitySpecifics) | 124 INSTANTIATE(EntitySpecifics) |
| 123 INSTANTIATE(AttachmentMetadata) | 125 INSTANTIATE(AttachmentMetadata) |
| 124 INSTANTIATE(DataTypeContext) | 126 INSTANTIATE(DataTypeContext) |
| 125 | 127 |
| 126 } // namespace sync_pb | 128 } // namespace sync_pb |
| OLD | NEW |