blob: f20d6d584a1f4a27fb02e3a9b0488bf999b9ddcf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ppapi/c/pp_errors.h"
#include "ppapi/thunk/thunk.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_buffer_trusted_api.h"
#include "ppapi/thunk/resource_creation_api.h"
namespace ppapi {
namespace thunk {
namespace {
int32_t GetSharedMemory(PP_Resource buffer_id, int* shm_handle) {
EnterResource<PPB_BufferTrusted_API> enter(buffer_id, true);
if (enter.failed())
return PP_ERROR_BADRESOURCE;
return enter.object()->GetSharedMemory(shm_handle);
}
const PPB_BufferTrusted g_ppb_buffer_trusted_thunk = {
&GetSharedMemory,
};
} // namespace
const PPB_BufferTrusted* GetPPB_BufferTrusted_Thunk() {
return &g_ppb_buffer_trusted_thunk;
}
} // namespace thunk
} // namespace ppapi
|