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

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: CrOS compile error 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
« no previous file with comments | « ppapi/proxy/ppapi_param_traits.h ('k') | ppapi/proxy/ppb_instance_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c3e5af17503bd4389968c7c8a08543d036cea7bb 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);
+}
+
+// static
+bool ParamTraits<PP_KeyInformation>::Read(const Message* m,
+ PickleIterator* iter,
+ param_type* p) {
+ uint32_t size;
+ 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_t system_code;
+ 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
« no previous file with comments | « ppapi/proxy/ppapi_param_traits.h ('k') | ppapi/proxy/ppb_instance_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698