Blink roll 25b6bd3a7a131ffe68d809546ad1a20707915cdc:3a503f41ae42e5b79cfcd2ff10e65afde...
[chromium-blink-merge.git] / content / common / media / cdm_messages.h
blob68c7bd184df5623e95fd723ede42922c68b03715
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.
5 // IPC messages for content decryption module (CDM) implementation.
6 // Multiply-included message file, hence no include guard.
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "content/common/content_export.h"
13 #include "content/common/media/cdm_messages_enums.h"
14 #include "ipc/ipc_message_macros.h"
15 #include "media/base/media_keys.h"
16 #include "url/gurl.h"
18 #undef IPC_MESSAGE_EXPORT
19 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
20 #define IPC_MESSAGE_START CdmMsgStart
22 IPC_ENUM_TRAITS(media::MediaKeys::KeyError)
23 IPC_ENUM_TRAITS_MAX_VALUE(CdmHostMsg_CreateSession_ContentType,
24 CREATE_SESSION_TYPE_LAST)
26 // Messages from render to browser.
28 IPC_MESSAGE_CONTROL4(CdmHostMsg_InitializeCdm,
29 int /* render_frame_id */,
30 int /* cdm_id */,
31 std::string /* key_system */,
32 GURL /* security_origin */)
34 IPC_MESSAGE_CONTROL5(CdmHostMsg_CreateSession,
35 int /* render_frame_id */,
36 int /* cdm_id */,
37 uint32_t /* session_id */,
38 CdmHostMsg_CreateSession_ContentType /* content_type */,
39 std::vector<uint8> /* init_data */)
41 IPC_MESSAGE_CONTROL4(CdmHostMsg_UpdateSession,
42 int /* render_frame_id */,
43 int /* cdm_id */,
44 uint32_t /* session_id */,
45 std::vector<uint8> /* response */)
47 IPC_MESSAGE_CONTROL3(CdmHostMsg_ReleaseSession,
48 int /* render_frame_id */,
49 int /* cdm_id */,
50 uint32_t /* session_id */)
52 IPC_MESSAGE_CONTROL2(CdmHostMsg_DestroyCdm,
53 int /* render_frame_id */,
54 int /* cdm_id */)
56 // Messages from browser to render.
58 IPC_MESSAGE_ROUTED3(CdmMsg_SessionCreated,
59 int /* cdm_id */,
60 uint32_t /* session_id */,
61 std::string /* web_session_id */)
63 IPC_MESSAGE_ROUTED4(CdmMsg_SessionMessage,
64 int /* cdm_id */,
65 uint32_t /* session_id */,
66 std::vector<uint8> /* message */,
67 GURL /* destination_url */)
69 IPC_MESSAGE_ROUTED2(CdmMsg_SessionReady,
70 int /* cdm_id */,
71 uint32_t /* session_id */)
73 IPC_MESSAGE_ROUTED2(CdmMsg_SessionClosed,
74 int /* cdm_id */,
75 uint32_t /* session_id */)
77 IPC_MESSAGE_ROUTED4(CdmMsg_SessionError,
78 int /* cdm_id */,
79 uint32_t /* session_id */,
80 media::MediaKeys::KeyError /* error_code */,
81 uint32_t /* system_code */)