diff options
author | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-12 19:09:32 +0000 |
---|---|---|
committer | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-12 19:09:32 +0000 |
commit | bef8073239ce449300e4670bd11062ad898e7971 (patch) | |
tree | bd7be270a53157ce71a3d86f098c5d02624d4ef2 /ppapi | |
parent | 8fc2a4bfd29a6d984c203caff5376d66be2a5988 (diff) | |
download | chromium_src-bef8073239ce449300e4670bd11062ad898e7971.zip chromium_src-bef8073239ce449300e4670bd11062ad898e7971.tar.gz chromium_src-bef8073239ce449300e4670bd11062ad898e7971.tar.bz2 |
Support LoadSession() in MediaKeys and PPP_ContentDecryptor_Private interface.
- Add LoadSession() to all MediaKeys implementations.
- Add LoadSession() support in PPP_ContentDecryptor_Private stack.
- Move "LOAD_SESSION|" parsing code from CdmWrapper to ProxyDecryptor.
- Also update "type" parameter in CreateSession() to "content_type".
BUG=338831
TEST=LoadSession tests in browser_tests still pass.
R=dcheng@chromium.org, ddorwin@chromium.org, dmichael@chromium.org
Review URL: https://codereview.chromium.org/131653003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250769 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/api/private/ppp_content_decryptor_private.idl | 32 | ||||
-rw-r--r-- | ppapi/c/private/ppp_content_decryptor_private.h | 40 | ||||
-rw-r--r-- | ppapi/cpp/private/content_decryptor_private.cc | 17 | ||||
-rw-r--r-- | ppapi/cpp/private/content_decryptor_private.h | 4 | ||||
-rw-r--r-- | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c | 52 | ||||
-rw-r--r-- | ppapi/proxy/ppapi_messages.h | 6 | ||||
-rw-r--r-- | ppapi/proxy/ppp_content_decryptor_private_proxy.cc | 32 | ||||
-rw-r--r-- | ppapi/proxy/ppp_content_decryptor_private_proxy.h | 5 |
8 files changed, 144 insertions, 44 deletions
diff --git a/ppapi/api/private/ppp_content_decryptor_private.idl b/ppapi/api/private/ppp_content_decryptor_private.idl index 71cda55..f6cd1f0 100644 --- a/ppapi/api/private/ppp_content_decryptor_private.idl +++ b/ppapi/api/private/ppp_content_decryptor_private.idl @@ -9,7 +9,7 @@ * Decryption Modules, not normal plugins. */ label Chrome { - M34 = 0.10 + M34 = 0.11 }; /** @@ -31,19 +31,18 @@ interface PPP_ContentDecryptor_Private { [in] PP_Var key_system); /** - * Creates a session. <code>type</code> contains the MIME type of + * Creates a session. <code>content_type</code> contains the MIME type of * <code>init_data</code>. <code>init_data</code> is a data buffer * containing data for use in generating the request. * - * Note: <code>CreateSession()</code> must create the session ID used in - * other methods on this interface. The session ID must be provided to the - * browser by the CDM via <code>SessionCreated()</code> on the + * Note: <code>CreateSession()</code> must create a web session ID and provide + * it to the browser via <code>SessionCreated()</code> on the * <code>PPB_ContentDecryptor_Private</code> interface. * * @param[in] session_id A reference for the session for which a session * should be generated. * - * @param[in] type A <code>PP_Var</code> of type + * @param[in] content_type A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the MIME type for init_data. * * @param[in] init_data A <code>PP_Var</code> of type @@ -53,10 +52,29 @@ interface PPP_ContentDecryptor_Private { void CreateSession( [in] PP_Instance instance, [in] uint32_t session_id, - [in] PP_Var type, + [in] PP_Var content_type, [in] PP_Var init_data); /** + * Loads a session whose web session ID is <code>web_session_id</code>. + * + * Note: After the session is successfully loaded, the CDM must call + * <code>SessionCreated()</code> with <code>web_session_id</code> on the + * <code>PPB_ContentDecryptor_Private</code> interface. + * + * @param[in] session_id A reference for the session for which a session + * should be loaded. + * + * @param[in] web_session_id A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session + * to load. + */ + void LoadSession( + [in] PP_Instance instance, + [in] uint32_t session_id, + [in] PP_Var web_session_id); + + /** * Provides a license or other message to the decryptor. * * When the CDM needs more information, it must call diff --git a/ppapi/c/private/ppp_content_decryptor_private.h b/ppapi/c/private/ppp_content_decryptor_private.h index b063dc7..b319eaf 100644 --- a/ppapi/c/private/ppp_content_decryptor_private.h +++ b/ppapi/c/private/ppp_content_decryptor_private.h @@ -4,7 +4,7 @@ */ /* From private/ppp_content_decryptor_private.idl, - * modified Wed Jan 8 16:02:29 2014. + * modified Mon Feb 10 13:23:32 2014. */ #ifndef PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ @@ -18,10 +18,10 @@ #include "ppapi/c/pp_var.h" #include "ppapi/c/private/pp_content_decryptor.h" -#define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_10 \ - "PPP_ContentDecryptor_Private;0.10" +#define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_11 \ + "PPP_ContentDecryptor_Private;0.11" #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ - PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_10 + PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_11 /** * @file @@ -42,7 +42,7 @@ * Decryption Module (CDM) for Encrypted Media Extensions: * http://www.w3.org/TR/encrypted-media/ */ -struct PPP_ContentDecryptor_Private_0_10 { +struct PPP_ContentDecryptor_Private_0_11 { /** * Initialize for the specified key system. * @@ -51,19 +51,18 @@ struct PPP_ContentDecryptor_Private_0_10 { */ void (*Initialize)(PP_Instance instance, struct PP_Var key_system); /** - * Creates a session. <code>type</code> contains the MIME type of + * Creates a session. <code>content_type</code> contains the MIME type of * <code>init_data</code>. <code>init_data</code> is a data buffer * containing data for use in generating the request. * - * Note: <code>CreateSession()</code> must create the session ID used in - * other methods on this interface. The session ID must be provided to the - * browser by the CDM via <code>SessionCreated()</code> on the + * Note: <code>CreateSession()</code> must create a web session ID and provide + * it to the browser via <code>SessionCreated()</code> on the * <code>PPB_ContentDecryptor_Private</code> interface. * * @param[in] session_id A reference for the session for which a session * should be generated. * - * @param[in] type A <code>PP_Var</code> of type + * @param[in] content_type A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the MIME type for init_data. * * @param[in] init_data A <code>PP_Var</code> of type @@ -72,9 +71,26 @@ struct PPP_ContentDecryptor_Private_0_10 { */ void (*CreateSession)(PP_Instance instance, uint32_t session_id, - struct PP_Var type, + struct PP_Var content_type, struct PP_Var init_data); /** + * Loads a session whose web session ID is <code>web_session_id</code>. + * + * Note: After the session is successfully loaded, the CDM must call + * <code>SessionCreated()</code> with <code>web_session_id</code> on the + * <code>PPB_ContentDecryptor_Private</code> interface. + * + * @param[in] session_id A reference for the session for which a session + * should be loaded. + * + * @param[in] web_session_id A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session + * to load. + */ + void (*LoadSession)(PP_Instance instance, + uint32_t session_id, + struct PP_Var web_session_id); + /** * Provides a license or other message to the decryptor. * * When the CDM needs more information, it must call @@ -228,7 +244,7 @@ struct PPP_ContentDecryptor_Private_0_10 { const struct PP_EncryptedBlockInfo* encrypted_block_info); }; -typedef struct PPP_ContentDecryptor_Private_0_10 PPP_ContentDecryptor_Private; +typedef struct PPP_ContentDecryptor_Private_0_11 PPP_ContentDecryptor_Private; /** * @} */ diff --git a/ppapi/cpp/private/content_decryptor_private.cc b/ppapi/cpp/private/content_decryptor_private.cc index 776393a..7cad0a3 100644 --- a/ppapi/cpp/private/content_decryptor_private.cc +++ b/ppapi/cpp/private/content_decryptor_private.cc @@ -60,6 +60,22 @@ void CreateSession(PP_Instance instance, ->CreateSession(session_id, type_var.AsString(), init_data_array_buffer); } +void LoadSession(PP_Instance instance, + uint32_t session_id, + PP_Var web_session_id_arg) { + void* object = + Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); + if (!object) + return; + + pp::Var web_session_id_var(pp::PASS_REF, web_session_id_arg); + if (!web_session_id_var.is_string()) + return; + + static_cast<ContentDecryptor_Private*>(object) + ->LoadSession(session_id, web_session_id_var.AsString()); +} + void UpdateSession(PP_Instance instance, uint32_t session_id, PP_Var response_arg) { @@ -177,6 +193,7 @@ void DecryptAndDecode(PP_Instance instance, const PPP_ContentDecryptor_Private ppp_content_decryptor = { &Initialize, &CreateSession, + &LoadSession, &UpdateSession, &ReleaseSession, &Decrypt, diff --git a/ppapi/cpp/private/content_decryptor_private.h b/ppapi/cpp/private/content_decryptor_private.h index d2c17c1..4ac9f79 100644 --- a/ppapi/cpp/private/content_decryptor_private.h +++ b/ppapi/cpp/private/content_decryptor_private.h @@ -33,8 +33,10 @@ class ContentDecryptor_Private { // replying to the browser. virtual void Initialize(const std::string& key_system) = 0; virtual void CreateSession(uint32_t session_id, - const std::string& type, + const std::string& content_type, pp::VarArrayBuffer init_data) = 0; + virtual void LoadSession(uint32_t session_id, + const std::string& web_session_id) = 0; virtual void UpdateSession(uint32_t session_id, pp::VarArrayBuffer response) = 0; virtual void ReleaseSession(uint32_t session_id) = 0; diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c index 44596c0..6ffae96 100644 --- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c +++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c @@ -237,7 +237,7 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UMA_Private_0_2; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoDestination_Private_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoSource_Private_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_X509Certificate_Private_0_1; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_10; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_11; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Instance_Private_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Ext_Socket_Dev_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Ext_Socket_Dev_0_2; @@ -3902,79 +3902,86 @@ static void Pnacl_M19_PPB_X509Certificate_Private_GetField(struct PP_Var* _struc /* End wrapper methods for PPB_X509Certificate_Private_0_1 */ -/* Begin wrapper methods for PPP_ContentDecryptor_Private_0_10 */ +/* Begin wrapper methods for PPP_ContentDecryptor_Private_0_11 */ static void Pnacl_M34_PPP_ContentDecryptor_Private_Initialize(PP_Instance instance, struct PP_Var key_system) { - const struct PPP_ContentDecryptor_Private_0_10 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_10.real_iface; + const struct PPP_ContentDecryptor_Private_0_11 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_11.real_iface; void (*temp_fp)(PP_Instance instance, struct PP_Var* key_system) = ((void (*)(PP_Instance instance, struct PP_Var* key_system))iface->Initialize); temp_fp(instance, &key_system); } -static void Pnacl_M34_PPP_ContentDecryptor_Private_CreateSession(PP_Instance instance, uint32_t session_id, struct PP_Var type, struct PP_Var init_data) { - const struct PPP_ContentDecryptor_Private_0_10 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_10.real_iface; - void (*temp_fp)(PP_Instance instance, uint32_t session_id, struct PP_Var* type, struct PP_Var* init_data) = - ((void (*)(PP_Instance instance, uint32_t session_id, struct PP_Var* type, struct PP_Var* init_data))iface->CreateSession); - temp_fp(instance, session_id, &type, &init_data); +static void Pnacl_M34_PPP_ContentDecryptor_Private_CreateSession(PP_Instance instance, uint32_t session_id, struct PP_Var content_type, struct PP_Var init_data) { + const struct PPP_ContentDecryptor_Private_0_11 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_11.real_iface; + void (*temp_fp)(PP_Instance instance, uint32_t session_id, struct PP_Var* content_type, struct PP_Var* init_data) = + ((void (*)(PP_Instance instance, uint32_t session_id, struct PP_Var* content_type, struct PP_Var* init_data))iface->CreateSession); + temp_fp(instance, session_id, &content_type, &init_data); +} + +static void Pnacl_M34_PPP_ContentDecryptor_Private_LoadSession(PP_Instance instance, uint32_t session_id, struct PP_Var web_session_id) { + const struct PPP_ContentDecryptor_Private_0_11 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_11.real_iface; + void (*temp_fp)(PP_Instance instance, uint32_t session_id, struct PP_Var* web_session_id) = + ((void (*)(PP_Instance instance, uint32_t session_id, struct PP_Var* web_session_id))iface->LoadSession); + temp_fp(instance, session_id, &web_session_id); } static void Pnacl_M34_PPP_ContentDecryptor_Private_UpdateSession(PP_Instance instance, uint32_t session_id, struct PP_Var response) { - const struct PPP_ContentDecryptor_Private_0_10 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_10.real_iface; + const struct PPP_ContentDecryptor_Private_0_11 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_11.real_iface; void (*temp_fp)(PP_Instance instance, uint32_t session_id, struct PP_Var* response) = ((void (*)(PP_Instance instance, uint32_t session_id, struct PP_Var* response))iface->UpdateSession); temp_fp(instance, session_id, &response); } static void Pnacl_M34_PPP_ContentDecryptor_Private_ReleaseSession(PP_Instance instance, uint32_t session_id) { - const struct PPP_ContentDecryptor_Private_0_10 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_10.real_iface; + const struct PPP_ContentDecryptor_Private_0_11 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_11.real_iface; void (*temp_fp)(PP_Instance instance, uint32_t session_id) = ((void (*)(PP_Instance instance, uint32_t session_id))iface->ReleaseSession); temp_fp(instance, session_id); } static void Pnacl_M34_PPP_ContentDecryptor_Private_Decrypt(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info) { - const struct PPP_ContentDecryptor_Private_0_10 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_10.real_iface; + const struct PPP_ContentDecryptor_Private_0_11 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_11.real_iface; void (*temp_fp)(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info) = ((void (*)(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info))iface->Decrypt); temp_fp(instance, encrypted_block, encrypted_block_info); } static void Pnacl_M34_PPP_ContentDecryptor_Private_InitializeAudioDecoder(PP_Instance instance, const struct PP_AudioDecoderConfig* decoder_config, PP_Resource codec_extra_data) { - const struct PPP_ContentDecryptor_Private_0_10 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_10.real_iface; + const struct PPP_ContentDecryptor_Private_0_11 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_11.real_iface; void (*temp_fp)(PP_Instance instance, const struct PP_AudioDecoderConfig* decoder_config, PP_Resource codec_extra_data) = ((void (*)(PP_Instance instance, const struct PP_AudioDecoderConfig* decoder_config, PP_Resource codec_extra_data))iface->InitializeAudioDecoder); temp_fp(instance, decoder_config, codec_extra_data); } static void Pnacl_M34_PPP_ContentDecryptor_Private_InitializeVideoDecoder(PP_Instance instance, const struct PP_VideoDecoderConfig* decoder_config, PP_Resource codec_extra_data) { - const struct PPP_ContentDecryptor_Private_0_10 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_10.real_iface; + const struct PPP_ContentDecryptor_Private_0_11 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_11.real_iface; void (*temp_fp)(PP_Instance instance, const struct PP_VideoDecoderConfig* decoder_config, PP_Resource codec_extra_data) = ((void (*)(PP_Instance instance, const struct PP_VideoDecoderConfig* decoder_config, PP_Resource codec_extra_data))iface->InitializeVideoDecoder); temp_fp(instance, decoder_config, codec_extra_data); } static void Pnacl_M34_PPP_ContentDecryptor_Private_DeinitializeDecoder(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { - const struct PPP_ContentDecryptor_Private_0_10 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_10.real_iface; + const struct PPP_ContentDecryptor_Private_0_11 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_11.real_iface; void (*temp_fp)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) = ((void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))iface->DeinitializeDecoder); temp_fp(instance, decoder_type, request_id); } static void Pnacl_M34_PPP_ContentDecryptor_Private_ResetDecoder(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { - const struct PPP_ContentDecryptor_Private_0_10 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_10.real_iface; + const struct PPP_ContentDecryptor_Private_0_11 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_11.real_iface; void (*temp_fp)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) = ((void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))iface->ResetDecoder); temp_fp(instance, decoder_type, request_id); } static void Pnacl_M34_PPP_ContentDecryptor_Private_DecryptAndDecode(PP_Instance instance, PP_DecryptorStreamType decoder_type, PP_Resource encrypted_buffer, const struct PP_EncryptedBlockInfo* encrypted_block_info) { - const struct PPP_ContentDecryptor_Private_0_10 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_10.real_iface; + const struct PPP_ContentDecryptor_Private_0_11 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_11.real_iface; void (*temp_fp)(PP_Instance instance, PP_DecryptorStreamType decoder_type, PP_Resource encrypted_buffer, const struct PP_EncryptedBlockInfo* encrypted_block_info) = ((void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, PP_Resource encrypted_buffer, const struct PP_EncryptedBlockInfo* encrypted_block_info))iface->DecryptAndDecode); temp_fp(instance, decoder_type, encrypted_buffer, encrypted_block_info); } -/* End wrapper methods for PPP_ContentDecryptor_Private_0_10 */ +/* End wrapper methods for PPP_ContentDecryptor_Private_0_11 */ /* Not generating wrapper methods for PPP_Flash_BrowserOperations_1_0 */ @@ -5216,9 +5223,10 @@ static struct PPB_X509Certificate_Private_0_1 Pnacl_Wrappers_PPB_X509Certificate .GetField = (struct PP_Var (*)(PP_Resource resource, PP_X509Certificate_Private_Field field))&Pnacl_M19_PPB_X509Certificate_Private_GetField }; -static struct PPP_ContentDecryptor_Private_0_10 Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_10 = { +static struct PPP_ContentDecryptor_Private_0_11 Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_11 = { .Initialize = &Pnacl_M34_PPP_ContentDecryptor_Private_Initialize, .CreateSession = &Pnacl_M34_PPP_ContentDecryptor_Private_CreateSession, + .LoadSession = &Pnacl_M34_PPP_ContentDecryptor_Private_LoadSession, .UpdateSession = &Pnacl_M34_PPP_ContentDecryptor_Private_UpdateSession, .ReleaseSession = &Pnacl_M34_PPP_ContentDecryptor_Private_ReleaseSession, .Decrypt = &Pnacl_M34_PPP_ContentDecryptor_Private_Decrypt, @@ -5874,9 +5882,9 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_X509Certificate_Private_0 .real_iface = NULL }; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_10 = { - .iface_macro = PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_10, - .wrapped_iface = (void *) &Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_10, +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_11 = { + .iface_macro = PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_11, + .wrapped_iface = (void *) &Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_11, .real_iface = NULL }; @@ -6004,7 +6012,7 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = { static struct __PnaclWrapperInfo *s_ppp_wrappers[] = { &Pnacl_WrapperInfo_PPP_Messaging_1_0, &Pnacl_WrapperInfo_PPP_Selection_Dev_0_3, - &Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_10, + &Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_11, &Pnacl_WrapperInfo_PPP_Instance_Private_0_1, NULL }; diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index d750f9c..629347b 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -661,8 +661,12 @@ IPC_MESSAGE_ROUTED2(PpapiMsg_PPPContentDecryptor_Initialize, IPC_MESSAGE_ROUTED4(PpapiMsg_PPPContentDecryptor_CreateSession, PP_Instance /* instance */, uint32_t /* session_id */, - ppapi::proxy::SerializedVar /* type, String */, + ppapi::proxy::SerializedVar /* content_type, String */, ppapi::proxy::SerializedVar /* init_data, ArrayBuffer */) +IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_LoadSession, + PP_Instance /* instance */, + uint32_t /* session_id */, + ppapi::proxy::SerializedVar /* web_session_id, String */) IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_UpdateSession, PP_Instance /* instance */, uint32_t /* session_id */, diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc index 167e476..da02097 100644 --- a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc +++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc @@ -142,6 +142,22 @@ void CreateSession(PP_Instance instance, SerializedVarSendInput(dispatcher, init_data))); } +void LoadSession(PP_Instance instance, + uint32_t session_id, + PP_Var web_session_id) { + HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); + if (!dispatcher) { + NOTREACHED(); + return; + } + + dispatcher->Send(new PpapiMsg_PPPContentDecryptor_LoadSession( + API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, + instance, + session_id, + SerializedVarSendInput(dispatcher, web_session_id))); +} + void UpdateSession(PP_Instance instance, uint32_t session_id, PP_Var response) { HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); if (!dispatcher) { @@ -357,6 +373,7 @@ void DecryptAndDecode(PP_Instance instance, static const PPP_ContentDecryptor_Private content_decryptor_interface = { &Initialize, &CreateSession, + &LoadSession, &UpdateSession, &ReleaseSession, &Decrypt, @@ -401,6 +418,8 @@ bool PPP_ContentDecryptor_Private_Proxy::OnMessageReceived( OnMsgInitialize) IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_CreateSession, OnMsgCreateSession) + IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_LoadSession, + OnMsgLoadSession) IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_UpdateSession, OnMsgUpdateSession) IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_ReleaseSession, @@ -448,6 +467,19 @@ void PPP_ContentDecryptor_Private_Proxy::OnMsgCreateSession( } } +void PPP_ContentDecryptor_Private_Proxy::OnMsgLoadSession( + PP_Instance instance, + uint32_t session_id, + SerializedVarReceiveInput web_session_id) { + if (ppp_decryptor_impl_) { + CallWhileUnlocked( + ppp_decryptor_impl_->LoadSession, + instance, + session_id, + ExtractReceivedVarAndAddRef(dispatcher(), &web_session_id)); + } +} + void PPP_ContentDecryptor_Private_Proxy::OnMsgUpdateSession( PP_Instance instance, uint32_t session_id, diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.h b/ppapi/proxy/ppp_content_decryptor_private_proxy.h index dfbcf4f..2ed2484 100644 --- a/ppapi/proxy/ppp_content_decryptor_private_proxy.h +++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.h @@ -34,8 +34,11 @@ class PPP_ContentDecryptor_Private_Proxy : public InterfaceProxy { SerializedVarReceiveInput key_system); void OnMsgCreateSession(PP_Instance instance, uint32_t session_id, - SerializedVarReceiveInput type, + SerializedVarReceiveInput content_type, SerializedVarReceiveInput init_data); + void OnMsgLoadSession(PP_Instance instance, + uint32_t session_id, + SerializedVarReceiveInput web_session_id); void OnMsgUpdateSession(PP_Instance instance, uint32_t session_id, SerializedVarReceiveInput response); |