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 ppb_network_list.idl modified Mon Sep 9 11:18:02 2013.
7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/ppb_network_list.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/ppb_network_list_api.h"
13 #include "ppapi/thunk/resource_creation_api.h"
14 #include "ppapi/thunk/thunk.h"
21 PP_Bool
IsNetworkList(PP_Resource resource
) {
22 VLOG(4) << "PPB_NetworkList::IsNetworkList()";
23 EnterResource
<PPB_NetworkList_API
> enter(resource
, false);
24 return PP_FromBool(enter
.succeeded());
27 uint32_t GetCount(PP_Resource resource
) {
28 VLOG(4) << "PPB_NetworkList::GetCount()";
29 EnterResource
<PPB_NetworkList_API
> enter(resource
, true);
32 return enter
.object()->GetCount();
35 struct PP_Var
GetName(PP_Resource resource
, uint32_t index
) {
36 VLOG(4) << "PPB_NetworkList::GetName()";
37 EnterResource
<PPB_NetworkList_API
> enter(resource
, true);
39 return PP_MakeUndefined();
40 return enter
.object()->GetName(index
);
43 PP_NetworkList_Type
GetType(PP_Resource resource
, uint32_t index
) {
44 VLOG(4) << "PPB_NetworkList::GetType()";
45 EnterResource
<PPB_NetworkList_API
> enter(resource
, true);
47 return PP_NETWORKLIST_TYPE_UNKNOWN
;
48 return enter
.object()->GetType(index
);
51 PP_NetworkList_State
GetState(PP_Resource resource
, uint32_t index
) {
52 VLOG(4) << "PPB_NetworkList::GetState()";
53 EnterResource
<PPB_NetworkList_API
> enter(resource
, true);
55 return PP_NETWORKLIST_STATE_DOWN
;
56 return enter
.object()->GetState(index
);
59 int32_t GetIpAddresses(PP_Resource resource
,
61 struct PP_ArrayOutput output
) {
62 VLOG(4) << "PPB_NetworkList::GetIpAddresses()";
63 EnterResource
<PPB_NetworkList_API
> enter(resource
, true);
65 return enter
.retval();
66 return enter
.object()->GetIpAddresses(index
, output
);
69 struct PP_Var
GetDisplayName(PP_Resource resource
, uint32_t index
) {
70 VLOG(4) << "PPB_NetworkList::GetDisplayName()";
71 EnterResource
<PPB_NetworkList_API
> enter(resource
, true);
73 return PP_MakeUndefined();
74 return enter
.object()->GetDisplayName(index
);
77 uint32_t GetMTU(PP_Resource resource
, uint32_t index
) {
78 VLOG(4) << "PPB_NetworkList::GetMTU()";
79 EnterResource
<PPB_NetworkList_API
> enter(resource
, true);
82 return enter
.object()->GetMTU(index
);
85 const PPB_NetworkList_1_0 g_ppb_networklist_thunk_1_0
= {
98 const PPB_NetworkList_1_0
* GetPPB_NetworkList_1_0_Thunk() {
99 return &g_ppb_networklist_thunk_1_0
;