diff options
36 files changed, 593 insertions, 189 deletions
diff --git a/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.cc b/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.cc index e59a0919..83434df 100644 --- a/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.cc +++ b/chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.cc @@ -9,7 +9,7 @@ #include "chrome/browser/renderer_host/pepper/pepper_extensions_common_message_filter.h" #include "chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h" #include "chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.h" -#include "chrome/browser/renderer_host/pepper/pepper_flash_device_id_host.h" +#include "chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h" #include "chrome/browser/renderer_host/pepper/pepper_talk_host.h" #include "content/public/browser/browser_ppapi_host.h" #include "ppapi/host/message_filter_host.h" @@ -98,8 +98,8 @@ scoped_ptr<ResourceHost> ChromeBrowserPepperHostFactory::CreateResourceHost( host_->GetPpapiHost(), instance, params.pp_resource(), clipboard_filter)); } - case PpapiHostMsg_FlashDeviceID_Create::ID: - return scoped_ptr<ResourceHost>(new PepperFlashDeviceIDHost( + case PpapiHostMsg_FlashDRM_Create::ID: + return scoped_ptr<ResourceHost>(new PepperFlashDRMHost( host_, instance, params.pp_resource())); } } diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc new file mode 100644 index 0000000..efc493d --- /dev/null +++ b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc @@ -0,0 +1,63 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h" + +#include "base/bind.h" +#include "base/compiler_specific.h" +#include "base/logging.h" +#include "content/public/browser/browser_ppapi_host.h" +#include "ppapi/c/pp_errors.h" +#include "ppapi/host/dispatch_host_message.h" +#include "ppapi/host/host_message_context.h" +#include "ppapi/host/ppapi_host.h" +#include "ppapi/proxy/ppapi_messages.h" + +using content::BrowserPpapiHost; + +namespace chrome { + +PepperFlashDRMHost::PepperFlashDRMHost(BrowserPpapiHost* host, + PP_Instance instance, + PP_Resource resource) + : ppapi::host::ResourceHost(host->GetPpapiHost(), instance, resource), + weak_factory_(this){ + int render_process_id, unused; + host->GetRenderViewIDsForInstance(instance, &render_process_id, &unused); + fetcher_ = new DeviceIDFetcher(render_process_id); +} + +PepperFlashDRMHost::~PepperFlashDRMHost() { +} + +int32_t PepperFlashDRMHost::OnResourceMessageReceived( + const IPC::Message& msg, + ppapi::host::HostMessageContext* context) { + IPC_BEGIN_MESSAGE_MAP(PepperFlashDRMHost, msg) + PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_FlashDRM_GetDeviceID, + OnHostMsgGetDeviceID) + IPC_END_MESSAGE_MAP() + return PP_ERROR_FAILED; +} + +int32_t PepperFlashDRMHost::OnHostMsgGetDeviceID( + ppapi::host::HostMessageContext* context) { + if (!fetcher_->Start(base::Bind(&PepperFlashDRMHost::GotDeviceID, + weak_factory_.GetWeakPtr(), + context->MakeReplyMessageContext()))) { + return PP_ERROR_INPROGRESS; + } + return PP_OK_COMPLETIONPENDING; +} + +void PepperFlashDRMHost::GotDeviceID( + ppapi::host::ReplyMessageContext reply_context, + const std::string& id) { + reply_context.params.set_result( + id.empty() ? PP_ERROR_FAILED : PP_OK); + host()->SendReply(reply_context, + PpapiPluginMsg_FlashDRM_GetDeviceIDReply(id)); +} + +} // namespace chrome diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h new file mode 100644 index 0000000..e461e90 --- /dev/null +++ b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.h @@ -0,0 +1,55 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DRM_HOST_H_ +#define CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DRM_HOST_H_ + +#include <string> + +#include "base/memory/weak_ptr.h" +#include "chrome/browser/renderer_host/pepper/device_id_fetcher.h" +#include "ppapi/host/host_message_context.h" +#include "ppapi/host/resource_host.h" + +namespace content { +class BrowserPpapiHost; +} + +namespace IPC { +class Message; +} + +namespace chrome { + +class PepperFlashDRMHost : public ppapi::host::ResourceHost { + public: + PepperFlashDRMHost(content::BrowserPpapiHost* host, + PP_Instance instance, + PP_Resource resource); + virtual ~PepperFlashDRMHost(); + + // ResourceHost override. + virtual int32_t OnResourceMessageReceived( + const IPC::Message& msg, + ppapi::host::HostMessageContext* context) OVERRIDE; + + private: + // IPC message handler. + int32_t OnHostMsgGetDeviceID(ppapi::host::HostMessageContext* context); + + // Called by the fetcher when the device ID was retrieved, or the empty string + // on error. + void GotDeviceID(ppapi::host::ReplyMessageContext reply_context, + const std::string& id); + + scoped_refptr<DeviceIDFetcher> fetcher_; + + base::WeakPtrFactory<PepperFlashDRMHost> weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(PepperFlashDRMHost); +}; + +} // namespace chrome + +#endif // CHROME_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_DRM_HOST_H_ diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index d7eca8b..4c5d927 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -1660,8 +1660,8 @@ 'browser/renderer_host/pepper/pepper_flash_browser_host.h', 'browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc', 'browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.h', - 'browser/renderer_host/pepper/pepper_flash_device_id_host.cc', - 'browser/renderer_host/pepper/pepper_flash_device_id_host.h', + 'browser/renderer_host/pepper/pepper_flash_drm_host.cc', + 'browser/renderer_host/pepper/pepper_flash_drm_host.h', 'browser/renderer_host/pepper/pepper_talk_host.cc', 'browser/renderer_host/pepper/pepper_talk_host.h', 'browser/renderer_host/safe_browsing_resource_throttle.cc', diff --git a/chrome/test/ppapi/ppapi_browsertest.cc b/chrome/test/ppapi/ppapi_browsertest.cc index adb48d0..0c25ba1 100644 --- a/chrome/test/ppapi/ppapi_browsertest.cc +++ b/chrome/test/ppapi/ppapi_browsertest.cc @@ -1318,7 +1318,7 @@ TEST_PPAPI_OUT_OF_PROCESS(MAYBE_FlashFullscreen) TEST_PPAPI_OUT_OF_PROCESS(PDF) // Only implemented on Windows and ChromeOS currently. #if (defined(OS_WIN) && defined(ENABLE_RLZ)) || defined(OS_CHROMEOS) -TEST_PPAPI_OUT_OF_PROCESS(FlashDeviceID) +TEST_PPAPI_OUT_OF_PROCESS(FlashDRM) #endif TEST_PPAPI_IN_PROCESS(TalkPrivate) diff --git a/ppapi/api/private/ppb_flash_device_id.idl b/ppapi/api/private/ppb_flash_device_id.idl index 1fa4986..16b0d3d 100644 --- a/ppapi/api/private/ppb_flash_device_id.idl +++ b/ppapi/api/private/ppb_flash_device_id.idl @@ -7,12 +7,13 @@ * This file contains the <code>PPB_Flash_DeviceID</code> interface. */ -[generate_thunk] - label Chrome { - M21 = 1.0 + M21 = 1.0, + M29 = 1.1 }; +// TODO(raymes): This is deprecated by the PPB_Flash_DRM interface. Remove this +// interface after a few versions of Chrome have passed. interface PPB_Flash_DeviceID { PP_Resource Create([in] PP_Instance instance); @@ -21,6 +22,7 @@ interface PPB_Flash_DeviceID { * string in |*id| and will call the completion callback. On failure the * given var will be PP_VARTYPE_UNDEFINED. */ + [version=1.0, deprecate=1.1] int32_t GetDeviceID([in] PP_Resource device_id, [out] PP_Var id, [in] PP_CompletionCallback callback); diff --git a/ppapi/api/private/ppb_flash_drm.idl b/ppapi/api/private/ppb_flash_drm.idl new file mode 100644 index 0000000..8438114 --- /dev/null +++ b/ppapi/api/private/ppb_flash_drm.idl @@ -0,0 +1,35 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file contains the <code>PPB_Flash_DRM</code> interface. + */ + +[generate_thunk] + +label Chrome { + M29 = 1.0 +}; + +/** + * A resource for performing Flash DRM-related operations. + */ +interface PPB_Flash_DRM { + /** + * Creates a PPB_Flash_DRM resource for performing DRM-related operations in + * Flash. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Asynchronously computes the device ID. When available, it will place the + * string in |*id| and will call the completion callback. On failure the + * given var will be PP_VARTYPE_UNDEFINED. + */ + int32_t GetDeviceID([in] PP_Resource drm, + [out] PP_Var id, + [in] PP_CompletionCallback callback); +}; + diff --git a/ppapi/c/private/ppb_flash_device_id.h b/ppapi/c/private/ppb_flash_device_id.h index 33d1ba7..17660fb 100644 --- a/ppapi/c/private/ppb_flash_device_id.h +++ b/ppapi/c/private/ppb_flash_device_id.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From private/ppb_flash_device_id.idl modified Fri Jun 1 15:21:17 2012. */ +/* From private/ppb_flash_device_id.idl modified Tue May 14 10:55:27 2013. */ #ifndef PPAPI_C_PRIVATE_PPB_FLASH_DEVICE_ID_H_ #define PPAPI_C_PRIVATE_PPB_FLASH_DEVICE_ID_H_ @@ -29,6 +29,8 @@ * @addtogroup Interfaces * @{ */ +/* TODO(raymes): This is deprecated by the PPB_Flash_DRM interface. Remove this + * interface after a few versions of Chrome have passed. */ struct PPB_Flash_DeviceID_1_0 { PP_Resource (*Create)(PP_Instance instance); /** diff --git a/ppapi/c/private/ppb_flash_drm.h b/ppapi/c/private/ppb_flash_drm.h new file mode 100644 index 0000000..ed41593b --- /dev/null +++ b/ppapi/c/private/ppb_flash_drm.h @@ -0,0 +1,57 @@ +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* From private/ppb_flash_drm.idl modified Tue May 21 09:34:07 2013. */ + +#ifndef PPAPI_C_PRIVATE_PPB_FLASH_DRM_H_ +#define PPAPI_C_PRIVATE_PPB_FLASH_DRM_H_ + +#include "ppapi/c/pp_bool.h" +#include "ppapi/c/pp_completion_callback.h" +#include "ppapi/c/pp_instance.h" +#include "ppapi/c/pp_macros.h" +#include "ppapi/c/pp_resource.h" +#include "ppapi/c/pp_stdint.h" +#include "ppapi/c/pp_var.h" + +#define PPB_FLASH_DRM_INTERFACE_1_0 "PPB_Flash_DRM;1.0" +#define PPB_FLASH_DRM_INTERFACE PPB_FLASH_DRM_INTERFACE_1_0 + +/** + * @file + * This file contains the <code>PPB_Flash_DRM</code> interface. + */ + + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * A resource for performing Flash DRM-related operations. + */ +struct PPB_Flash_DRM_1_0 { + /** + * Creates a PPB_Flash_DRM resource for performing DRM-related operations in + * Flash. + */ + PP_Resource (*Create)(PP_Instance instance); + /** + * Asynchronously computes the device ID. When available, it will place the + * string in |*id| and will call the completion callback. On failure the + * given var will be PP_VARTYPE_UNDEFINED. + */ + int32_t (*GetDeviceID)(PP_Resource drm, + struct PP_Var* id, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_Flash_DRM_1_0 PPB_Flash_DRM; +/** + * @} + */ + +#endif /* PPAPI_C_PRIVATE_PPB_FLASH_DRM_H_ */ + diff --git a/ppapi/cpp/private/flash_drm.cc b/ppapi/cpp/private/flash_drm.cc new file mode 100644 index 0000000..7307445 --- /dev/null +++ b/ppapi/cpp/private/flash_drm.cc @@ -0,0 +1,58 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ppapi/cpp/private/flash_drm.h" + +#include "ppapi/c/pp_errors.h" +#include "ppapi/c/private/ppb_flash_device_id.h" +#include "ppapi/c/private/ppb_flash_drm.h" +#include "ppapi/cpp/module_impl.h" + +namespace pp { + +namespace { + +template <> const char* interface_name<PPB_Flash_DRM_1_0>() { + return PPB_FLASH_DRM_INTERFACE_1_0; +} + +template <> const char* interface_name<PPB_Flash_DeviceID_1_0>() { + return PPB_FLASH_DEVICEID_INTERFACE_1_0; +} + +} // namespace + +namespace flash { + +DRM::DRM() { +} + +DRM::DRM(const InstanceHandle& instance) : Resource() { + if (has_interface<PPB_Flash_DRM_1_0>()) { + PassRefFromConstructor(get_interface<PPB_Flash_DRM_1_0>()->Create( + instance.pp_instance())); + } else if (has_interface<PPB_Flash_DeviceID_1_0>()) { + PassRefFromConstructor(get_interface<PPB_Flash_DeviceID_1_0>()->Create( + instance.pp_instance())); + } +} + +int32_t DRM::GetDeviceID(const CompletionCallbackWithOutput<Var>& callback) { + if (has_interface<PPB_Flash_DRM_1_0>()) { + return get_interface<PPB_Flash_DRM_1_0>()->GetDeviceID( + pp_resource(), + callback.output(), + callback.pp_completion_callback()); + } + if (has_interface<PPB_Flash_DeviceID_1_0>()) { + return get_interface<PPB_Flash_DeviceID_1_0>()->GetDeviceID( + pp_resource(), + callback.output(), + callback.pp_completion_callback()); + } + return callback.MayForce(PP_ERROR_NOINTERFACE); +} + +} // namespace flash +} // namespace pp diff --git a/ppapi/cpp/private/flash_drm.h b/ppapi/cpp/private/flash_drm.h new file mode 100644 index 0000000..49e37c2 --- /dev/null +++ b/ppapi/cpp/private/flash_drm.h @@ -0,0 +1,26 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef PPAPI_CPP_PRIVATE_FLASH_DRM_H_ +#define PPAPI_CPP_PRIVATE_FLASH_DRM_H_ + +#include "ppapi/cpp/completion_callback.h" +#include "ppapi/cpp/resource.h" + +namespace pp { +namespace flash { + +class DRM : public Resource { + public: + DRM(); + explicit DRM(const InstanceHandle& instance); + + // On success, returns a string var. + int32_t GetDeviceID(const CompletionCallbackWithOutput<Var>& callback); +}; + +} // namespace flash +} // namespace pp + +#endif // PPAPI_CPP_PRIVATE_FLASH_DRM_H_ 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 bd3b848..cc3644c 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 @@ -83,6 +83,7 @@ #include "ppapi/c/private/ppb_flash.h" #include "ppapi/c/private/ppb_flash_clipboard.h" #include "ppapi/c/private/ppb_flash_device_id.h" +#include "ppapi/c/private/ppb_flash_drm.h" #include "ppapi/c/private/ppb_flash_font_file.h" #include "ppapi/c/private/ppb_flash_fullscreen.h" #include "ppapi/c/private/ppb_flash_menu.h" @@ -245,6 +246,7 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_13_0; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_Clipboard_4_0; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_Clipboard_5_0; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_DeviceID_1_0; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_DRM_1_0; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_FontFile_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FlashFullscreen_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FlashFullscreen_1_0; @@ -2685,6 +2687,20 @@ static int32_t Pnacl_M21_PPB_Flash_DeviceID_GetDeviceID(PP_Resource device_id, s /* End wrapper methods for PPB_Flash_DeviceID_1_0 */ +/* Begin wrapper methods for PPB_Flash_DRM_1_0 */ + +static PP_Resource Pnacl_M29_PPB_Flash_DRM_Create(PP_Instance instance) { + const struct PPB_Flash_DRM_1_0 *iface = Pnacl_WrapperInfo_PPB_Flash_DRM_1_0.real_iface; + return iface->Create(instance); +} + +static int32_t Pnacl_M29_PPB_Flash_DRM_GetDeviceID(PP_Resource drm, struct PP_Var* id, struct PP_CompletionCallback* callback) { + const struct PPB_Flash_DRM_1_0 *iface = Pnacl_WrapperInfo_PPB_Flash_DRM_1_0.real_iface; + return iface->GetDeviceID(drm, id, *callback); +} + +/* End wrapper methods for PPB_Flash_DRM_1_0 */ + /* Not generating wrapper methods for PPB_Flash_FontFile_0_1 */ /* Not generating wrapper methods for PPB_FlashFullscreen_0_1 */ @@ -4459,6 +4475,11 @@ struct PPB_Flash_DeviceID_1_0 Pnacl_Wrappers_PPB_Flash_DeviceID_1_0 = { .GetDeviceID = (int32_t (*)(PP_Resource device_id, struct PP_Var* id, struct PP_CompletionCallback callback))&Pnacl_M21_PPB_Flash_DeviceID_GetDeviceID }; +struct PPB_Flash_DRM_1_0 Pnacl_Wrappers_PPB_Flash_DRM_1_0 = { + .Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M29_PPB_Flash_DRM_Create, + .GetDeviceID = (int32_t (*)(PP_Resource drm, struct PP_Var* id, struct PP_CompletionCallback callback))&Pnacl_M29_PPB_Flash_DRM_GetDeviceID +}; + /* Not generating wrapper interface for PPB_Flash_FontFile_0_1 */ /* Not generating wrapper interface for PPB_FlashFullscreen_0_1 */ @@ -5428,6 +5449,12 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_DeviceID_1_0 = { .real_iface = NULL }; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_DRM_1_0 = { + .iface_macro = PPB_FLASH_DRM_INTERFACE_1_0, + .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_Flash_DRM_1_0, + .real_iface = NULL +}; + static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_FontFile_0_1 = { .iface_macro = PPB_FLASH_FONTFILE_INTERFACE_0_1, .wrapped_iface = NULL /* Still need slot for real_iface */, @@ -5747,6 +5774,7 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = { &Pnacl_WrapperInfo_PPB_Flash_Clipboard_4_0, &Pnacl_WrapperInfo_PPB_Flash_Clipboard_5_0, &Pnacl_WrapperInfo_PPB_Flash_DeviceID_1_0, + &Pnacl_WrapperInfo_PPB_Flash_DRM_1_0, &Pnacl_WrapperInfo_PPB_Flash_FontFile_0_1, &Pnacl_WrapperInfo_PPB_FlashFullscreen_0_1, &Pnacl_WrapperInfo_PPB_FlashFullscreen_1_0, diff --git a/ppapi/ppapi_proxy.gypi b/ppapi/ppapi_proxy.gypi index 82e3c5a5..f426cbe 100644 --- a/ppapi/ppapi_proxy.gypi +++ b/ppapi/ppapi_proxy.gypi @@ -43,8 +43,8 @@ 'proxy/file_chooser_resource.h', 'proxy/flash_clipboard_resource.cc', 'proxy/flash_clipboard_resource.h', - 'proxy/flash_device_id_resource.cc', - 'proxy/flash_device_id_resource.h', + 'proxy/flash_drm_resource.cc', + 'proxy/flash_drm_resource.h', 'proxy/flash_file_resource.cc', 'proxy/flash_file_resource.h', 'proxy/flash_font_file_resource.cc', @@ -205,7 +205,7 @@ 'proxy/browser_font_singleton_resource.cc', 'proxy/device_enumeration_resource_helper.cc', 'proxy/flash_clipboard_resource.cc', - 'proxy/flash_device_id_resource.cc', + 'proxy/flash_drm_resource.cc', 'proxy/flash_file_resource.cc', 'proxy/flash_font_file_resource.cc', 'proxy/flash_fullscreen_resource.cc', diff --git a/ppapi/ppapi_shared.gypi b/ppapi/ppapi_shared.gypi index c66582f..5f6ad46 100644 --- a/ppapi/ppapi_shared.gypi +++ b/ppapi/ppapi_shared.gypi @@ -165,8 +165,9 @@ 'thunk/ppb_find_dev_thunk.cc', 'thunk/ppb_flash_clipboard_api.h', 'thunk/ppb_flash_clipboard_thunk.cc', - 'thunk/ppb_flash_device_id_api.h', 'thunk/ppb_flash_device_id_thunk.cc', + 'thunk/ppb_flash_drm_api.h', + 'thunk/ppb_flash_drm_thunk.cc', 'thunk/ppb_flash_file_fileref_thunk.cc', 'thunk/ppb_flash_file_modulelocal_thunk.cc', 'thunk/ppb_flash_font_file_api.h', @@ -285,6 +286,7 @@ 'thunk/ppb_file_io_trusted_thunk.cc', 'thunk/ppb_flash_clipboard_thunk.cc', 'thunk/ppb_flash_device_id_thunk.cc', + 'thunk/ppb_flash_drm_thunk.cc', 'thunk/ppb_flash_file_fileref_thunk.cc', 'thunk/ppb_flash_file_modulelocal_thunk.cc', 'thunk/ppb_flash_font_file_thunk.cc', diff --git a/ppapi/ppapi_sources.gypi b/ppapi/ppapi_sources.gypi index 7ea5549..950b628 100644 --- a/ppapi/ppapi_sources.gypi +++ b/ppapi/ppapi_sources.gypi @@ -285,6 +285,8 @@ 'cpp/private/flash_clipboard.h', 'cpp/private/flash_device_id.cc', 'cpp/private/flash_device_id.h', + 'cpp/private/flash_drm.cc', + 'cpp/private/flash_drm.h', 'cpp/private/flash_file.cc', 'cpp/private/flash_file.h', 'cpp/private/flash_font_file.cc', @@ -497,8 +499,8 @@ 'tests/test_flash.h', 'tests/test_flash_clipboard.cc', 'tests/test_flash_clipboard.h', - 'tests/test_flash_device_id.cc', - 'tests/test_flash_device_id.h', + 'tests/test_flash_drm.cc', + 'tests/test_flash_drm.h', 'tests/test_flash_file.cc', 'tests/test_flash_file.h', 'tests/test_flash_fullscreen.cc', diff --git a/ppapi/proxy/flash_device_id_resource.cc b/ppapi/proxy/flash_device_id_resource.cc deleted file mode 100644 index 493ebda..0000000 --- a/ppapi/proxy/flash_device_id_resource.cc +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/proxy/flash_device_id_resource.h" - -#include "base/bind.h" -#include "ppapi/c/pp_errors.h" -#include "ppapi/proxy/dispatch_reply_message.h" -#include "ppapi/proxy/ppapi_messages.h" -#include "ppapi/shared_impl/var.h" - -namespace ppapi { -namespace proxy { - -FlashDeviceIDResource::FlashDeviceIDResource(Connection connection, - PP_Instance instance) - : PluginResource(connection, instance), - dest_(NULL) { - SendCreate(BROWSER, PpapiHostMsg_FlashDeviceID_Create()); -} - -FlashDeviceIDResource::~FlashDeviceIDResource() { -} - -thunk::PPB_Flash_DeviceID_API* -FlashDeviceIDResource::AsPPB_Flash_DeviceID_API() { - return this; -} - -int32_t FlashDeviceIDResource::GetDeviceID( - PP_Var* id, - scoped_refptr<TrackedCallback> callback) { - if (TrackedCallback::IsPending(callback_)) - return PP_ERROR_INPROGRESS; - if (!id) - return PP_ERROR_BADARGUMENT; - - dest_ = id; - callback_ = callback; - - Call<PpapiPluginMsg_FlashDeviceID_GetDeviceIDReply>( - BROWSER, - PpapiHostMsg_FlashDeviceID_GetDeviceID(), - base::Bind(&FlashDeviceIDResource::OnPluginMsgGetDeviceIDReply, this)); - return PP_OK_COMPLETIONPENDING; -} - -void FlashDeviceIDResource::OnPluginMsgGetDeviceIDReply( - const ResourceMessageReplyParams& params, - const std::string& id) { - if (params.result() == PP_OK) - *dest_ = StringVar::StringToPPVar(id); - else - *dest_ = PP_MakeUndefined(); - dest_ = NULL; - callback_->Run(params.result()); -} - -} // namespace proxy -} // namespace ppapi diff --git a/ppapi/proxy/flash_device_id_resource.h b/ppapi/proxy/flash_device_id_resource.h deleted file mode 100644 index 19c9e63..0000000 --- a/ppapi/proxy/flash_device_id_resource.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_PROXY_FLASH_DEVICE_ID_RESOURCE_H_ -#define PPAPI_PROXY_FLASH_DEVICE_ID_RESOURCE_H_ - -#include "ppapi/proxy/plugin_resource.h" -#include "ppapi/proxy/ppapi_proxy_export.h" -#include "ppapi/shared_impl/tracked_callback.h" -#include "ppapi/thunk/ppb_flash_device_id_api.h" - -namespace ppapi { -namespace proxy { - -class FlashDeviceIDResource - : public PluginResource, - public thunk::PPB_Flash_DeviceID_API { - public: - FlashDeviceIDResource(Connection connection, - PP_Instance instance); - virtual ~FlashDeviceIDResource(); - - // Resource override. - virtual thunk::PPB_Flash_DeviceID_API* AsPPB_Flash_DeviceID_API() OVERRIDE; - - // PPB_Flash_DeviceID_API implementation. - virtual int32_t GetDeviceID(PP_Var* id, - scoped_refptr<TrackedCallback> callback) OVERRIDE; - - private: - // IPC message handler. - void OnPluginMsgGetDeviceIDReply(const ResourceMessageReplyParams& params, - const std::string& id); - - // Non-null when a callback is pending. - PP_Var* dest_; - - scoped_refptr<TrackedCallback> callback_; - - DISALLOW_COPY_AND_ASSIGN(FlashDeviceIDResource); -}; - -} // namespace proxy -} // namespace ppapi - -#endif // PPAPI_PROXY_FLASH_DEVICE_ID_RESOURCE_H_ diff --git a/ppapi/proxy/flash_drm_resource.cc b/ppapi/proxy/flash_drm_resource.cc new file mode 100644 index 0000000..c066b65 --- /dev/null +++ b/ppapi/proxy/flash_drm_resource.cc @@ -0,0 +1,57 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ppapi/proxy/flash_drm_resource.h" + +#include "base/bind.h" +#include "ppapi/c/pp_errors.h" +#include "ppapi/proxy/dispatch_reply_message.h" +#include "ppapi/proxy/ppapi_messages.h" +#include "ppapi/shared_impl/var.h" + +namespace ppapi { +namespace proxy { + +FlashDRMResource::FlashDRMResource(Connection connection, + PP_Instance instance) + : PluginResource(connection, instance) { + SendCreate(BROWSER, PpapiHostMsg_FlashDRM_Create()); +} + +FlashDRMResource::~FlashDRMResource() { +} + +thunk::PPB_Flash_DRM_API* FlashDRMResource::AsPPB_Flash_DRM_API() { + return this; +} + +int32_t FlashDRMResource::GetDeviceID(PP_Var* id, + scoped_refptr<TrackedCallback> callback) { + if (!id) + return PP_ERROR_BADARGUMENT; + + *id = PP_MakeUndefined(); + + Call<PpapiPluginMsg_FlashDRM_GetDeviceIDReply>( + BROWSER, + PpapiHostMsg_FlashDRM_GetDeviceID(), + base::Bind(&FlashDRMResource::OnPluginMsgGetDeviceIDReply, this, + id, callback)); + return PP_OK_COMPLETIONPENDING; +} + +void FlashDRMResource::OnPluginMsgGetDeviceIDReply( + PP_Var* dest, + scoped_refptr<TrackedCallback> callback, + const ResourceMessageReplyParams& params, + const std::string& id) { + if (TrackedCallback::IsPending(callback)) { + if (params.result() == PP_OK) + *dest = StringVar::StringToPPVar(id); + callback->Run(params.result()); + } +} + +} // namespace proxy +} // namespace ppapi diff --git a/ppapi/proxy/flash_drm_resource.h b/ppapi/proxy/flash_drm_resource.h new file mode 100644 index 0000000..d85db0c --- /dev/null +++ b/ppapi/proxy/flash_drm_resource.h @@ -0,0 +1,43 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef PPAPI_PROXY_FLASH_DRM_RESOURCE_H_ +#define PPAPI_PROXY_FLASH_DRM_RESOURCE_H_ + +#include "ppapi/proxy/plugin_resource.h" +#include "ppapi/proxy/ppapi_proxy_export.h" +#include "ppapi/shared_impl/tracked_callback.h" +#include "ppapi/thunk/ppb_flash_drm_api.h" + +namespace ppapi { +namespace proxy { + +class FlashDRMResource + : public PluginResource, + public thunk::PPB_Flash_DRM_API { + public: + FlashDRMResource(Connection connection, + PP_Instance instance); + virtual ~FlashDRMResource(); + + // Resource override. + virtual thunk::PPB_Flash_DRM_API* AsPPB_Flash_DRM_API() OVERRIDE; + + // PPB_Flash_DRM_API implementation. + virtual int32_t GetDeviceID(PP_Var* id, + scoped_refptr<TrackedCallback> callback) OVERRIDE; + + private: + void OnPluginMsgGetDeviceIDReply(PP_Var* dest, + scoped_refptr<TrackedCallback> callback, + const ResourceMessageReplyParams& params, + const std::string& id); + + DISALLOW_COPY_AND_ASSIGN(FlashDRMResource); +}; + +} // namespace proxy +} // namespace ppapi + +#endif // PPAPI_PROXY_FLASH_DRM_RESOURCE_H_ diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc index 963daf3..e97359e 100644 --- a/ppapi/proxy/interface_list.cc +++ b/ppapi/proxy/interface_list.cc @@ -67,6 +67,7 @@ #include "ppapi/c/private/ppb_flash_fullscreen.h" #include "ppapi/c/private/ppb_flash.h" #include "ppapi/c/private/ppb_flash_device_id.h" +#include "ppapi/c/private/ppb_flash_drm.h" #include "ppapi/c/private/ppb_flash_menu.h" #include "ppapi/c/private/ppb_flash_message_loop.h" #include "ppapi/c/private/ppb_flash_print.h" diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index 48a10fd..14312dc 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -45,6 +45,7 @@ #include "ppapi/c/private/ppb_tcp_socket_private.h" #include "ppapi/c/private/ppb_udp_socket_private.h" #include "ppapi/c/private/ppp_flash_browser_operations.h" +#include "ppapi/c/private/ppb_flash_drm.h" #include "ppapi/proxy/host_resolver_private_resource.h" #include "ppapi/proxy/ppapi_param_traits.h" #include "ppapi/proxy/ppapi_proxy_export.h" @@ -1385,10 +1386,13 @@ IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileSystem_OpenReply) IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileSystem_InitIsolatedFileSystem, std::string /* fsid */) -// Flash device ID. -IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashDeviceID_Create) -IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashDeviceID_GetDeviceID) -IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FlashDeviceID_GetDeviceIDReply, +// Flash DRM ------------------------------------------------------------------ +IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashDRM_Create) + +// Requests the device ID. +IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashDRM_GetDeviceID) +// Reply for GetDeviceID which includes the device ID as a string. +IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FlashDRM_GetDeviceIDReply, std::string /* id */) // Gamepad. diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc index 50c7d6f..b15f23d 100644 --- a/ppapi/proxy/resource_creation_proxy.cc +++ b/ppapi/proxy/resource_creation_proxy.cc @@ -14,7 +14,7 @@ #include "ppapi/proxy/file_chooser_resource.h" #include "ppapi/proxy/file_io_resource.h" #include "ppapi/proxy/file_system_resource.h" -#include "ppapi/proxy/flash_device_id_resource.h" +#include "ppapi/proxy/flash_drm_resource.h" #include "ppapi/proxy/flash_font_file_resource.h" #include "ppapi/proxy/flash_menu_resource.h" #include "ppapi/proxy/graphics_2d_resource.h" @@ -346,8 +346,8 @@ PP_Resource ResourceCreationProxy::CreateBuffer(PP_Instance instance, return PPB_Buffer_Proxy::CreateProxyResource(instance, size); } -PP_Resource ResourceCreationProxy::CreateFlashDeviceID(PP_Instance instance) { - return (new FlashDeviceIDResource(GetConnection(), instance))->GetReference(); +PP_Resource ResourceCreationProxy::CreateFlashDRM(PP_Instance instance) { + return (new FlashDRMResource(GetConnection(), instance))->GetReference(); } PP_Resource ResourceCreationProxy::CreateFlashFontFile( diff --git a/ppapi/proxy/resource_creation_proxy.h b/ppapi/proxy/resource_creation_proxy.h index 74a0888..2d23f55 100644 --- a/ppapi/proxy/resource_creation_proxy.h +++ b/ppapi/proxy/resource_creation_proxy.h @@ -149,7 +149,7 @@ class ResourceCreationProxy : public InterfaceProxy, const PP_BrowserFont_Trusted_Description* description) OVERRIDE; virtual PP_Resource CreateBuffer(PP_Instance instance, uint32_t size) OVERRIDE; - virtual PP_Resource CreateFlashDeviceID(PP_Instance instance) OVERRIDE; + virtual PP_Resource CreateFlashDRM(PP_Instance instance) OVERRIDE; virtual PP_Resource CreateFlashFontFile( PP_Instance instance, const PP_BrowserFont_Trusted_Description* description, diff --git a/ppapi/shared_impl/resource.h b/ppapi/shared_impl/resource.h index 50513fd..4c5dc35 100644 --- a/ppapi/shared_impl/resource.h +++ b/ppapi/shared_impl/resource.h @@ -37,7 +37,7 @@ F(PPB_FileSystem_API) \ F(PPB_Find_API) \ F(PPB_Flash_Clipboard_API) \ - F(PPB_Flash_DeviceID_API) \ + F(PPB_Flash_DRM_API) \ F(PPB_Flash_File_API) \ F(PPB_Flash_FontFile_API) \ F(PPB_Flash_Fullscreen_API) \ diff --git a/ppapi/tests/test_flash_device_id.cc b/ppapi/tests/test_flash_device_id.cc deleted file mode 100644 index a4e20b2..0000000 --- a/ppapi/tests/test_flash_device_id.cc +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/tests/test_flash_device_id.h" - -#include "ppapi/c/pp_macros.h" -#include "ppapi/c/private/ppb_flash_device_id.h" -#include "ppapi/cpp/instance.h" -#include "ppapi/cpp/module.h" -#include "ppapi/cpp/private/flash_device_id.h" -#include "ppapi/cpp/var.h" -#include "ppapi/tests/testing_instance.h" - -REGISTER_TEST_CASE(FlashDeviceID); - -using pp::flash::DeviceID; -using pp::Var; - -TestFlashDeviceID::TestFlashDeviceID(TestingInstance* instance) - : TestCase(instance), - PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) { -} - -void TestFlashDeviceID::RunTests(const std::string& filter) { - RUN_TEST(GetDeviceID, filter); -} - -std::string TestFlashDeviceID::TestGetDeviceID() { - DeviceID device_id(instance_); - TestCompletionCallbackWithOutput<Var> output_callback( - instance_->pp_instance()); - int32_t rv = device_id.GetDeviceID(output_callback.GetCallback()); - output_callback.WaitForResult(rv); - ASSERT_TRUE(output_callback.result() == PP_OK); - Var result = output_callback.output(); - ASSERT_TRUE(result.is_string()); - std::string id = result.AsString(); - ASSERT_FALSE(id.empty()); - - PASS(); -} diff --git a/ppapi/tests/test_flash_drm.cc b/ppapi/tests/test_flash_drm.cc new file mode 100644 index 0000000..94b6f26 --- /dev/null +++ b/ppapi/tests/test_flash_drm.cc @@ -0,0 +1,61 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ppapi/tests/test_flash_drm.h" + +#include "ppapi/c/pp_macros.h" +#include "ppapi/c/private/ppb_flash_drm.h" +#include "ppapi/cpp/instance.h" +#include "ppapi/cpp/module.h" +#include "ppapi/cpp/private/flash_device_id.h" +#include "ppapi/cpp/private/flash_drm.h" +#include "ppapi/cpp/var.h" +#include "ppapi/tests/testing_instance.h" + +REGISTER_TEST_CASE(FlashDRM); + +using pp::flash::DeviceID; +using pp::flash::DRM; +using pp::Var; + +TestFlashDRM::TestFlashDRM(TestingInstance* instance) + : TestCase(instance), + PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) { +} + +void TestFlashDRM::RunTests(const std::string& filter) { + RUN_TEST(GetDeviceID, filter); +} + +std::string TestFlashDRM::TestGetDeviceID() { + // Test the old C++ wrapper. + // TODO(raymes): Remove this once Flash switches APIs. + { + DeviceID device_id(instance_); + TestCompletionCallbackWithOutput<Var> output_callback( + instance_->pp_instance()); + int32_t rv = device_id.GetDeviceID(output_callback.GetCallback()); + output_callback.WaitForResult(rv); + ASSERT_TRUE(output_callback.result() == PP_OK); + Var result = output_callback.output(); + ASSERT_TRUE(result.is_string()); + std::string id = result.AsString(); + ASSERT_FALSE(id.empty()); + } + + { + DRM drm(instance_); + TestCompletionCallbackWithOutput<Var> output_callback( + instance_->pp_instance()); + int32_t rv = drm.GetDeviceID(output_callback.GetCallback()); + output_callback.WaitForResult(rv); + ASSERT_TRUE(output_callback.result() == PP_OK); + Var result = output_callback.output(); + ASSERT_TRUE(result.is_string()); + std::string id = result.AsString(); + ASSERT_FALSE(id.empty()); + } + + PASS(); +} diff --git a/ppapi/tests/test_flash_device_id.h b/ppapi/tests/test_flash_drm.h index 10e50bf..964a80e 100644 --- a/ppapi/tests/test_flash_device_id.h +++ b/ppapi/tests/test_flash_drm.h @@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef PAPPI_TESTS_TEST_FLASH_DEVICE_ID_H_ -#define PAPPI_TESTS_TEST_FLASH_DEVICE_ID_H_ +#ifndef PAPPI_TESTS_TEST_FLASH_DRM_H_ +#define PAPPI_TESTS_TEST_FLASH_DRM_H_ #include <string> #include "ppapi/tests/test_case.h" #include "ppapi/utility/completion_callback_factory.h" -class TestFlashDeviceID : public TestCase { +class TestFlashDRM : public TestCase { public: - explicit TestFlashDeviceID(TestingInstance* instance); + explicit TestFlashDRM(TestingInstance* instance); // TestCase implementation. virtual void RunTests(const std::string& filter); @@ -20,7 +20,7 @@ class TestFlashDeviceID : public TestCase { private: std::string TestGetDeviceID(); - pp::CompletionCallbackFactory<TestFlashDeviceID> callback_factory_; + pp::CompletionCallbackFactory<TestFlashDRM> callback_factory_; }; -#endif // PAPPI_TESTS_TEST_FLASH_DEVICE_ID_H_ +#endif // PAPPI_TESTS_TEST_FLASH_DRM_H_ diff --git a/ppapi/thunk/interfaces_ppb_private_flash.h b/ppapi/thunk/interfaces_ppb_private_flash.h index a020a3a..21d9c27 100644 --- a/ppapi/thunk/interfaces_ppb_private_flash.h +++ b/ppapi/thunk/interfaces_ppb_private_flash.h @@ -37,6 +37,9 @@ PROXIED_IFACE(NoAPIName, PROXIED_IFACE(NoAPIName, PPB_FLASH_DEVICEID_INTERFACE_1_0, PPB_Flash_DeviceID_1_0) +PROXIED_IFACE(NoAPIName, + PPB_FLASH_DRM_INTERFACE_1_0, + PPB_Flash_DRM_1_0) PROXIED_IFACE(NoAPIName, PPB_FLASH_FONTFILE_INTERFACE_0_1, diff --git a/ppapi/thunk/ppb_flash_device_id_thunk.cc b/ppapi/thunk/ppb_flash_device_id_thunk.cc index 595fdc7..43432a0 100644 --- a/ppapi/thunk/ppb_flash_device_id_thunk.cc +++ b/ppapi/thunk/ppb_flash_device_id_thunk.cc @@ -9,7 +9,7 @@ #include "ppapi/c/private/ppb_flash_device_id.h" #include "ppapi/shared_impl/tracked_callback.h" #include "ppapi/thunk/enter.h" -#include "ppapi/thunk/ppb_flash_device_id_api.h" +#include "ppapi/thunk/ppb_flash_drm_api.h" #include "ppapi/thunk/ppb_instance_api.h" #include "ppapi/thunk/resource_creation_api.h" #include "ppapi/thunk/thunk.h" @@ -24,14 +24,14 @@ PP_Resource Create(PP_Instance instance) { EnterResourceCreation enter(instance); if (enter.failed()) return 0; - return enter.functions()->CreateFlashDeviceID(instance); + return enter.functions()->CreateFlashDRM(instance); } int32_t GetDeviceID(PP_Resource device_id, struct PP_Var* id, struct PP_CompletionCallback callback) { VLOG(4) << "PPB_Flash_DeviceID::GetDeviceID()"; - EnterResource<PPB_Flash_DeviceID_API> enter(device_id, callback, true); + EnterResource<PPB_Flash_DRM_API> enter(device_id, callback, true); if (enter.failed()) return enter.retval(); return enter.SetResult(enter.object()->GetDeviceID(id, enter.callback())); diff --git a/ppapi/thunk/ppb_flash_device_id_api.h b/ppapi/thunk/ppb_flash_drm_api.h index cbd1bf5..28d91be 100644 --- a/ppapi/thunk/ppb_flash_device_id_api.h +++ b/ppapi/thunk/ppb_flash_drm_api.h @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/memory/ref_counted.h" +#include "ppapi/c/private/ppb_flash_drm.h" #include "ppapi/thunk/ppapi_thunk_export.h" namespace ppapi { @@ -11,9 +12,9 @@ class TrackedCallback; namespace thunk { -class PPAPI_THUNK_EXPORT PPB_Flash_DeviceID_API { +class PPAPI_THUNK_EXPORT PPB_Flash_DRM_API { public: - virtual ~PPB_Flash_DeviceID_API() {} + virtual ~PPB_Flash_DRM_API() {} virtual int32_t GetDeviceID(PP_Var* id, scoped_refptr<TrackedCallback> callback) = 0; diff --git a/ppapi/thunk/ppb_flash_drm_thunk.cc b/ppapi/thunk/ppb_flash_drm_thunk.cc new file mode 100644 index 0000000..5d1176d --- /dev/null +++ b/ppapi/thunk/ppb_flash_drm_thunk.cc @@ -0,0 +1,52 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// From private/ppb_flash_drm.idl modified Mon May 20 13:45:09 2013. + +#include "ppapi/c/pp_completion_callback.h" +#include "ppapi/c/pp_errors.h" +#include "ppapi/c/private/ppb_flash_drm.h" +#include "ppapi/shared_impl/tracked_callback.h" +#include "ppapi/thunk/enter.h" +#include "ppapi/thunk/ppb_flash_drm_api.h" +#include "ppapi/thunk/ppb_instance_api.h" +#include "ppapi/thunk/resource_creation_api.h" +#include "ppapi/thunk/thunk.h" + +namespace ppapi { +namespace thunk { + +namespace { + +PP_Resource Create(PP_Instance instance) { + VLOG(4) << "PPB_Flash_DRM::Create()"; + EnterResourceCreation enter(instance); + if (enter.failed()) + return 0; + return enter.functions()->CreateFlashDRM(instance); +} + +int32_t GetDeviceID(PP_Resource drm, + struct PP_Var* id, + struct PP_CompletionCallback callback) { + VLOG(4) << "PPB_Flash_DRM::GetDeviceID()"; + EnterResource<PPB_Flash_DRM_API> enter(drm, callback, true); + if (enter.failed()) + return enter.retval(); + return enter.SetResult(enter.object()->GetDeviceID(id, enter.callback())); +} + +const PPB_Flash_DRM_1_0 g_ppb_flash_drm_thunk_1_0 = { + &Create, + &GetDeviceID +}; + +} // namespace + +const PPB_Flash_DRM_1_0* GetPPB_Flash_DRM_1_0_Thunk() { + return &g_ppb_flash_drm_thunk_1_0; +} + +} // namespace thunk +} // namespace ppapi diff --git a/ppapi/thunk/resource_creation_api.h b/ppapi/thunk/resource_creation_api.h index ec512ea..c441249 100644 --- a/ppapi/thunk/resource_creation_api.h +++ b/ppapi/thunk/resource_creation_api.h @@ -160,7 +160,7 @@ class ResourceCreationAPI { PP_Instance instance, const PP_BrowserFont_Trusted_Description* description) = 0; virtual PP_Resource CreateBuffer(PP_Instance instance, uint32_t size) = 0; - virtual PP_Resource CreateFlashDeviceID(PP_Instance instance) = 0; + virtual PP_Resource CreateFlashDRM(PP_Instance instance) = 0; virtual PP_Resource CreateFlashFontFile( PP_Instance instance, const PP_BrowserFont_Trusted_Description* description, diff --git a/webkit/common/plugins/ppapi/ppapi_utils.cc b/webkit/common/plugins/ppapi/ppapi_utils.cc index c4a65b8..190b85a 100644 --- a/webkit/common/plugins/ppapi/ppapi_utils.cc +++ b/webkit/common/plugins/ppapi/ppapi_utils.cc @@ -70,6 +70,7 @@ #include "ppapi/c/private/ppb_flash.h" #include "ppapi/c/private/ppb_flash_clipboard.h" #include "ppapi/c/private/ppb_flash_device_id.h" +#include "ppapi/c/private/ppb_flash_drm.h" #include "ppapi/c/private/ppb_flash_file.h" #include "ppapi/c/private/ppb_flash_font_file.h" #include "ppapi/c/private/ppb_flash_fullscreen.h" diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc index d6c4d32..1b1f530 100644 --- a/webkit/plugins/ppapi/plugin_module.cc +++ b/webkit/plugins/ppapi/plugin_module.cc @@ -77,6 +77,7 @@ #include "ppapi/c/private/ppb_flash.h" #include "ppapi/c/private/ppb_flash_clipboard.h" #include "ppapi/c/private/ppb_flash_device_id.h" +#include "ppapi/c/private/ppb_flash_drm.h" #include "ppapi/c/private/ppb_flash_file.h" #include "ppapi/c/private/ppb_flash_font_file.h" #include "ppapi/c/private/ppb_flash_fullscreen.h" diff --git a/webkit/plugins/ppapi/resource_creation_impl.cc b/webkit/plugins/ppapi/resource_creation_impl.cc index 94e6e83..6988788 100644 --- a/webkit/plugins/ppapi/resource_creation_impl.cc +++ b/webkit/plugins/ppapi/resource_creation_impl.cc @@ -90,7 +90,7 @@ PP_Resource ResourceCreationImpl::CreateFileRef( return serialized.resource.host_resource(); } -PP_Resource ResourceCreationImpl::CreateFlashDeviceID(PP_Instance instance) { +PP_Resource ResourceCreationImpl::CreateFlashDRM(PP_Instance instance) { return 0; // Not supported in-process. } diff --git a/webkit/plugins/ppapi/resource_creation_impl.h b/webkit/plugins/ppapi/resource_creation_impl.h index 9ccc4be..8c25d9a 100644 --- a/webkit/plugins/ppapi/resource_creation_impl.h +++ b/webkit/plugins/ppapi/resource_creation_impl.h @@ -43,7 +43,7 @@ class WEBKIT_PLUGINS_EXPORT ResourceCreationImpl const char* path) OVERRIDE; virtual PP_Resource CreateFileRef( const ::ppapi::PPB_FileRef_CreateInfo& serialized) OVERRIDE; - virtual PP_Resource CreateFlashDeviceID(PP_Instance instance) OVERRIDE; + virtual PP_Resource CreateFlashDRM(PP_Instance instance) OVERRIDE; virtual PP_Resource CreateFlashFontFile( PP_Instance instance, const PP_BrowserFont_Trusted_Description* description, |