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

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

Issue 8511032: Make the Pepper Flash net address just private, not Flash-specific. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/private/ppb_flash_net_connector.h" 5 #include "ppapi/c/private/ppb_flash_net_connector.h"
6 #include "ppapi/c/pp_completion_callback.h" 6 #include "ppapi/c/pp_completion_callback.h"
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/thunk/common.h" 8 #include "ppapi/thunk/common.h"
9 #include "ppapi/thunk/enter.h" 9 #include "ppapi/thunk/enter.h"
10 #include "ppapi/thunk/thunk.h" 10 #include "ppapi/thunk/thunk.h"
(...skipping 14 matching lines...) Expand all
25 25
26 PP_Bool IsFlashNetConnector(PP_Resource resource) { 26 PP_Bool IsFlashNetConnector(PP_Resource resource) {
27 EnterResource<PPB_Flash_NetConnector_API> enter(resource, false); 27 EnterResource<PPB_Flash_NetConnector_API> enter(resource, false);
28 return PP_FromBool(enter.succeeded()); 28 return PP_FromBool(enter.succeeded());
29 } 29 }
30 30
31 int32_t ConnectTcp(PP_Resource resource, 31 int32_t ConnectTcp(PP_Resource resource,
32 const char* host, 32 const char* host,
33 uint16_t port, 33 uint16_t port,
34 PP_FileHandle* socket_out, 34 PP_FileHandle* socket_out,
35 PP_Flash_NetAddress* local_addr_out, 35 PP_NetAddress_Private* local_addr_out,
36 PP_Flash_NetAddress* remote_addr_out, 36 PP_NetAddress_Private* remote_addr_out,
37 PP_CompletionCallback callback) { 37 PP_CompletionCallback callback) {
38 EnterResource<PPB_Flash_NetConnector_API> enter(resource, true); 38 EnterResource<PPB_Flash_NetConnector_API> enter(resource, true);
39 if (enter.failed()) 39 if (enter.failed())
40 return MayForceCallback(callback, PP_ERROR_BADRESOURCE); 40 return MayForceCallback(callback, PP_ERROR_BADRESOURCE);
41 int32_t result = 41 int32_t result =
42 enter.object()->ConnectTcp(host, port, socket_out, local_addr_out, 42 enter.object()->ConnectTcp(host, port, socket_out, local_addr_out,
43 remote_addr_out, callback); 43 remote_addr_out, callback);
44 return MayForceCallback(callback, result); 44 return MayForceCallback(callback, result);
45 } 45 }
46 46
47 int32_t ConnectTcpAddress(PP_Resource resource, 47 int32_t ConnectTcpAddress(PP_Resource resource,
48 const PP_Flash_NetAddress* addr, 48 const PP_NetAddress_Private* addr,
49 PP_FileHandle* socket_out, 49 PP_FileHandle* socket_out,
50 PP_Flash_NetAddress* local_addr_out, 50 PP_NetAddress_Private* local_addr_out,
51 PP_Flash_NetAddress* remote_addr_out, 51 PP_NetAddress_Private* remote_addr_out,
52 PP_CompletionCallback callback) { 52 PP_CompletionCallback callback) {
53 EnterResource<PPB_Flash_NetConnector_API> enter(resource, true); 53 EnterResource<PPB_Flash_NetConnector_API> enter(resource, true);
54 if (enter.failed()) 54 if (enter.failed())
55 return MayForceCallback(callback, PP_ERROR_BADRESOURCE); 55 return MayForceCallback(callback, PP_ERROR_BADRESOURCE);
56 int32_t result = 56 int32_t result =
57 enter.object()->ConnectTcpAddress(addr, socket_out, local_addr_out, 57 enter.object()->ConnectTcpAddress(addr, socket_out, local_addr_out,
58 remote_addr_out, callback); 58 remote_addr_out, callback);
59 return MayForceCallback(callback, result); 59 return MayForceCallback(callback, result);
60 } 60 }
61 61
62 const PPB_Flash_NetConnector g_ppb_flash_net_connector_thunk = { 62 const PPB_Flash_NetConnector g_ppb_flash_net_connector_thunk = {
63 &Create, 63 &Create,
64 &IsFlashNetConnector, 64 &IsFlashNetConnector,
65 &ConnectTcp, 65 &ConnectTcp,
66 &ConnectTcpAddress 66 &ConnectTcpAddress
67 }; 67 };
68 68
69 } // namespace 69 } // namespace
70 70
71 const PPB_Flash_NetConnector* GetPPB_Flash_NetConnector_Thunk() { 71 const PPB_Flash_NetConnector* GetPPB_Flash_NetConnector_Thunk() {
72 return &g_ppb_flash_net_connector_thunk; 72 return &g_ppb_flash_net_connector_thunk;
73 } 73 }
74 74
75 } // namespace thunk 75 } // namespace thunk
76 } // namespace ppapi 76 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698