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

Unified Diff: components/sync/protocol/proto_memory_estimations.cc

Issue 2875203002: UserEvent proto exploration for Translate use case. (Closed)
Patch Set: Adding proto_visitors.h change. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/sync/protocol/proto_enum_conversions.cc ('k') | components/sync/protocol/proto_visitors.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/protocol/proto_memory_estimations.cc
diff --git a/components/sync/protocol/proto_memory_estimations.cc b/components/sync/protocol/proto_memory_estimations.cc
index b7402c49ccdf4b797b03999ffbf5892cc6f4a676..5d1ffa6540f4b54f86a53eff62c1c6e483a5781a 100644
--- a/components/sync/protocol/proto_memory_estimations.cc
+++ b/components/sync/protocol/proto_memory_estimations.cc
@@ -47,11 +47,11 @@ class MemoryUsageVisitor {
memory_usage_ += sizeof(F) + EstimateMemoryUsage(field);
}
- // Integral types
+ // Arithmetic types
template <class P, class F>
- typename std::enable_if<std::is_integral<F>::value>::type
+ typename std::enable_if<std::is_arithmetic<F>::value>::type
Visit(const P&, const char* field_name, const F& field) {
- // Integral fields (integers, floats & bool) don't allocate.
+ // Arithmetic fields (integers, floats & bool) don't allocate.
}
// std::string
@@ -78,15 +78,15 @@ class MemoryUsageVisitor {
}
}
- // RepeatedField<integral type>
+ // RepeatedField<arithmetic type>
template <class P, class F>
- typename std::enable_if<std::is_integral<F>::value>::type Visit(
+ typename std::enable_if<std::is_arithmetic<F>::value>::type Visit(
const P&,
const char* field_name,
const google::protobuf::RepeatedField<F>& fields) {
memory_usage_ += fields.SpaceUsedExcludingSelf();
- // Integral fields (integers, floats & bool) don't allocate, so no
- // point in iterating over |fields|.
+ // Arithmetic fields (integers, floats & bool) don't allocate, so no point
+ // in iterating over |fields|.
}
// RepeatedField<std::string>
« no previous file with comments | « components/sync/protocol/proto_enum_conversions.cc ('k') | components/sync/protocol/proto_visitors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698