| 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/media_keys.h" | 16 #include "media/base/media_keys.h" |
| 16 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 17 | 18 |
| 18 #undef IPC_MESSAGE_EXPORT | 19 #undef IPC_MESSAGE_EXPORT |
| 19 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 20 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 20 #define IPC_MESSAGE_START CdmMsgStart | 21 #define IPC_MESSAGE_START CdmMsgStart |
| 21 | 22 |
| 22 IPC_ENUM_TRAITS(media::MediaKeys::KeyError) | 23 IPC_ENUM_TRAITS_MAX_VALUE(media::CdmKeyInformation::KeyStatus, |
| 23 IPC_ENUM_TRAITS_MAX_VALUE(CdmHostMsg_CreateSession_ContentType, | 24 media::CdmKeyInformation::KEY_STATUS_MAX) |
| 25 IPC_ENUM_TRAITS_MAX_VALUE(media::MediaKeys::Exception, |
| 26 media::MediaKeys::EXCEPTION_MAX) |
| 27 IPC_ENUM_TRAITS_MAX_VALUE(media::MediaKeys::MessageType, |
| 28 media::MediaKeys::MESSAGE_TYPE_MAX) |
| 29 IPC_ENUM_TRAITS_MAX_VALUE(CdmHostMsg_CreateSession_InitDataType, |
| 24 CREATE_SESSION_TYPE_LAST) | 30 CREATE_SESSION_TYPE_LAST) |
| 25 | 31 |
| 32 IPC_STRUCT_TRAITS_BEGIN(media::CdmKeyInformation) |
| 33 IPC_STRUCT_TRAITS_MEMBER(key_id) |
| 34 IPC_STRUCT_TRAITS_MEMBER(status) |
| 35 IPC_STRUCT_TRAITS_MEMBER(system_code) |
| 36 IPC_STRUCT_TRAITS_END() |
| 37 |
| 26 // Messages from render to browser. | 38 // Messages from render to browser. |
| 27 | 39 |
| 28 IPC_MESSAGE_CONTROL4(CdmHostMsg_InitializeCdm, | 40 IPC_MESSAGE_CONTROL4(CdmHostMsg_InitializeCdm, |
| 29 int /* render_frame_id */, | 41 int /* render_frame_id */, |
| 30 int /* cdm_id */, | 42 int /* cdm_id */, |
| 31 std::string /* key_system */, | 43 std::string /* key_system */, |
| 32 GURL /* security_origin */) | 44 GURL /* security_origin */) |
| 33 | 45 |
| 34 IPC_MESSAGE_CONTROL5(CdmHostMsg_CreateSession, | 46 IPC_MESSAGE_CONTROL4(CdmHostMsg_SetServerCertificate, |
| 35 int /* render_frame_id */, | 47 int /* render_frame_id */, |
| 36 int /* cdm_id */, | 48 int /* cdm_id */, |
| 37 uint32_t /* session_id */, | 49 uint32_t /* promise_id */, |
| 38 CdmHostMsg_CreateSession_ContentType /* content_type */, | 50 std::vector<uint8_t> /* certificate */) |
| 39 std::vector<uint8> /* init_data */) | |
| 40 | 51 |
| 41 IPC_MESSAGE_CONTROL4(CdmHostMsg_UpdateSession, | 52 IPC_MESSAGE_CONTROL5(CdmHostMsg_CreateSessionAndGenerateRequest, |
| 42 int /* render_frame_id */, | 53 int /* render_frame_id */, |
| 43 int /* cdm_id */, | 54 int /* cdm_id */, |
| 44 uint32_t /* session_id */, | 55 uint32_t /* promise_id */, |
| 45 std::vector<uint8> /* response */) | 56 CdmHostMsg_CreateSession_InitDataType /* init_data_type */, |
| 57 std::vector<uint8_t> /* init_data */) |
| 46 | 58 |
| 47 IPC_MESSAGE_CONTROL3(CdmHostMsg_ReleaseSession, | 59 IPC_MESSAGE_CONTROL5(CdmHostMsg_UpdateSession, |
| 48 int /* render_frame_id */, | 60 int /* render_frame_id */, |
| 49 int /* cdm_id */, | 61 int /* cdm_id */, |
| 50 uint32_t /* session_id */) | 62 uint32_t /* promise_id */, |
| 63 std::string /* session_id */, |
| 64 std::vector<uint8_t> /* response */) |
| 65 |
| 66 IPC_MESSAGE_CONTROL4(CdmHostMsg_CloseSession, |
| 67 int /* render_frame_id */, |
| 68 int /* cdm_id */, |
| 69 uint32_t /* promise_id */, |
| 70 std::string /* session_id */) |
| 51 | 71 |
| 52 IPC_MESSAGE_CONTROL2(CdmHostMsg_DestroyCdm, | 72 IPC_MESSAGE_CONTROL2(CdmHostMsg_DestroyCdm, |
| 53 int /* render_frame_id */, | 73 int /* render_frame_id */, |
| 54 int /* cdm_id */) | 74 int /* cdm_id */) |
| 55 | 75 |
| 56 // Messages from browser to render. | 76 // Messages from browser to render. |
| 57 | 77 |
| 58 IPC_MESSAGE_ROUTED3(CdmMsg_SessionCreated, | 78 IPC_MESSAGE_ROUTED5(CdmMsg_SessionMessage, |
| 59 int /* cdm_id */, | 79 int /* cdm_id */, |
| 60 uint32_t /* session_id */, | 80 std::string /* session_id */, |
| 61 std::string /* web_session_id */) | 81 media::MediaKeys::MessageType /* message_type */, |
| 62 | 82 std::vector<uint8_t> /* message */, |
| 63 IPC_MESSAGE_ROUTED4(CdmMsg_SessionMessage, | 83 GURL /* legacy_destination_url */) |
| 64 int /* cdm_id */, | |
| 65 uint32_t /* session_id */, | |
| 66 std::vector<uint8> /* message */, | |
| 67 GURL /* destination_url */) | |
| 68 | |
| 69 IPC_MESSAGE_ROUTED2(CdmMsg_SessionReady, | |
| 70 int /* cdm_id */, | |
| 71 uint32_t /* session_id */) | |
| 72 | 84 |
| 73 IPC_MESSAGE_ROUTED2(CdmMsg_SessionClosed, | 85 IPC_MESSAGE_ROUTED2(CdmMsg_SessionClosed, |
| 74 int /* cdm_id */, | 86 int /* cdm_id */, |
| 75 uint32_t /* session_id */) | 87 std::string /* session_id */) |
| 76 | 88 |
| 77 IPC_MESSAGE_ROUTED4(CdmMsg_SessionError, | 89 IPC_MESSAGE_ROUTED5(CdmMsg_LegacySessionError, |
| 78 int /* cdm_id */, | 90 int /* cdm_id */, |
| 79 uint32_t /* session_id */, | 91 std::string /* session_id */, |
| 80 media::MediaKeys::KeyError /* error_code */, | 92 media::MediaKeys::Exception /* exception_code */, |
| 81 uint32_t /* system_code */) | 93 uint32_t /* system_code */, |
| 94 std::string /* error_message */) |
| 95 |
| 96 IPC_MESSAGE_ROUTED4(CdmMsg_SessionKeysChange, |
| 97 int /* cdm_id */, |
| 98 std::string /* session_id */, |
| 99 bool /* has_additional_usable_key */, |
| 100 std::vector<media::CdmKeyInformation> /* keys_info */) |
| 101 |
| 102 IPC_MESSAGE_ROUTED3(CdmMsg_SessionExpirationUpdate, |
| 103 int /* cdm_id */, |
| 104 std::string /* session_id */, |
| 105 base::Time /* new_expiry_time */) |
| 106 |
| 107 IPC_MESSAGE_ROUTED2(CdmMsg_ResolvePromise, |
| 108 int /* cdm_id */, |
| 109 uint32_t /* promise_id */) |
| 110 |
| 111 IPC_MESSAGE_ROUTED3(CdmMsg_ResolvePromiseWithSession, |
| 112 int /* cdm_id */, |
| 113 uint32_t /* promise_id */, |
| 114 std::string /* session_id */) |
| 115 |
| 116 IPC_MESSAGE_ROUTED5(CdmMsg_RejectPromise, |
| 117 int /* cdm_id */, |
| 118 uint32_t /* promise_id */, |
| 119 media::MediaKeys::Exception /* exception */, |
| 120 uint32_t /* system_code */, |
| 121 std::string /* error_message */) |
| OLD | NEW |