From 6903130df04c68841a9815be736a6b4eb5b393c1 Mon Sep 17 00:00:00 2001 From: "viettrungluu@chromium.org" Date: Wed, 9 Nov 2011 01:53:23 +0000 Subject: Re-land r109086: Add private Pepper API for dealing with PP_Flash_NetAddress. [The Win components build was already fixed, and the broken unrevert reverted. The original review was here: http://codereview.chromium.org/8357030 .] BUG=none TEST=none Review URL: http://codereview.chromium.org/8496045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109165 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/api/private/ppb_flash_net_address.idl | 61 +++++++++++++++++++++++++++++ ppapi/api/private/ppb_flash_tcp_socket.idl | 10 ----- 2 files changed, 61 insertions(+), 10 deletions(-) create mode 100644 ppapi/api/private/ppb_flash_net_address.idl (limited to 'ppapi/api') diff --git a/ppapi/api/private/ppb_flash_net_address.idl b/ppapi/api/private/ppb_flash_net_address.idl new file mode 100644 index 0000000..012c024 --- /dev/null +++ b/ppapi/api/private/ppb_flash_net_address.idl @@ -0,0 +1,61 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the PPB_Flash_NetAddress interface. + */ + +label Chrome { + M17 = 0.1 +}; + +/** + * This is an opaque type holding a network address. + */ +[assert_size(132)] +struct PP_Flash_NetAddress { + uint32_t size; + char[128] data; +}; + +/** + * The PPB_Flash_NetAddress interface provides operations on + * network addresses. + */ +interface PPB_Flash_NetAddress { + /** + * Returns PP_TRUE if the two addresses are equal (host and port). + */ + PP_Bool AreEqual([in] PP_Flash_NetAddress addr1, + [in] PP_Flash_NetAddress addr2); + + /** + * Returns PP_TRUE if the two addresses refer to the same host. + */ + PP_Bool AreHostsEqual([in] PP_Flash_NetAddress addr1, + [in] PP_Flash_NetAddress addr2); + + /** + * Returns a human-readable description of the network address, optionally + * including the port (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"), + * or an undefined var on failure. + */ + PP_Var Describe([in] PP_Module module, + [in] PP_Flash_NetAddress addr, + [in] PP_Bool include_port); + + /** + * Replaces the port in the given source address. Returns PP_TRUE on success. + */ + PP_Bool ReplacePort([in] PP_Flash_NetAddress src_addr, + [in] uint16_t port, + [out] PP_Flash_NetAddress dest_addr); + + /** + * Gets the "any" address (for IPv4 or IPv6); for use with UDP Bind. + */ + void GetAnyAddress([in] PP_Bool is_ipv6, + [out] PP_Flash_NetAddress addr); +}; diff --git a/ppapi/api/private/ppb_flash_tcp_socket.idl b/ppapi/api/private/ppb_flash_tcp_socket.idl index 7a8c4ca..e832809 100644 --- a/ppapi/api/private/ppb_flash_tcp_socket.idl +++ b/ppapi/api/private/ppb_flash_tcp_socket.idl @@ -12,15 +12,6 @@ label Chrome { }; /** - * This is an opaque type holding a network address. - */ -[assert_size(132)] -struct PP_Flash_NetAddress { - uint32_t size; - char[128] data; -}; - -/** * The PPB_Flash_TCPSocket interface provides TCP socket * operations. */ @@ -121,4 +112,3 @@ interface PPB_Flash_TCPSocket { */ void Disconnect([in] PP_Resource tcp_socket); }; - -- cgit v1.1