summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-30 20:06:30 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-30 20:06:30 +0000
commit20f0487a5b73e8071af2612150301b0942cbf0e2 (patch)
treeecee69b28f16712bdc1558ac0a015ac80095c761 /ipc
parent167b0dd17d5ed57ff293b6480ccaed706e0bc9cb (diff)
downloadchromium_src-20f0487a5b73e8071af2612150301b0942cbf0e2.zip
chromium_src-20f0487a5b73e8071af2612150301b0942cbf0e2.tar.gz
chromium_src-20f0487a5b73e8071af2612150301b0942cbf0e2.tar.bz2
FBTF: Move ctors/dtors into implementation files. Adds ctors/dtors to non-POD structs.
Cuts ~2MB off our .a files (Debug, Linux). Also added the "virtual" keyword on a whole bunch of virtual dtors that were missing it. BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3522004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc')
-rw-r--r--ipc/ipc_channel_proxy.cc2
-rw-r--r--ipc/ipc_channel_proxy.h1
-rw-r--r--ipc/ipc_message_utils.cc32
-rw-r--r--ipc/ipc_message_utils.h29
4 files changed, 40 insertions, 24 deletions
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index 903a71d..9785216 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -36,6 +36,8 @@ class SendTask : public Task {
//------------------------------------------------------------------------------
+ChannelProxy::MessageFilter::MessageFilter() {}
+
ChannelProxy::MessageFilter::~MessageFilter() {}
void ChannelProxy::MessageFilter::OnFilterAdded(Channel* channel) {}
diff --git a/ipc/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h
index 19aea28..1ce9986 100644
--- a/ipc/ipc_channel_proxy.h
+++ b/ipc/ipc_channel_proxy.h
@@ -55,6 +55,7 @@ class ChannelProxy : public Message::Sender {
class MessageFilter
: public base::RefCountedThreadSafe<MessageFilter, MessageFilterTraits> {
public:
+ MessageFilter();
virtual ~MessageFilter();
// Called on the background thread to provide the filter with access to the
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc
index 5c599ab..9664810 100644
--- a/ipc/ipc_message_utils.cc
+++ b/ipc/ipc_message_utils.cc
@@ -401,4 +401,36 @@ void ParamTraits<IPC::ChannelHandle>::Log(const param_type& p,
l->append(")");
}
+LogData::LogData() {
+}
+
+LogData::~LogData() {
+}
+
+void ParamTraits<LogData>::Write(Message* m, const param_type& p) {
+ WriteParam(m, p.channel);
+ WriteParam(m, p.routing_id);
+ WriteParam(m, static_cast<int>(p.type));
+ WriteParam(m, p.flags);
+ WriteParam(m, p.sent);
+ WriteParam(m, p.receive);
+ WriteParam(m, p.dispatch);
+ WriteParam(m, p.params);
+}
+
+bool ParamTraits<LogData>::Read(const Message* m, void** iter, param_type* r) {
+ int type;
+ bool result =
+ ReadParam(m, iter, &r->channel) &&
+ ReadParam(m, iter, &r->routing_id) &&
+ ReadParam(m, iter, &type) &&
+ ReadParam(m, iter, &r->flags) &&
+ ReadParam(m, iter, &r->sent) &&
+ ReadParam(m, iter, &r->receive) &&
+ ReadParam(m, iter, &r->dispatch) &&
+ ReadParam(m, iter, &r->params);
+ r->type = static_cast<uint16>(type);
+ return result;
+}
+
} // namespace IPC
diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h
index dc1d35f..0e22c6b 100644
--- a/ipc/ipc_message_utils.h
+++ b/ipc/ipc_message_utils.h
@@ -730,6 +730,9 @@ struct ParamTraits<XFORM> {
#endif // defined(OS_WIN)
struct LogData {
+ LogData();
+ ~LogData();
+
std::string channel;
int32 routing_id;
uint32 type; // "User-defined" message type, from ipc_message.h.
@@ -746,30 +749,8 @@ struct LogData {
template <>
struct ParamTraits<LogData> {
typedef LogData param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.channel);
- WriteParam(m, p.routing_id);
- WriteParam(m, static_cast<int>(p.type));
- WriteParam(m, p.flags);
- WriteParam(m, p.sent);
- WriteParam(m, p.receive);
- WriteParam(m, p.dispatch);
- WriteParam(m, p.params);
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- int type;
- bool result =
- ReadParam(m, iter, &r->channel) &&
- ReadParam(m, iter, &r->routing_id) &&
- ReadParam(m, iter, &type) &&
- ReadParam(m, iter, &r->flags) &&
- ReadParam(m, iter, &r->sent) &&
- ReadParam(m, iter, &r->receive) &&
- ReadParam(m, iter, &r->dispatch) &&
- ReadParam(m, iter, &r->params);
- r->type = static_cast<uint16>(type);
- return result;
- }
+ static void Write(Message* m, const param_type& p);
+ static bool Read(const Message* m, void** iter, param_type* r);
static void Log(const param_type& p, std::string* l) {
// Doesn't make sense to implement this!
}