summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_message_utils.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-06 17:55:32 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-06 17:55:32 +0000
commitc5406e5c864f90639a7154479559bf6c6c43e0cc (patch)
tree83d855a18106d65a117b72400fa6e413f24b818f /ipc/ipc_message_utils.cc
parentb714b8c580cd67b647b339eae3bda6ec598addae (diff)
downloadchromium_src-c5406e5c864f90639a7154479559bf6c6c43e0cc.zip
chromium_src-c5406e5c864f90639a7154479559bf6c6c43e0cc.tar.gz
chromium_src-c5406e5c864f90639a7154479559bf6c6c43e0cc.tar.bz2
FBTF: New IPC definitions, only applied to async ROUTED and CONTROL messages.
The slowest cc files in chrome include render_messages.h and other IPC message definitions. Including one of these files will bring in half of chrome because in the IPC system previously required full class definitions due to implementation details. The new system allows forward declarations and places the implementations of functions that need the full class definitions (ctor/dtor()/Log() and superclass ctor/Read() methods) into a separate xxx_messages.cc file using a parallel set of macros to ipc_message_macros.h. This has the added benefit of moving most of the template instantiation junk into a small number of files. Pros: - Will speed up compiling by a lot once everything is forward declared. - Already, intermediary .o/.a files are smaller. Cons: - Adds a 4th pass to the messages system, this time in a different header. BUG=51411 TEST=none Review URL: http://codereview.chromium.org/2873090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55259 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_message_utils.cc')
-rw-r--r--ipc/ipc_message_utils.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc
index 41fbde7..7975faa 100644
--- a/ipc/ipc_message_utils.cc
+++ b/ipc/ipc_message_utils.cc
@@ -201,6 +201,24 @@ static bool ReadValue(const Message* m, void** iter, Value** value,
return true;
}
+
+void ParamTraits<base::Time>::Write(Message* m, const param_type& p) {
+ ParamTraits<int64>::Write(m, p.ToInternalValue());
+}
+
+bool ParamTraits<base::Time>::Read(const Message* m, void** iter,
+ param_type* r) {
+ int64 value;
+ if (!ParamTraits<int64>::Read(m, iter, &value))
+ return false;
+ *r = base::Time::FromInternalValue(value);
+ return true;
+}
+
+void ParamTraits<base::Time>::Log(const param_type& p, std::wstring* l) {
+ ParamTraits<int64>::Log(p.ToInternalValue(), l);
+}
+
void ParamTraits<DictionaryValue>::Write(Message* m, const param_type& p) {
WriteValue(m, &p, 0);
}