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

Unified Diff: ipc/ipc_message_utils.h

Issue 7990005: Use a placeholder instead of the default plugin for missing plug-ins on Mac and Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 3 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/renderer/render_view.h ('K') | « content/renderer/render_view.cc ('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.h
diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h
index 8a03069c432890c3e7ef1413b2399db7a84d62c2..91af78701ddd6c7893ad9a8aa90b30835ef5421e 100644
--- a/ipc/ipc_message_utils.h
+++ b/ipc/ipc_message_utils.h
@@ -497,6 +497,37 @@ struct ParamTraits<std::vector<char> > {
}
};
+template <>
+struct ParamTraits<std::vector<bool> > {
jam 2011/09/27 16:51:34 why do you need this? i.e. why isn't the traits be
Bernhard Bauer 2011/09/27 21:21:39 std::vector has a specialization for bool which us
jam 2011/09/29 01:03:32 what paramtraits below are you talking about?
Bernhard Bauer 2011/09/29 13:20:47 ParamTraits<std::vector<P> > takes the address of
jam 2011/09/29 16:31:10 ah, nm now i get it. I was familiar with vector's
+ typedef std::vector<bool> param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, static_cast<int>(p.size()));
+ for (size_t i = 0; i < p.size(); i++)
+ WriteParam(m, p[i]);
+ }
+ static bool Read(const Message* m, void** iter, param_type* r) {
+ int size;
+ // ReadLength() checks for < 0 itself.
+ if (!m->ReadLength(iter, &size))
+ return false;
+ r->resize(size);
+ for (int i = 0; i < size; i++) {
+ bool value;
+ if (!ReadParam(m, iter, &value))
+ return false;
+ (*r)[i] = value;
+ }
+ return true;
+ }
+ static void Log(const param_type& p, std::string* l) {
+ for (size_t i = 0; i < p.size(); ++i) {
+ if (i != 0)
+ l->append(" ");
+ LogParam((p[i]), l);
+ }
+ }
+};
+
template <class P>
struct ParamTraits<std::vector<P> > {
typedef std::vector<P> param_type;
« content/renderer/render_view.h ('K') | « content/renderer/render_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698