diff options
author | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-27 01:33:37 +0000 |
---|---|---|
committer | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-27 01:33:37 +0000 |
commit | 5a9f47ad788a638bae138edc5e35751c4e5865d2 (patch) | |
tree | 385a0ba81c8b4a52c71b850c09175e981f2add94 /ppapi/cpp/private/flash_drm.cc | |
parent | 6268d3af3d1ff0744960798b7f65f81780f636ef (diff) | |
download | chromium_src-5a9f47ad788a638bae138edc5e35751c4e5865d2.zip chromium_src-5a9f47ad788a638bae138edc5e35751c4e5865d2.tar.gz chromium_src-5a9f47ad788a638bae138edc5e35751c4e5865d2.tar.bz2 |
Pepper: Add MonitorIsExternal function to PPB_Flash_DRM.
This adds the Pepper boilerplate code, including messages,
for implementing a new MonitorIsExternal method. The
implementation in PepperFlashDRMHost is stubbed out.
BUG=none
Review URL: https://codereview.chromium.org/68773004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237471 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp/private/flash_drm.cc')
-rw-r--r-- | ppapi/cpp/private/flash_drm.cc | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/ppapi/cpp/private/flash_drm.cc b/ppapi/cpp/private/flash_drm.cc index f576fb2..c425c9f 100644 --- a/ppapi/cpp/private/flash_drm.cc +++ b/ppapi/cpp/private/flash_drm.cc @@ -17,6 +17,10 @@ template <> const char* interface_name<PPB_Flash_DRM_1_0>() { return PPB_FLASH_DRM_INTERFACE_1_0; } +template <> const char* interface_name<PPB_Flash_DRM_1_1>() { + return PPB_FLASH_DRM_INTERFACE_1_1; +} + template <> const char* interface_name<PPB_Flash_DeviceID_1_0>() { return PPB_FLASH_DEVICEID_INTERFACE_1_0; } @@ -29,7 +33,10 @@ DRM::DRM() { } DRM::DRM(const InstanceHandle& instance) : Resource() { - if (has_interface<PPB_Flash_DRM_1_0>()) { + if (has_interface<PPB_Flash_DRM_1_1>()) { + PassRefFromConstructor(get_interface<PPB_Flash_DRM_1_1>()->Create( + instance.pp_instance())); + } else 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>()) { @@ -39,6 +46,12 @@ DRM::DRM(const InstanceHandle& instance) : Resource() { } int32_t DRM::GetDeviceID(const CompletionCallbackWithOutput<Var>& callback) { + if (has_interface<PPB_Flash_DRM_1_1>()) { + return get_interface<PPB_Flash_DRM_1_1>()->GetDeviceID( + pp_resource(), + callback.output(), + callback.pp_completion_callback()); + } if (has_interface<PPB_Flash_DRM_1_0>()) { return get_interface<PPB_Flash_DRM_1_0>()->GetDeviceID( pp_resource(), @@ -55,6 +68,11 @@ int32_t DRM::GetDeviceID(const CompletionCallbackWithOutput<Var>& callback) { } bool DRM::GetHmonitor(int64_t* hmonitor) { + if (has_interface<PPB_Flash_DRM_1_1>()) { + return PP_ToBool(get_interface<PPB_Flash_DRM_1_1>()->GetHmonitor( + pp_resource(), + hmonitor)); + } if (has_interface<PPB_Flash_DRM_1_0>()) { return PP_ToBool(get_interface<PPB_Flash_DRM_1_0>()->GetHmonitor( pp_resource(), @@ -65,6 +83,12 @@ bool DRM::GetHmonitor(int64_t* hmonitor) { int32_t DRM::GetVoucherFile( const CompletionCallbackWithOutput<FileRef>& callback) { + if (has_interface<PPB_Flash_DRM_1_1>()) { + return get_interface<PPB_Flash_DRM_1_1>()->GetVoucherFile( + pp_resource(), + callback.output(), + callback.pp_completion_callback()); + } if (has_interface<PPB_Flash_DRM_1_0>()) { return get_interface<PPB_Flash_DRM_1_0>()->GetVoucherFile( pp_resource(), @@ -74,5 +98,16 @@ int32_t DRM::GetVoucherFile( return PP_ERROR_NOINTERFACE; } +int32_t DRM::MonitorIsExternal( + const CompletionCallbackWithOutput<PP_Bool>& callback) { + if (has_interface<PPB_Flash_DRM_1_1>()) { + return get_interface<PPB_Flash_DRM_1_1>()->MonitorIsExternal( + pp_resource(), + callback.output(), + callback.pp_completion_callback()); + } + return PP_ERROR_NOINTERFACE; +} + } // namespace flash } // namespace pp |