Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: ppapi/thunk/ppb_network_list_private_thunk.cc

Issue 23806003: Use PP_ArrayOutput and PPB_NetAddress in PPB_NetworkList_Private.. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // From private/ppb_network_list_private.idl, 5 // From private/ppb_network_list_private.idl,
6 // modified Tue Apr 16 11:25:45 2013. 6 // modified Fri Aug 30 12:04:19 2013.
7 7
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/private/ppb_network_list_private.h" 9 #include "ppapi/c/private/ppb_network_list_private.h"
10 #include "ppapi/shared_impl/tracked_callback.h" 10 #include "ppapi/shared_impl/tracked_callback.h"
11 #include "ppapi/thunk/enter.h" 11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppb_instance_api.h" 12 #include "ppapi/thunk/ppb_instance_api.h"
13 #include "ppapi/thunk/ppb_network_list_api.h" 13 #include "ppapi/thunk/ppb_network_list_api.h"
14 #include "ppapi/thunk/resource_creation_api.h" 14 #include "ppapi/thunk/resource_creation_api.h"
15 #include "ppapi/thunk/thunk.h" 15 #include "ppapi/thunk/thunk.h"
16 16
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 PP_NetworkListState_Private GetState(PP_Resource resource, uint32_t index) { 52 PP_NetworkListState_Private GetState(PP_Resource resource, uint32_t index) {
53 VLOG(4) << "PPB_NetworkList_Private::GetState()"; 53 VLOG(4) << "PPB_NetworkList_Private::GetState()";
54 EnterResource<PPB_NetworkList_API> enter(resource, true); 54 EnterResource<PPB_NetworkList_API> enter(resource, true);
55 if (enter.failed()) 55 if (enter.failed())
56 return PP_NETWORKLIST_DOWN; 56 return PP_NETWORKLIST_DOWN;
57 return enter.object()->GetState(index); 57 return enter.object()->GetState(index);
58 } 58 }
59 59
60 int32_t GetIpAddresses(PP_Resource resource, 60 int32_t GetIpAddresses(PP_Resource resource,
61 uint32_t index, 61 uint32_t index,
62 struct PP_NetAddress_Private addresses[], 62 struct PP_ArrayOutput output) {
63 uint32_t count) {
64 VLOG(4) << "PPB_NetworkList_Private::GetIpAddresses()"; 63 VLOG(4) << "PPB_NetworkList_Private::GetIpAddresses()";
65 EnterResource<PPB_NetworkList_API> enter(resource, true); 64 EnterResource<PPB_NetworkList_API> enter(resource, true);
66 if (enter.failed()) 65 if (enter.failed())
67 return enter.retval(); 66 return enter.retval();
68 return enter.object()->GetIpAddresses(index, addresses, count); 67 return enter.object()->GetIpAddresses(index, output);
69 } 68 }
70 69
71 struct PP_Var GetDisplayName(PP_Resource resource, uint32_t index) { 70 struct PP_Var GetDisplayName(PP_Resource resource, uint32_t index) {
72 VLOG(4) << "PPB_NetworkList_Private::GetDisplayName()"; 71 VLOG(4) << "PPB_NetworkList_Private::GetDisplayName()";
73 EnterResource<PPB_NetworkList_API> enter(resource, true); 72 EnterResource<PPB_NetworkList_API> enter(resource, true);
74 if (enter.failed()) 73 if (enter.failed())
75 return PP_MakeUndefined(); 74 return PP_MakeUndefined();
76 return enter.object()->GetDisplayName(index); 75 return enter.object()->GetDisplayName(index);
77 } 76 }
78 77
79 uint32_t GetMTU(PP_Resource resource, uint32_t index) { 78 uint32_t GetMTU(PP_Resource resource, uint32_t index) {
80 VLOG(4) << "PPB_NetworkList_Private::GetMTU()"; 79 VLOG(4) << "PPB_NetworkList_Private::GetMTU()";
81 EnterResource<PPB_NetworkList_API> enter(resource, true); 80 EnterResource<PPB_NetworkList_API> enter(resource, true);
82 if (enter.failed()) 81 if (enter.failed())
83 return 0; 82 return 0;
84 return enter.object()->GetMTU(index); 83 return enter.object()->GetMTU(index);
85 } 84 }
86 85
87 const PPB_NetworkList_Private_0_2 g_ppb_networklist_private_thunk_0_2 = { 86 const PPB_NetworkList_Private_0_3 g_ppb_networklist_private_thunk_0_3 = {
88 &IsNetworkList, 87 &IsNetworkList,
89 &GetCount, 88 &GetCount,
90 &GetName, 89 &GetName,
91 &GetType, 90 &GetType,
92 &GetState, 91 &GetState,
93 &GetIpAddresses, 92 &GetIpAddresses,
94 &GetDisplayName, 93 &GetDisplayName,
95 &GetMTU 94 &GetMTU
96 }; 95 };
97 96
98 } // namespace 97 } // namespace
99 98
100 const PPB_NetworkList_Private_0_2* GetPPB_NetworkList_Private_0_2_Thunk() { 99 const PPB_NetworkList_Private_0_3* GetPPB_NetworkList_Private_0_3_Thunk() {
101 return &g_ppb_networklist_private_thunk_0_2; 100 return &g_ppb_networklist_private_thunk_0_3;
102 } 101 }
103 102
104 } // namespace thunk 103 } // namespace thunk
105 } // namespace ppapi 104 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698