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

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

Issue 7713021: Add SetProperty() in the PPB_Transport_Dev interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "ppapi/c/pp_completion_callback.h" 5 #include "ppapi/c/pp_completion_callback.h"
6 #include "ppapi/c/pp_errors.h" 6 #include "ppapi/c/pp_errors.h"
7 #include "ppapi/thunk/common.h" 7 #include "ppapi/thunk/common.h"
8 #include "ppapi/thunk/enter.h" 8 #include "ppapi/thunk/enter.h"
9 #include "ppapi/thunk/thunk.h" 9 #include "ppapi/thunk/thunk.h"
10 #include "ppapi/thunk/ppb_transport_api.h" 10 #include "ppapi/thunk/ppb_transport_api.h"
(...skipping 18 matching lines...) Expand all
29 return PP_FromBool(enter.succeeded()); 29 return PP_FromBool(enter.succeeded());
30 } 30 }
31 31
32 PP_Bool IsWritable(PP_Resource transport) { 32 PP_Bool IsWritable(PP_Resource transport) {
33 EnterTransport enter(transport, true); 33 EnterTransport enter(transport, true);
34 if (enter.failed()) 34 if (enter.failed())
35 return PP_FALSE; 35 return PP_FALSE;
36 return enter.object()->IsWritable(); 36 return enter.object()->IsWritable();
37 } 37 }
38 38
39 int32_t SetConfig(PP_Resource transport, const char* config) {
40 EnterTransport enter(transport, true);
41 if (enter.failed())
42 return PP_ERROR_BADRESOURCE;
43 return enter.object()->SetConfig(config);
44 }
45
39 int32_t Connect(PP_Resource transport, PP_CompletionCallback callback) { 46 int32_t Connect(PP_Resource transport, PP_CompletionCallback callback) {
40 EnterTransport enter(transport, true); 47 EnterTransport enter(transport, true);
41 if (enter.failed()) 48 if (enter.failed())
42 return MayForceCallback(callback, PP_ERROR_BADRESOURCE); 49 return MayForceCallback(callback, PP_ERROR_BADRESOURCE);
43 int32_t result = enter.object()->Connect(callback); 50 int32_t result = enter.object()->Connect(callback);
44 return MayForceCallback(callback, result); 51 return MayForceCallback(callback, result);
45 } 52 }
46 53
47 int32_t GetNextAddress(PP_Resource transport, PP_Var* address, 54 int32_t GetNextAddress(PP_Resource transport, PP_Var* address,
48 PP_CompletionCallback callback) { 55 PP_CompletionCallback callback) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 EnterTransport enter(transport, true); 89 EnterTransport enter(transport, true);
83 if (enter.failed()) 90 if (enter.failed())
84 return PP_ERROR_BADRESOURCE; 91 return PP_ERROR_BADRESOURCE;
85 return enter.object()->Close(); 92 return enter.object()->Close();
86 } 93 }
87 94
88 const PPB_Transport_Dev g_ppb_transport_thunk = { 95 const PPB_Transport_Dev g_ppb_transport_thunk = {
89 &Create, 96 &Create,
90 &IsTransport, 97 &IsTransport,
91 &IsWritable, 98 &IsWritable,
99 &SetConfig,
92 &Connect, 100 &Connect,
93 &GetNextAddress, 101 &GetNextAddress,
94 &ReceiveRemoteAddress, 102 &ReceiveRemoteAddress,
95 &Recv, 103 &Recv,
96 &Send, 104 &Send,
97 &Close, 105 &Close,
98 }; 106 };
99 107
100 } // namespace 108 } // namespace
101 109
102 const PPB_Transport_Dev* GetPPB_Transport_Thunk() { 110 const PPB_Transport_Dev* GetPPB_Transport_Thunk() {
103 return &g_ppb_transport_thunk; 111 return &g_ppb_transport_thunk;
104 } 112 }
105 113
106 } // namespace thunk 114 } // namespace thunk
107 } // namespace ppapi 115 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698