| Index: media/base/ipc/media_param_traits.cc
|
| diff --git a/media/base/ipc/media_param_traits.cc b/media/base/ipc/media_param_traits.cc
|
| index 6de97b325dd0d4a22b8d1e640435cff97daa6c57..8233f3d53625bb6185caf7cb29329a98a56dfe5f 100644
|
| --- a/media/base/ipc/media_param_traits.cc
|
| +++ b/media/base/ipc/media_param_traits.cc
|
| @@ -8,6 +8,7 @@
|
| #include "ipc/ipc_message_utils.h"
|
| #include "media/base/audio_parameters.h"
|
| #include "media/base/audio_point.h"
|
| +#include "media/base/encryption_scheme.h"
|
| #include "media/base/limits.h"
|
| #include "ui/gfx/ipc/geometry/gfx_param_traits.h"
|
| #include "ui/gfx/ipc/gfx_param_traits.h"
|
| @@ -80,6 +81,74 @@ void ParamTraits<AudioParameters>::Log(const AudioParameters& p,
|
| l->append(base::StringPrintf("<AudioParameters>"));
|
| }
|
|
|
| +template <>
|
| +struct ParamTraits<media::EncryptionScheme::Pattern> {
|
| + typedef media::EncryptionScheme::Pattern param_type;
|
| + static void GetSize(base::PickleSizer* s, const param_type& p);
|
| + static void Write(base::Pickle* m, const param_type& p);
|
| + static bool Read(const base::Pickle* m,
|
| + base::PickleIterator* iter,
|
| + param_type* r);
|
| + static void Log(const param_type& p, std::string* l);
|
| +};
|
| +
|
| +void ParamTraits<media::EncryptionScheme>::GetSize(base::PickleSizer* s,
|
| + const param_type& p) {
|
| + GetParamSize(s, p.mode());
|
| + GetParamSize(s, p.pattern());
|
| +}
|
| +
|
| +void ParamTraits<media::EncryptionScheme>::Write(base::Pickle* m,
|
| + const param_type& p) {
|
| + WriteParam(m, p.mode());
|
| + WriteParam(m, p.pattern());
|
| +}
|
| +
|
| +bool ParamTraits<media::EncryptionScheme>::Read(const base::Pickle* m,
|
| + base::PickleIterator* iter,
|
| + param_type* r) {
|
| + media::EncryptionScheme::CipherMode mode;
|
| + media::EncryptionScheme::Pattern pattern;
|
| + if (!ReadParam(m, iter, &mode) || !ReadParam(m, iter, &pattern))
|
| + return false;
|
| + *r = media::EncryptionScheme(mode, pattern);
|
| + return true;
|
| +}
|
| +
|
| +void ParamTraits<media::EncryptionScheme>::Log(const param_type& p,
|
| + std::string* l) {
|
| + l->append(base::StringPrintf("<EncryptionScheme>"));
|
| +}
|
| +
|
| +void ParamTraits<media::EncryptionScheme::Pattern>::GetSize(
|
| + base::PickleSizer* s,
|
| + const param_type& p) {
|
| + GetParamSize(s, p.encrypt_blocks());
|
| + GetParamSize(s, p.skip_blocks());
|
| +}
|
| +
|
| +void ParamTraits<media::EncryptionScheme::Pattern>::Write(base::Pickle* m,
|
| + const param_type& p) {
|
| + WriteParam(m, p.encrypt_blocks());
|
| + WriteParam(m, p.skip_blocks());
|
| +}
|
| +
|
| +bool ParamTraits<media::EncryptionScheme::Pattern>::Read(
|
| + const base::Pickle* m,
|
| + base::PickleIterator* iter,
|
| + param_type* r) {
|
| + uint8_t encrypt_blocks, skip_blocks;
|
| + if (!ReadParam(m, iter, &encrypt_blocks) || !ReadParam(m, iter, &skip_blocks))
|
| + return false;
|
| + *r = media::EncryptionScheme::Pattern(encrypt_blocks, skip_blocks);
|
| + return true;
|
| +}
|
| +
|
| +void ParamTraits<media::EncryptionScheme::Pattern>::Log(const param_type& p,
|
| + std::string* l) {
|
| + l->append(base::StringPrintf("<Pattern>"));
|
| +}
|
| +
|
| } // namespace IPC
|
|
|
| // Generate param traits size methods.
|
|
|