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 Fri Nov 1 16:12:12 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/ppapi_thunk_export.h"
12 #include "ppapi/thunk/ppb_network_list_api.h"
19 PP_Bool
IsNetworkList(PP_Resource resource
) {
20 VLOG(4) << "PPB_NetworkList::IsNetworkList()";
21 EnterResource
<PPB_NetworkList_API
> enter(resource
, false);
22 return PP_FromBool(enter
.succeeded());
25 uint32_t GetCount(PP_Resource resource
) {
26 VLOG(4) << "PPB_NetworkList::GetCount()";
27 EnterResource
<PPB_NetworkList_API
> enter(resource
, true);
30 return enter
.object()->GetCount();
33 struct PP_Var
GetName(PP_Resource resource
, uint32_t index
) {
34 VLOG(4) << "PPB_NetworkList::GetName()";
35 EnterResource
<PPB_NetworkList_API
> enter(resource
, true);
37 return PP_MakeUndefined();
38 return enter
.object()->GetName(index
);
41 PP_NetworkList_Type
GetType(PP_Resource resource
, uint32_t index
) {
42 VLOG(4) << "PPB_NetworkList::GetType()";
43 EnterResource
<PPB_NetworkList_API
> enter(resource
, true);
45 return PP_NETWORKLIST_TYPE_UNKNOWN
;
46 return enter
.object()->GetType(index
);
49 PP_NetworkList_State
GetState(PP_Resource resource
, uint32_t index
) {
50 VLOG(4) << "PPB_NetworkList::GetState()";
51 EnterResource
<PPB_NetworkList_API
> enter(resource
, true);
53 return PP_NETWORKLIST_STATE_DOWN
;
54 return enter
.object()->GetState(index
);
57 int32_t GetIpAddresses(PP_Resource resource
,
59 struct PP_ArrayOutput output
) {
60 VLOG(4) << "PPB_NetworkList::GetIpAddresses()";
61 EnterResource
<PPB_NetworkList_API
> enter(resource
, true);
63 return enter
.retval();
64 return enter
.object()->GetIpAddresses(index
, output
);
67 struct PP_Var
GetDisplayName(PP_Resource resource
, uint32_t index
) {
68 VLOG(4) << "PPB_NetworkList::GetDisplayName()";
69 EnterResource
<PPB_NetworkList_API
> enter(resource
, true);
71 return PP_MakeUndefined();
72 return enter
.object()->GetDisplayName(index
);
75 uint32_t GetMTU(PP_Resource resource
, uint32_t index
) {
76 VLOG(4) << "PPB_NetworkList::GetMTU()";
77 EnterResource
<PPB_NetworkList_API
> enter(resource
, true);
80 return enter
.object()->GetMTU(index
);
83 const PPB_NetworkList_1_0 g_ppb_networklist_thunk_1_0
= {&IsNetworkList
,
94 PPAPI_THUNK_EXPORT
const PPB_NetworkList_1_0
* GetPPB_NetworkList_1_0_Thunk() {
95 return &g_ppb_networklist_thunk_1_0
;