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

Side by Side Diff: ppapi/cpp/private/flash_net_connector.cc

Issue 9836131: Remove PPB_Flash_NetConnector and ENABLE_FLAPPER_HACKS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/cpp/private/flash_net_connector.h ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ppapi/cpp/private/flash_net_connector.h"
6
7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/cpp/completion_callback.h"
9 #include "ppapi/cpp/instance_handle.h"
10 #include "ppapi/cpp/module.h"
11 #include "ppapi/cpp/module_impl.h"
12
13 namespace pp {
14
15 namespace {
16
17 template <> const char* interface_name<PPB_Flash_NetConnector>() {
18 return PPB_FLASH_NETCONNECTOR_INTERFACE;
19 }
20
21 } // namespace
22
23 namespace flash {
24
25 NetConnector::NetConnector(const InstanceHandle& instance) {
26 if (has_interface<PPB_Flash_NetConnector>()) {
27 PassRefFromConstructor(get_interface<PPB_Flash_NetConnector>()->Create(
28 instance.pp_instance()));
29 }
30 }
31
32 int32_t NetConnector::ConnectTcp(const char* host,
33 uint16_t port,
34 PP_FileHandle* socket_out,
35 PP_NetAddress_Private* local_addr_out,
36 PP_NetAddress_Private* remote_addr_out,
37 const CompletionCallback& cc) {
38 if (!has_interface<PPB_Flash_NetConnector>())
39 return cc.MayForce(PP_ERROR_NOINTERFACE);
40 return get_interface<PPB_Flash_NetConnector>()->ConnectTcp(
41 pp_resource(),
42 host, port,
43 socket_out, local_addr_out, remote_addr_out,
44 cc.pp_completion_callback());
45 }
46
47 int32_t NetConnector::ConnectTcpAddress(const PP_NetAddress_Private* addr,
48 PP_FileHandle* socket_out,
49 PP_NetAddress_Private* local_addr_out,
50 PP_NetAddress_Private* remote_addr_out,
51 const CompletionCallback& cc) {
52 if (!has_interface<PPB_Flash_NetConnector>())
53 return cc.MayForce(PP_ERROR_NOINTERFACE);
54 return get_interface<PPB_Flash_NetConnector>()->ConnectTcpAddress(
55 pp_resource(),
56 addr,
57 socket_out, local_addr_out, remote_addr_out,
58 cc.pp_completion_callback());
59 }
60
61 } // namespace flash
62 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/private/flash_net_connector.h ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698