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

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, 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
« no previous file with comments | « ppapi/thunk/ppb_transport_api.h ('k') | webkit/glue/p2p_transport.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 SetProperty(PP_Resource transport, PP_TransportProperty property,
40 PP_Var value) {
41 EnterTransport enter(transport, true);
42 if (enter.failed())
43 return PP_ERROR_BADRESOURCE;
44 return enter.object()->SetProperty(property, value);
45 }
46
39 int32_t Connect(PP_Resource transport, PP_CompletionCallback callback) { 47 int32_t Connect(PP_Resource transport, PP_CompletionCallback callback) {
40 EnterTransport enter(transport, true); 48 EnterTransport enter(transport, true);
41 if (enter.failed()) 49 if (enter.failed())
42 return MayForceCallback(callback, PP_ERROR_BADRESOURCE); 50 return MayForceCallback(callback, PP_ERROR_BADRESOURCE);
43 int32_t result = enter.object()->Connect(callback); 51 int32_t result = enter.object()->Connect(callback);
44 return MayForceCallback(callback, result); 52 return MayForceCallback(callback, result);
45 } 53 }
46 54
47 int32_t GetNextAddress(PP_Resource transport, PP_Var* address, 55 int32_t GetNextAddress(PP_Resource transport, PP_Var* address,
48 PP_CompletionCallback callback) { 56 PP_CompletionCallback callback) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 EnterTransport enter(transport, true); 90 EnterTransport enter(transport, true);
83 if (enter.failed()) 91 if (enter.failed())
84 return PP_ERROR_BADRESOURCE; 92 return PP_ERROR_BADRESOURCE;
85 return enter.object()->Close(); 93 return enter.object()->Close();
86 } 94 }
87 95
88 const PPB_Transport_Dev g_ppb_transport_thunk = { 96 const PPB_Transport_Dev g_ppb_transport_thunk = {
89 &Create, 97 &Create,
90 &IsTransport, 98 &IsTransport,
91 &IsWritable, 99 &IsWritable,
100 &SetProperty,
92 &Connect, 101 &Connect,
93 &GetNextAddress, 102 &GetNextAddress,
94 &ReceiveRemoteAddress, 103 &ReceiveRemoteAddress,
95 &Recv, 104 &Recv,
96 &Send, 105 &Send,
97 &Close, 106 &Close,
98 }; 107 };
99 108
100 } // namespace 109 } // namespace
101 110
102 const PPB_Transport_Dev* GetPPB_Transport_Thunk() { 111 const PPB_Transport_Dev* GetPPB_Transport_Thunk() {
103 return &g_ppb_transport_thunk; 112 return &g_ppb_transport_thunk;
104 } 113 }
105 114
106 } // namespace thunk 115 } // namespace thunk
107 } // namespace ppapi 116 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_transport_api.h ('k') | webkit/glue/p2p_transport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698