From a245006a5f6f1c5abc7f3f7aecc56444847bfa48 Mon Sep 17 00:00:00 2001 From: "raymes@chromium.org" Date: Tue, 11 Jun 2013 21:36:05 +0000 Subject: Implement GetVoucherFile and GetHmonitor functions for PPB_Flash_DRM This adds 2 functions to PPB_Flash_DRM which are used for Flash DRM-related features. GetVoucherFile() returns a FileRef to a flash voucher file. This file will be dropped in to the tree next to the flash DLL and will be named plugin.vch. GetHmonitor returns the HMONITOR (on windows only) associated with the monitor displaying the instance. cpu@ will implement the backend for this. BUG=242241 R=cpu@chromium.org, jam@chromium.org, jschuh@chromium.org, yzshen@chromium.org Review URL: https://codereview.chromium.org/15079003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205640 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/cpp/private/flash_drm.cc | 20 ++++++++++++++++++++ ppapi/cpp/private/flash_drm.h | 9 +++++++++ 2 files changed, 29 insertions(+) (limited to 'ppapi/cpp') diff --git a/ppapi/cpp/private/flash_drm.cc b/ppapi/cpp/private/flash_drm.cc index 7307445..44887ab 100644 --- a/ppapi/cpp/private/flash_drm.cc +++ b/ppapi/cpp/private/flash_drm.cc @@ -54,5 +54,25 @@ int32_t DRM::GetDeviceID(const CompletionCallbackWithOutput& callback) { return callback.MayForce(PP_ERROR_NOINTERFACE); } +bool DRM::GetHmonitor(int64_t* hmonitor) { + if (has_interface()) { + return PP_ToBool(get_interface()->GetHmonitor( + pp_resource(), + hmonitor)); + } + return 0; +} + +int32_t DRM::GetVoucherFile( + const CompletionCallbackWithOutput& callback) { + if (has_interface()) { + return get_interface()->GetVoucherFile( + pp_resource(), + callback.output(), + callback.pp_completion_callback()); + } + return PP_ERROR_FAILED; +} + } // namespace flash } // namespace pp diff --git a/ppapi/cpp/private/flash_drm.h b/ppapi/cpp/private/flash_drm.h index 49e37c2..45ecde8 100644 --- a/ppapi/cpp/private/flash_drm.h +++ b/ppapi/cpp/private/flash_drm.h @@ -6,9 +6,13 @@ #define PPAPI_CPP_PRIVATE_FLASH_DRM_H_ #include "ppapi/cpp/completion_callback.h" +#include "ppapi/cpp/file_ref.h" #include "ppapi/cpp/resource.h" namespace pp { + +class FileRef; + namespace flash { class DRM : public Resource { @@ -18,6 +22,11 @@ class DRM : public Resource { // On success, returns a string var. int32_t GetDeviceID(const CompletionCallbackWithOutput& callback); + // Outputs the HMONITOR associated with the current plugin instance in + // |hmonitor|. True is returned upon success. + bool GetHmonitor(int64_t* hmonitor); + // Returns the voucher file as a FileRef or an invalid resource on failure. + int32_t GetVoucherFile(const CompletionCallbackWithOutput& callback); }; } // namespace flash -- cgit v1.1