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

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

Issue 6899055: PPAPI: Force async callback invocation option. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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_menu.cc ('k') | ppapi/cpp/url_loader.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 // TODO(viettrungluu): See the comment in corresponding .h file. 5 // TODO(viettrungluu): See the comment in corresponding .h file.
6 6
7 #include "ppapi/cpp/private/flash_net_connector.h" 7 #include "ppapi/cpp/private/flash_net_connector.h"
8 8
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/cpp/completion_callback.h" 10 #include "ppapi/cpp/completion_callback.h"
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 } 32 }
33 33
34 int32_t NetConnector::ConnectTcp(const char* host, 34 int32_t NetConnector::ConnectTcp(const char* host,
35 uint16_t port, 35 uint16_t port,
36 PP_FileHandle* socket_out, 36 PP_FileHandle* socket_out,
37 PP_Flash_NetAddress* local_addr_out, 37 PP_Flash_NetAddress* local_addr_out,
38 PP_Flash_NetAddress* remote_addr_out, 38 PP_Flash_NetAddress* remote_addr_out,
39 const CompletionCallback& cc) { 39 const CompletionCallback& cc) {
40 if (!has_interface<PPB_Flash_NetConnector>()) 40 if (!has_interface<PPB_Flash_NetConnector>())
41 return PP_ERROR_NOINTERFACE; 41 return cc.MayForce(PP_ERROR_NOINTERFACE);
42 return get_interface<PPB_Flash_NetConnector>()->ConnectTcp( 42 return get_interface<PPB_Flash_NetConnector>()->ConnectTcp(
43 pp_resource(), 43 pp_resource(),
44 host, port, 44 host, port,
45 socket_out, local_addr_out, remote_addr_out, 45 socket_out, local_addr_out, remote_addr_out,
46 cc.pp_completion_callback()); 46 cc.pp_completion_callback());
47 } 47 }
48 48
49 int32_t NetConnector::ConnectTcpAddress(const PP_Flash_NetAddress* addr, 49 int32_t NetConnector::ConnectTcpAddress(const PP_Flash_NetAddress* addr,
50 PP_FileHandle* socket_out, 50 PP_FileHandle* socket_out,
51 PP_Flash_NetAddress* local_addr_out, 51 PP_Flash_NetAddress* local_addr_out,
52 PP_Flash_NetAddress* remote_addr_out, 52 PP_Flash_NetAddress* remote_addr_out,
53 const CompletionCallback& cc) { 53 const CompletionCallback& cc) {
54 if (!has_interface<PPB_Flash_NetConnector>()) 54 if (!has_interface<PPB_Flash_NetConnector>())
55 return PP_ERROR_NOINTERFACE; 55 return cc.MayForce(PP_ERROR_NOINTERFACE);
56 return get_interface<PPB_Flash_NetConnector>()->ConnectTcpAddress( 56 return get_interface<PPB_Flash_NetConnector>()->ConnectTcpAddress(
57 pp_resource(), 57 pp_resource(),
58 addr, 58 addr,
59 socket_out, local_addr_out, remote_addr_out, 59 socket_out, local_addr_out, remote_addr_out,
60 cc.pp_completion_callback()); 60 cc.pp_completion_callback());
61 } 61 }
62 62
63 } // namespace flash 63 } // namespace flash
64 } // namespace pp 64 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/private/flash_menu.cc ('k') | ppapi/cpp/url_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698