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

Unified Diff: ipc/ipc_message_utils.h

Issue 2097001: Add new ipc message utility and new message types in preparation for OOP impo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message_utils.h
===================================================================
--- ipc/ipc_message_utils.h (revision 47146)
+++ ipc/ipc_message_utils.h (working copy)
@@ -9,6 +9,7 @@
#include <string>
#include <vector>
#include <map>
+#include <set>
#include "base/file_path.h"
#include "base/format_macros.h"
@@ -38,6 +39,8 @@
PluginProcessHostMsgStart,
PluginMsgStart,
PluginHostMsgStart,
+ ProfileImportProcessMsgStart,
+ ProfileImportProcessHostMsgStart,
NPObjectMsgStart,
TestMsgStart,
DevToolsAgentMsgStart,
@@ -467,12 +470,38 @@
for (size_t i = 0; i < p.size(); ++i) {
if (i != 0)
l->append(L" ");
-
LogParam((p[i]), l);
}
}
};
+template <class P>
+struct ParamTraits<std::set<P> > {
+ typedef std::set<P> param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, static_cast<int>(p.size()));
+ typename param_type::const_iterator iter;
+ for (iter = p.begin(); iter != p.end(); ++iter)
+ WriteParam(m, *iter);
+ }
+ static bool Read(const Message* m, void** iter, param_type* r) {
+ int size;
+ if (!m->ReadLength(iter, &size))
+ return false;
+ for (int i = 0; i < size; ++i) {
+ P item;
+ if (!ReadParam(m, iter, &item))
+ return false;
+ r->insert(item);
+ }
+ return true;
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"<std::set>");
jeremy 2010/05/13 21:01:59 Should LogParam() all items in the set (see std::v
+ }
+};
+
+
template <class K, class V>
struct ParamTraits<std::map<K, V> > {
typedef std::map<K, V> param_type;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698