Android WebView: build debug/release based on variant.
[chromium-blink-merge.git] / ppapi / thunk / ppb_instance_private_thunk.cc
blob0d9c10bcf71a904dd5392576d9a8329a8ab15f4b
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_instance_private.idl modified Thu Feb 28 11:58:17 2013.
7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/private/ppb_instance_private.h"
9 #include "ppapi/shared_impl/tracked_callback.h"
10 #include "ppapi/thunk/enter.h"
11 #include "ppapi/thunk/ppb_instance_api.h"
12 #include "ppapi/thunk/resource_creation_api.h"
13 #include "ppapi/thunk/thunk.h"
15 namespace ppapi {
16 namespace thunk {
18 namespace {
20 struct PP_Var GetWindowObject(PP_Instance instance) {
21 VLOG(4) << "PPB_Instance_Private::GetWindowObject()";
22 EnterInstance enter(instance);
23 if (enter.failed())
24 return PP_MakeUndefined();
25 return enter.functions()->GetWindowObject(instance);
28 struct PP_Var GetOwnerElementObject(PP_Instance instance) {
29 VLOG(4) << "PPB_Instance_Private::GetOwnerElementObject()";
30 EnterInstance enter(instance);
31 if (enter.failed())
32 return PP_MakeUndefined();
33 return enter.functions()->GetOwnerElementObject(instance);
36 struct PP_Var ExecuteScript(PP_Instance instance,
37 struct PP_Var script,
38 struct PP_Var* exception) {
39 VLOG(4) << "PPB_Instance_Private::ExecuteScript()";
40 EnterInstance enter(instance);
41 if (enter.failed())
42 return PP_MakeUndefined();
43 return enter.functions()->ExecuteScript(instance, script, exception);
46 const PPB_Instance_Private_0_1 g_ppb_instance_private_thunk_0_1 = {
47 &GetWindowObject,
48 &GetOwnerElementObject,
49 &ExecuteScript
52 } // namespace
54 const PPB_Instance_Private_0_1* GetPPB_Instance_Private_0_1_Thunk() {
55 return &g_ppb_instance_private_thunk_0_1;
58 } // namespace thunk
59 } // namespace ppapi