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

Unified Diff: ipc/ipc_message_utils.h

Issue 39363002: Optimize ParamTraits<float> and ParamTraits<double> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ipc/ipc_message_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message_utils.h
diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h
index 7121c19e304fcea3dad3d765695f7b0a113e07d2..e9c0ba0b0b4dcab95b6f858ead552847425260de 100644
--- a/ipc/ipc_message_utils.h
+++ b/ipc/ipc_message_utils.h
@@ -216,8 +216,12 @@ struct ParamTraits<unsigned long long> {
template <>
struct IPC_EXPORT ParamTraits<float> {
typedef float param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, PickleIterator* iter, param_type* r);
+ static void Write(Message* m, const param_type& p) {
+ m->WriteFloat(p);
+ }
+ static bool Read(const Message* m, PickleIterator* iter, param_type* r) {
+ return m->ReadFloat(iter, r);
+ }
static void Log(const param_type& p, std::string* l);
};
« no previous file with comments | « no previous file | ipc/ipc_message_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698