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

Unified Diff: ppapi/proxy/ppapi_param_traits.cc

Issue 811923002: Changes to support CDM_7 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pass array Created 5 years, 11 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
Index: ppapi/proxy/ppapi_param_traits.cc
diff --git a/ppapi/proxy/ppapi_param_traits.cc b/ppapi/proxy/ppapi_param_traits.cc
index 94ec2e69bfc2007c3cc5d589f413e9d62135c785..1c3254425b3428e4588c96f34b660de1e06ca67b 100644
--- a/ppapi/proxy/ppapi_param_traits.cc
+++ b/ppapi/proxy/ppapi_param_traits.cc
@@ -97,6 +97,52 @@ bool ParamTraits<PP_Bool>::Read(const Message* m,
void ParamTraits<PP_Bool>::Log(const param_type& p, std::string* l) {
}
+// PP_KeyInformation -------------------------------------------------------
+
+// static
+void ParamTraits<PP_KeyInformation>::Write(Message* m, const param_type& p) {
+ WriteParam(m, p.key_id_size);
+ m->WriteBytes(p.key_id, static_cast<int>(p.key_id_size));
+ WriteParam(m, p.key_status);
+ WriteParam(m, p.system_code);
dmichael (off chromium) 2015/01/08 18:23:18 Did you try using the IPC_STRUCT_TRAITS_BEGIN/END
jrummell 2015/01/08 18:40:50 I did try it, but got compile errors with ParamTra
+}
+
+// static
+bool ParamTraits<PP_KeyInformation>::Read(const Message* m,
+ PickleIterator* iter,
+ param_type* p) {
+ uint32 size;
dcheng 2015/01/08 19:12:31 uint32_t
jrummell 2015/01/08 20:12:12 Done.
+ if (!ReadParam(m, iter, &size))
+ return false;
+ if (size > sizeof(p->key_id))
+ return false;
+ p->key_id_size = size;
+
+ const char* data;
+ if (!iter->ReadBytes(&data, size))
+ return false;
+ memcpy(p->key_id, data, size);
+
+ PP_CdmKeyStatus key_status;
+ if (!ReadParam(m, iter, &key_status))
+ return false;
+ p->key_status = key_status;
+
+ uint32 system_code;
dcheng 2015/01/08 19:12:31 Here too.
jrummell 2015/01/08 20:12:12 Done.
+ if (!ReadParam(m, iter, &system_code))
+ return false;
+ p->system_code = system_code;
+
+ return true;
+}
+
+// static
+void ParamTraits<PP_KeyInformation>::Log(const param_type& p, std::string* l) {
+ l->append("<PP_KeyInformation (");
+ LogParam(p.key_id_size, l);
+ l->append(" bytes)>");
+}
+
// PP_NetAddress_Private -------------------------------------------------------
// static

Powered by Google App Engine
This is Rietveld 408576698