OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_SYNC_PROTOCOL_PROTO_SIZE_ESTIMATIONS_H_ |
| 6 #define COMPONENTS_SYNC_PROTOCOL_PROTO_SIZE_ESTIMATIONS_H_ |
| 7 |
| 8 #include <stddef.h> |
| 9 |
| 10 namespace sync_pb { |
| 11 |
| 12 // EstimateMemoryUsage() need to be in sync_pb to be discoverable by ADL, |
| 13 // i.e. so you could just write EstimateMemoryUsage(proto) without having |
| 14 // to import EstimateMemoryUsage with 'using'. And it needs to be a template |
| 15 // to avoid listing all protos here. |
| 16 // Note: if you get linking errors you need to add explicit instantiation at |
| 17 // the end of the implementation file. |
| 18 template <class P> |
| 19 size_t EstimateMemoryUsage(const P& proto); |
| 20 |
| 21 } |
| 22 |
| 23 #endif // COMPONENTS_SYNC_PROTOCOL_PROTO_SIZE_ESTIMATIONS_H_ |
OLD | NEW |