Bluetooth: clean up Bluetooth classes
[chromium-blink-merge.git] / ppapi / thunk / ppb_buffer_trusted_thunk.cc
blob86505e08580c1889bf17d4fa54e32f548501247b
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 trusted/ppb_buffer_trusted.idl modified Thu Feb 28 11:58:17 2013.
7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/trusted/ppb_buffer_trusted.h"
9 #include "ppapi/shared_impl/tracked_callback.h"
10 #include "ppapi/thunk/enter.h"
11 #include "ppapi/thunk/ppb_buffer_api.h"
12 #include "ppapi/thunk/ppb_instance_api.h"
13 #include "ppapi/thunk/resource_creation_api.h"
14 #include "ppapi/thunk/thunk.h"
16 namespace ppapi {
17 namespace thunk {
19 namespace {
21 int32_t GetSharedMemory(PP_Resource buffer, int* handle) {
22 VLOG(4) << "PPB_BufferTrusted::GetSharedMemory()";
23 EnterResource<PPB_Buffer_API> enter(buffer, true);
24 if (enter.failed())
25 return enter.retval();
26 return enter.object()->GetSharedMemory(handle);
29 const PPB_BufferTrusted_0_1 g_ppb_buffertrusted_thunk_0_1 = {
30 &GetSharedMemory
33 } // namespace
35 const PPB_BufferTrusted_0_1* GetPPB_BufferTrusted_0_1_Thunk() {
36 return &g_ppb_buffertrusted_thunk_0_1;
39 } // namespace thunk
40 } // namespace ppapi