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 Mon Apr 7 08:56:43 2014.
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(
54 enter
.object()->GetVoucherFile(file_ref
, enter
.callback()));
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(
65 enter
.object()->MonitorIsExternal(is_external
, enter
.callback()));
68 const PPB_Flash_DRM_1_0 g_ppb_flash_drm_thunk_1_0
= {&Create
,
73 const PPB_Flash_DRM_1_1 g_ppb_flash_drm_thunk_1_1
= {&Create
,
81 PPAPI_THUNK_EXPORT
const PPB_Flash_DRM_1_0
* GetPPB_Flash_DRM_1_0_Thunk() {
82 return &g_ppb_flash_drm_thunk_1_0
;
85 PPAPI_THUNK_EXPORT
const PPB_Flash_DRM_1_1
* GetPPB_Flash_DRM_1_1_Thunk() {
86 return &g_ppb_flash_drm_thunk_1_1
;