Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1154)

Unified Diff: ppapi/cpp/private/flash_drm.cc

Issue 68773004: Pepper: Add MonitorIsExternal function to PPB_Flash_DRM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix TODO, interface ordering.x Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/cpp/private/flash_drm.h ('k') | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/private/flash_drm.cc
diff --git a/ppapi/cpp/private/flash_drm.cc b/ppapi/cpp/private/flash_drm.cc
index f576fb26d0c555bc8ed60df28aad1a407d432a6f..c425c9f5b47dbdc397fc3f00a69ba0192d143555 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
« no previous file with comments | « ppapi/cpp/private/flash_drm.h ('k') | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698