| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // IPC messages for content decryption module (CDM) implementation. | |
| 6 // Multiply-included message file, hence no include guard. | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <string> | |
| 11 #include <vector> | |
| 12 | |
| 13 #include "content/common/content_export.h" | |
| 14 #include "content/common/media/cdm_messages_enums.h" | |
| 15 #include "ipc/ipc_message_macros.h" | |
| 16 #include "media/base/cdm_key_information.h" | |
| 17 #include "media/base/media_keys.h" | |
| 18 #include "url/gurl.h" | |
| 19 | |
| 20 #undef IPC_MESSAGE_EXPORT | |
| 21 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | |
| 22 #define IPC_MESSAGE_START CdmMsgStart | |
| 23 | |
| 24 IPC_ENUM_TRAITS_MAX_VALUE(media::CdmKeyInformation::KeyStatus, | |
| 25 media::CdmKeyInformation::KEY_STATUS_MAX) | |
| 26 IPC_ENUM_TRAITS_MAX_VALUE(media::MediaKeys::Exception, | |
| 27 media::MediaKeys::EXCEPTION_MAX) | |
| 28 IPC_ENUM_TRAITS_MAX_VALUE(media::MediaKeys::SessionType, | |
| 29 media::MediaKeys::SESSION_TYPE_MAX) | |
| 30 IPC_ENUM_TRAITS_MAX_VALUE(media::MediaKeys::MessageType, | |
| 31 media::MediaKeys::MESSAGE_TYPE_MAX) | |
| 32 IPC_ENUM_TRAITS_MAX_VALUE(CdmHostMsg_CreateSession_InitDataType, | |
| 33 INIT_DATA_TYPE_MAX) | |
| 34 | |
| 35 IPC_STRUCT_BEGIN(CdmHostMsg_InitializeCdm_Params) | |
| 36 IPC_STRUCT_MEMBER(std::string, key_system) | |
| 37 IPC_STRUCT_MEMBER(GURL, security_origin) | |
| 38 IPC_STRUCT_MEMBER(bool, use_hw_secure_codecs) | |
| 39 IPC_STRUCT_END() | |
| 40 | |
| 41 IPC_STRUCT_TRAITS_BEGIN(media::CdmKeyInformation) | |
| 42 IPC_STRUCT_TRAITS_MEMBER(key_id) | |
| 43 IPC_STRUCT_TRAITS_MEMBER(status) | |
| 44 IPC_STRUCT_TRAITS_MEMBER(system_code) | |
| 45 IPC_STRUCT_TRAITS_END() | |
| 46 | |
| 47 // Parameter structure for CdmHostMsg_CreateSessionAndGenerateRequest. | |
| 48 IPC_STRUCT_BEGIN(CdmHostMsg_CreateSessionAndGenerateRequest_Params) | |
| 49 IPC_STRUCT_MEMBER(int, render_frame_id) | |
| 50 IPC_STRUCT_MEMBER(int, cdm_id) | |
| 51 IPC_STRUCT_MEMBER(uint32_t, promise_id) | |
| 52 IPC_STRUCT_MEMBER(media::MediaKeys::SessionType, session_type) | |
| 53 IPC_STRUCT_MEMBER(CdmHostMsg_CreateSession_InitDataType, init_data_type) | |
| 54 IPC_STRUCT_MEMBER(std::vector<uint8_t>, init_data) | |
| 55 IPC_STRUCT_END() | |
| 56 | |
| 57 | |
| 58 // Messages from render to browser. | |
| 59 | |
| 60 IPC_MESSAGE_CONTROL4(CdmHostMsg_InitializeCdm, | |
| 61 int /* render_frame_id */, | |
| 62 int /* cdm_id */, | |
| 63 uint32_t /* promise_id */, | |
| 64 CdmHostMsg_InitializeCdm_Params /* params */) | |
| 65 | |
| 66 IPC_MESSAGE_CONTROL4(CdmHostMsg_SetServerCertificate, | |
| 67 int /* render_frame_id */, | |
| 68 int /* cdm_id */, | |
| 69 uint32_t /* promise_id */, | |
| 70 std::vector<uint8_t> /* certificate */) | |
| 71 | |
| 72 IPC_MESSAGE_CONTROL1(CdmHostMsg_CreateSessionAndGenerateRequest, | |
| 73 CdmHostMsg_CreateSessionAndGenerateRequest_Params) | |
| 74 | |
| 75 IPC_MESSAGE_CONTROL5(CdmHostMsg_LoadSession, | |
| 76 int /* render_frame_id */, | |
| 77 int /* cdm_id */, | |
| 78 uint32_t /* promise_id */, | |
| 79 media::MediaKeys::SessionType /* session_type */, | |
| 80 std::string /* session_id */) | |
| 81 | |
| 82 IPC_MESSAGE_CONTROL5(CdmHostMsg_UpdateSession, | |
| 83 int /* render_frame_id */, | |
| 84 int /* cdm_id */, | |
| 85 uint32_t /* promise_id */, | |
| 86 std::string /* session_id */, | |
| 87 std::vector<uint8_t> /* response */) | |
| 88 | |
| 89 IPC_MESSAGE_CONTROL4(CdmHostMsg_CloseSession, | |
| 90 int /* render_frame_id */, | |
| 91 int /* cdm_id */, | |
| 92 uint32_t /* promise_id */, | |
| 93 std::string /* session_id */) | |
| 94 | |
| 95 IPC_MESSAGE_CONTROL4(CdmHostMsg_RemoveSession, | |
| 96 int /* render_frame_id */, | |
| 97 int /* cdm_id */, | |
| 98 uint32_t /* promise_id */, | |
| 99 std::string /* session_id */) | |
| 100 | |
| 101 IPC_MESSAGE_CONTROL2(CdmHostMsg_DestroyCdm, | |
| 102 int /* render_frame_id */, | |
| 103 int /* cdm_id */) | |
| 104 | |
| 105 // Messages from browser to render. | |
| 106 | |
| 107 IPC_MESSAGE_ROUTED4(CdmMsg_SessionMessage, | |
| 108 int /* cdm_id */, | |
| 109 std::string /* session_id */, | |
| 110 media::MediaKeys::MessageType /* message_type */, | |
| 111 std::vector<uint8_t> /* message */) | |
| 112 | |
| 113 IPC_MESSAGE_ROUTED2(CdmMsg_SessionClosed, | |
| 114 int /* cdm_id */, | |
| 115 std::string /* session_id */) | |
| 116 | |
| 117 IPC_MESSAGE_ROUTED4(CdmMsg_SessionKeysChange, | |
| 118 int /* cdm_id */, | |
| 119 std::string /* session_id */, | |
| 120 bool /* has_additional_usable_key */, | |
| 121 std::vector<media::CdmKeyInformation> /* keys_info */) | |
| 122 | |
| 123 IPC_MESSAGE_ROUTED3(CdmMsg_SessionExpirationUpdate, | |
| 124 int /* cdm_id */, | |
| 125 std::string /* session_id */, | |
| 126 base::Time /* new_expiry_time */) | |
| 127 | |
| 128 IPC_MESSAGE_ROUTED2(CdmMsg_ResolvePromise, | |
| 129 int /* cdm_id */, | |
| 130 uint32_t /* promise_id */) | |
| 131 | |
| 132 IPC_MESSAGE_ROUTED3(CdmMsg_ResolvePromiseWithSession, | |
| 133 int /* cdm_id */, | |
| 134 uint32_t /* promise_id */, | |
| 135 std::string /* session_id */) | |
| 136 | |
| 137 IPC_MESSAGE_ROUTED5(CdmMsg_RejectPromise, | |
| 138 int /* cdm_id */, | |
| 139 uint32_t /* promise_id */, | |
| 140 media::MediaKeys::Exception /* exception */, | |
| 141 uint32_t /* system_code */, | |
| 142 std::string /* error_message */) | |
| OLD | NEW |