summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp/private/flash_drm.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi/cpp/private/flash_drm.cc')
-rw-r--r--ppapi/cpp/private/flash_drm.cc37
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