Extend relocation packing to cover arm64.
[chromium-blink-merge.git] / ppapi / thunk / ppb_flash_drm_thunk.cc
blob359a014c3d48aa6a2c314234e2982bbcb58f9811
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"
15 namespace ppapi {
16 namespace thunk {
18 namespace {
20 PP_Resource Create(PP_Instance instance) {
21 VLOG(4) << "PPB_Flash_DRM::Create()";
22 EnterResourceCreation enter(instance);
23 if (enter.failed())
24 return 0;
25 return enter.functions()->CreateFlashDRM(instance);
28 int32_t GetDeviceID(PP_Resource drm,
29 struct PP_Var* id,
30 struct PP_CompletionCallback callback) {
31 VLOG(4) << "PPB_Flash_DRM::GetDeviceID()";
32 EnterResource<PPB_Flash_DRM_API> enter(drm, callback, true);
33 if (enter.failed())
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);
41 if (enter.failed())
42 return PP_FALSE;
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);
51 if (enter.failed())
52 return enter.retval();
53 return enter.SetResult(enter.object()->GetVoucherFile(file_ref,
54 enter.callback()));
57 int32_t MonitorIsExternal(PP_Resource drm,
58 PP_Bool* is_external,
59 struct PP_CompletionCallback callback) {
60 VLOG(4) << "PPB_Flash_DRM::MonitorIsExternal()";
61 EnterResource<PPB_Flash_DRM_API> enter(drm, callback, true);
62 if (enter.failed())
63 return enter.retval();
64 return enter.SetResult(enter.object()->MonitorIsExternal(is_external,
65 enter.callback()));
68 const PPB_Flash_DRM_1_0 g_ppb_flash_drm_thunk_1_0 = {
69 &Create,
70 &GetDeviceID,
71 &GetHmonitor,
72 &GetVoucherFile
75 const PPB_Flash_DRM_1_1 g_ppb_flash_drm_thunk_1_1 = {
76 &Create,
77 &GetDeviceID,
78 &GetHmonitor,
79 &GetVoucherFile,
80 &MonitorIsExternal
83 } // namespace
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;
93 } // namespace thunk
94 } // namespace ppapi