1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // From private/ppb_flash_drm.idl modified Tue Dec 3 15:22:00 2013.
7 #include "ppapi/c/pp_completion_callback.h"
8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/private/ppb_flash_drm.h"
10 #include "ppapi/shared_impl/tracked_callback.h"
11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppapi_thunk_export.h"
13 #include "ppapi/thunk/ppb_flash_drm_api.h"
20 PP_Resource
Create(PP_Instance instance
) {
21 VLOG(4) << "PPB_Flash_DRM::Create()";
22 EnterResourceCreation
enter(instance
);
25 return enter
.functions()->CreateFlashDRM(instance
);
28 int32_t GetDeviceID(PP_Resource drm
,
30 struct PP_CompletionCallback callback
) {
31 VLOG(4) << "PPB_Flash_DRM::GetDeviceID()";
32 EnterResource
<PPB_Flash_DRM_API
> enter(drm
, callback
, true);
34 return enter
.retval();
35 return enter
.SetResult(enter
.object()->GetDeviceID(id
, enter
.callback()));
38 PP_Bool
GetHmonitor(PP_Resource drm
, int64_t* hmonitor
) {
39 VLOG(4) << "PPB_Flash_DRM::GetHmonitor()";
40 EnterResource
<PPB_Flash_DRM_API
> enter(drm
, true);
43 return enter
.object()->GetHmonitor(hmonitor
);
46 int32_t GetVoucherFile(PP_Resource drm
,
47 PP_Resource
* file_ref
,
48 struct PP_CompletionCallback callback
) {
49 VLOG(4) << "PPB_Flash_DRM::GetVoucherFile()";
50 EnterResource
<PPB_Flash_DRM_API
> enter(drm
, callback
, true);
52 return enter
.retval();
53 return enter
.SetResult(enter
.object()->GetVoucherFile(file_ref
,
57 int32_t MonitorIsExternal(PP_Resource drm
,
59 struct PP_CompletionCallback callback
) {
60 VLOG(4) << "PPB_Flash_DRM::MonitorIsExternal()";
61 EnterResource
<PPB_Flash_DRM_API
> enter(drm
, callback
, true);
63 return enter
.retval();
64 return enter
.SetResult(enter
.object()->MonitorIsExternal(is_external
,
68 const PPB_Flash_DRM_1_0 g_ppb_flash_drm_thunk_1_0
= {
75 const PPB_Flash_DRM_1_1 g_ppb_flash_drm_thunk_1_1
= {
85 PPAPI_THUNK_EXPORT
const PPB_Flash_DRM_1_0
* GetPPB_Flash_DRM_1_0_Thunk() {
86 return &g_ppb_flash_drm_thunk_1_0
;
89 PPAPI_THUNK_EXPORT
const PPB_Flash_DRM_1_1
* GetPPB_Flash_DRM_1_1_Thunk() {
90 return &g_ppb_flash_drm_thunk_1_1
;