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

Unified Diff: ipc/ipc_message_utils.cc

Issue 34413002: Pickle::Write* micro-optimizations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« content/common/cc_messages.cc ('K') | « ipc/ipc_message_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message_utils.cc
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc
index 2acddceb51c870752c58138779f4a4e4b6b01b61..b484cd78866bc82dce3e20431419e48b35e43f77 100644
--- a/ipc/ipc_message_utils.cc
+++ b/ipc/ipc_message_utils.cc
@@ -311,20 +311,12 @@ void ParamTraits<unsigned long long>::Log(const param_type& p, std::string* l) {
l->append(base::Uint64ToString(p));
}
-void ParamTraits<float>::Write(Message* m, const param_type& p) {
- m->WriteData(reinterpret_cast<const char*>(&p), sizeof(param_type));
-}
-
bool ParamTraits<float>::Read(const Message* m, PickleIterator* iter,
param_type* r) {
- const char *data;
- int data_size;
- if (!m->ReadData(iter, &data, &data_size) ||
- data_size != sizeof(param_type)) {
+ if (!m->ReadFloat(iter, r)) {
NOTREACHED();
return false;
}
- memcpy(r, data, sizeof(param_type));
return true;
}
« content/common/cc_messages.cc ('K') | « ipc/ipc_message_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698