| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // IPC messages for content decryption module (CDM) implementation. | 5 // IPC messages for content decryption module (CDM) implementation. |
| 6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/common/media/cdm_messages_enums.h" | 13 #include "content/common/media/cdm_messages_enums.h" |
| 14 #include "ipc/ipc_message_macros.h" | 14 #include "ipc/ipc_message_macros.h" |
| 15 #include "media/base/cdm_key_information.h" | 15 #include "media/base/cdm_key_information.h" |
| 16 #include "media/base/media_keys.h" | 16 #include "media/base/media_keys.h" |
| 17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 18 | 18 |
| 19 #undef IPC_MESSAGE_EXPORT | 19 #undef IPC_MESSAGE_EXPORT |
| 20 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 20 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 21 #define IPC_MESSAGE_START CdmMsgStart | 21 #define IPC_MESSAGE_START CdmMsgStart |
| 22 | 22 |
| 23 IPC_ENUM_TRAITS_MAX_VALUE(media::CdmKeyInformation::KeyStatus, | 23 IPC_ENUM_TRAITS_MAX_VALUE(media::CdmKeyInformation::KeyStatus, |
| 24 media::CdmKeyInformation::KEY_STATUS_MAX) | 24 media::CdmKeyInformation::KEY_STATUS_MAX) |
| 25 IPC_ENUM_TRAITS_MAX_VALUE(media::MediaKeys::Exception, | 25 IPC_ENUM_TRAITS_MAX_VALUE(media::MediaKeys::Exception, |
| 26 media::MediaKeys::EXCEPTION_MAX) | 26 media::MediaKeys::EXCEPTION_MAX) |
| 27 IPC_ENUM_TRAITS_MAX_VALUE(media::MediaKeys::SessionType, |
| 28 media::MediaKeys::SESSION_TYPE_MAX) |
| 27 IPC_ENUM_TRAITS_MAX_VALUE(media::MediaKeys::MessageType, | 29 IPC_ENUM_TRAITS_MAX_VALUE(media::MediaKeys::MessageType, |
| 28 media::MediaKeys::MESSAGE_TYPE_MAX) | 30 media::MediaKeys::MESSAGE_TYPE_MAX) |
| 29 IPC_ENUM_TRAITS_MAX_VALUE(CdmHostMsg_CreateSession_InitDataType, | 31 IPC_ENUM_TRAITS_MAX_VALUE(CdmHostMsg_CreateSession_InitDataType, |
| 30 INIT_DATA_TYPE_MAX) | 32 INIT_DATA_TYPE_MAX) |
| 31 | 33 |
| 32 IPC_STRUCT_BEGIN(CdmHostMsg_InitializeCdm_Params) | 34 IPC_STRUCT_BEGIN(CdmHostMsg_InitializeCdm_Params) |
| 33 IPC_STRUCT_MEMBER(std::string, key_system) | 35 IPC_STRUCT_MEMBER(std::string, key_system) |
| 34 IPC_STRUCT_MEMBER(GURL, security_origin) | 36 IPC_STRUCT_MEMBER(GURL, security_origin) |
| 35 IPC_STRUCT_MEMBER(bool, use_hw_secure_codecs) | 37 IPC_STRUCT_MEMBER(bool, use_hw_secure_codecs) |
| 36 IPC_STRUCT_END() | 38 IPC_STRUCT_END() |
| 37 | 39 |
| 38 IPC_STRUCT_TRAITS_BEGIN(media::CdmKeyInformation) | 40 IPC_STRUCT_TRAITS_BEGIN(media::CdmKeyInformation) |
| 39 IPC_STRUCT_TRAITS_MEMBER(key_id) | 41 IPC_STRUCT_TRAITS_MEMBER(key_id) |
| 40 IPC_STRUCT_TRAITS_MEMBER(status) | 42 IPC_STRUCT_TRAITS_MEMBER(status) |
| 41 IPC_STRUCT_TRAITS_MEMBER(system_code) | 43 IPC_STRUCT_TRAITS_MEMBER(system_code) |
| 42 IPC_STRUCT_TRAITS_END() | 44 IPC_STRUCT_TRAITS_END() |
| 43 | 45 |
| 46 // Parameter structure for CdmHostMsg_CreateSessionAndGenerateRequest. |
| 47 IPC_STRUCT_BEGIN(CdmHostMsg_CreateSessionAndGenerateRequest_Params) |
| 48 IPC_STRUCT_MEMBER(int, render_frame_id) |
| 49 IPC_STRUCT_MEMBER(int, cdm_id) |
| 50 IPC_STRUCT_MEMBER(uint32_t, promise_id) |
| 51 IPC_STRUCT_MEMBER(media::MediaKeys::SessionType, session_type) |
| 52 IPC_STRUCT_MEMBER(CdmHostMsg_CreateSession_InitDataType, init_data_type) |
| 53 IPC_STRUCT_MEMBER(std::vector<uint8_t>, init_data) |
| 54 IPC_STRUCT_END() |
| 55 |
| 56 |
| 44 // Messages from render to browser. | 57 // Messages from render to browser. |
| 45 | 58 |
| 46 IPC_MESSAGE_CONTROL4(CdmHostMsg_InitializeCdm, | 59 IPC_MESSAGE_CONTROL4(CdmHostMsg_InitializeCdm, |
| 47 int /* render_frame_id */, | 60 int /* render_frame_id */, |
| 48 int /* cdm_id */, | 61 int /* cdm_id */, |
| 49 uint32_t /* promise_id */, | 62 uint32_t /* promise_id */, |
| 50 CdmHostMsg_InitializeCdm_Params /* params */) | 63 CdmHostMsg_InitializeCdm_Params /* params */) |
| 51 | 64 |
| 52 IPC_MESSAGE_CONTROL4(CdmHostMsg_SetServerCertificate, | 65 IPC_MESSAGE_CONTROL4(CdmHostMsg_SetServerCertificate, |
| 53 int /* render_frame_id */, | 66 int /* render_frame_id */, |
| 54 int /* cdm_id */, | 67 int /* cdm_id */, |
| 55 uint32_t /* promise_id */, | 68 uint32_t /* promise_id */, |
| 56 std::vector<uint8_t> /* certificate */) | 69 std::vector<uint8_t> /* certificate */) |
| 57 | 70 |
| 58 IPC_MESSAGE_CONTROL5(CdmHostMsg_CreateSessionAndGenerateRequest, | 71 IPC_MESSAGE_CONTROL1(CdmHostMsg_CreateSessionAndGenerateRequest, |
| 72 CdmHostMsg_CreateSessionAndGenerateRequest_Params) |
| 73 |
| 74 IPC_MESSAGE_CONTROL5(CdmHostMsg_LoadSession, |
| 59 int /* render_frame_id */, | 75 int /* render_frame_id */, |
| 60 int /* cdm_id */, | 76 int /* cdm_id */, |
| 61 uint32_t /* promise_id */, | 77 uint32_t /* promise_id */, |
| 62 CdmHostMsg_CreateSession_InitDataType /* init_data_type */, | 78 media::MediaKeys::SessionType /* session_type */, |
| 63 std::vector<uint8_t> /* init_data */) | 79 std::string /* session_id */) |
| 64 | 80 |
| 65 IPC_MESSAGE_CONTROL5(CdmHostMsg_UpdateSession, | 81 IPC_MESSAGE_CONTROL5(CdmHostMsg_UpdateSession, |
| 66 int /* render_frame_id */, | 82 int /* render_frame_id */, |
| 67 int /* cdm_id */, | 83 int /* cdm_id */, |
| 68 uint32_t /* promise_id */, | 84 uint32_t /* promise_id */, |
| 69 std::string /* session_id */, | 85 std::string /* session_id */, |
| 70 std::vector<uint8_t> /* response */) | 86 std::vector<uint8_t> /* response */) |
| 71 | 87 |
| 72 IPC_MESSAGE_CONTROL4(CdmHostMsg_CloseSession, | 88 IPC_MESSAGE_CONTROL4(CdmHostMsg_CloseSession, |
| 73 int /* render_frame_id */, | 89 int /* render_frame_id */, |
| 74 int /* cdm_id */, | 90 int /* cdm_id */, |
| 75 uint32_t /* promise_id */, | 91 uint32_t /* promise_id */, |
| 76 std::string /* session_id */) | 92 std::string /* session_id */) |
| 77 | 93 |
| 94 IPC_MESSAGE_CONTROL4(CdmHostMsg_RemoveSession, |
| 95 int /* render_frame_id */, |
| 96 int /* cdm_id */, |
| 97 uint32_t /* promise_id */, |
| 98 std::string /* session_id */) |
| 99 |
| 78 IPC_MESSAGE_CONTROL2(CdmHostMsg_DestroyCdm, | 100 IPC_MESSAGE_CONTROL2(CdmHostMsg_DestroyCdm, |
| 79 int /* render_frame_id */, | 101 int /* render_frame_id */, |
| 80 int /* cdm_id */) | 102 int /* cdm_id */) |
| 81 | 103 |
| 82 // Messages from browser to render. | 104 // Messages from browser to render. |
| 83 | 105 |
| 84 IPC_MESSAGE_ROUTED5(CdmMsg_SessionMessage, | 106 IPC_MESSAGE_ROUTED5(CdmMsg_SessionMessage, |
| 85 int /* cdm_id */, | 107 int /* cdm_id */, |
| 86 std::string /* session_id */, | 108 std::string /* session_id */, |
| 87 media::MediaKeys::MessageType /* message_type */, | 109 media::MediaKeys::MessageType /* message_type */, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 118 int /* cdm_id */, | 140 int /* cdm_id */, |
| 119 uint32_t /* promise_id */, | 141 uint32_t /* promise_id */, |
| 120 std::string /* session_id */) | 142 std::string /* session_id */) |
| 121 | 143 |
| 122 IPC_MESSAGE_ROUTED5(CdmMsg_RejectPromise, | 144 IPC_MESSAGE_ROUTED5(CdmMsg_RejectPromise, |
| 123 int /* cdm_id */, | 145 int /* cdm_id */, |
| 124 uint32_t /* promise_id */, | 146 uint32_t /* promise_id */, |
| 125 media::MediaKeys::Exception /* exception */, | 147 media::MediaKeys::Exception /* exception */, |
| 126 uint32_t /* system_code */, | 148 uint32_t /* system_code */, |
| 127 std::string /* error_message */) | 149 std::string /* error_message */) |
| OLD | NEW |