diff options
author | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-11 21:36:05 +0000 |
---|---|---|
committer | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-11 21:36:05 +0000 |
commit | a245006a5f6f1c5abc7f3f7aecc56444847bfa48 (patch) | |
tree | 5f53ef9eb4b9b6db2dea148708747f72d72b8ed7 /ppapi/cpp | |
parent | a53f5a49c0705cdb54487555aac3f28f49bf3943 (diff) | |
download | chromium_src-a245006a5f6f1c5abc7f3f7aecc56444847bfa48.zip chromium_src-a245006a5f6f1c5abc7f3f7aecc56444847bfa48.tar.gz chromium_src-a245006a5f6f1c5abc7f3f7aecc56444847bfa48.tar.bz2 |
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
Diffstat (limited to 'ppapi/cpp')
-rw-r--r-- | ppapi/cpp/private/flash_drm.cc | 20 | ||||
-rw-r--r-- | ppapi/cpp/private/flash_drm.h | 9 |
2 files changed, 29 insertions, 0 deletions
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<Var>& callback) { return callback.MayForce(PP_ERROR_NOINTERFACE); } +bool DRM::GetHmonitor(int64_t* hmonitor) { + if (has_interface<PPB_Flash_DRM_1_0>()) { + return PP_ToBool(get_interface<PPB_Flash_DRM_1_0>()->GetHmonitor( + pp_resource(), + hmonitor)); + } + return 0; +} + +int32_t DRM::GetVoucherFile( + const CompletionCallbackWithOutput<FileRef>& callback) { + if (has_interface<PPB_Flash_DRM_1_0>()) { + return get_interface<PPB_Flash_DRM_1_0>()->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<Var>& 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<FileRef>& callback); }; } // namespace flash |