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

Unified Diff: ipc/ipc_message_utils.cc

Issue 11194042: Implement TextureImageTransportSurface using texture mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased, fixed post sub buffer, use multiple mailbox names Created 8 years, 1 month 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
Index: ipc/ipc_message_utils.cc
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc
index 3ce9be53b3672cf1b9f1642bb39b64d326140aaa..9b8eb11d98385c53b42cc7ec98e58871095130a4 100644
--- a/ipc/ipc_message_utils.cc
+++ b/ipc/ipc_message_utils.cc
@@ -426,6 +426,34 @@ void ParamTraits<std::vector<unsigned char> >::Log(const param_type& p,
LogBytes(p, l);
}
+void ParamTraits<std::vector<signed char> >::Write(Message* m,
apatrick_chromium 2012/11/09 19:19:04 Are you sure you need explicit ParamTraits for std
no sievers 2012/11/09 21:53:02 It has the ipc traits for char and unsigned char.
piman 2012/11/09 22:02:01 It will work though use an int for each char (i.e.
no sievers 2012/11/19 20:30:44 I switched it to using strings.
+ const param_type& p) {
+ if (p.empty()) {
+ m->WriteData(NULL, 0);
+ } else {
+ m->WriteData(reinterpret_cast<const char*>(&p.front()),
+ static_cast<int>(p.size()));
+ }
+}
+
+bool ParamTraits<std::vector<signed char> >::Read(const Message* m,
+ PickleIterator* iter,
+ param_type* r) {
+ const char *data;
+ int data_size = 0;
+ if (!m->ReadData(iter, &data, &data_size) || data_size < 0)
+ return false;
+ r->resize(data_size);
+ if (data_size)
+ memcpy(&r->front(), data, data_size);
+ return true;
+}
+
+void ParamTraits<std::vector<signed char> >::Log(const param_type& p,
+ std::string* l) {
+ LogBytes(p, l);
+}
+
void ParamTraits<std::vector<bool> >::Write(Message* m, const param_type& p) {
WriteParam(m, static_cast<int>(p.size()));
for (size_t i = 0; i < p.size(); i++)

Powered by Google App Engine
This is Rietveld 408576698