diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-05 15:33:20 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-05 15:33:20 +0000 |
commit | 3e74283ee49c1e1095868cc196f9b915f6c7c27e (patch) | |
tree | c1776d8f8380bdc345580c59f5294c38d1b3a01d /ppapi/api | |
parent | 908fbf459ed4ef66c0e7dc6fb59d63efde47c904 (diff) | |
download | chromium_src-3e74283ee49c1e1095868cc196f9b915f6c7c27e.zip chromium_src-3e74283ee49c1e1095868cc196f9b915f6c7c27e.tar.gz chromium_src-3e74283ee49c1e1095868cc196f9b915f6c7c27e.tar.bz2 |
Convert transport, scrollbar, and query policy to IDL.
This renames the scrollbar interface to not use the version number to make
it consistent with other APIs.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/8142001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104102 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/api')
-rw-r--r-- | ppapi/api/dev/ppb_query_policy_dev.idl | 26 | ||||
-rw-r--r-- | ppapi/api/dev/ppb_scrollbar_dev.idl | 82 | ||||
-rw-r--r-- | ppapi/api/dev/ppb_transport_dev.idl | 183 | ||||
-rw-r--r-- | ppapi/api/dev/ppp_policy_update_dev.idl | 27 |
4 files changed, 318 insertions, 0 deletions
diff --git a/ppapi/api/dev/ppb_query_policy_dev.idl b/ppapi/api/dev/ppb_query_policy_dev.idl new file mode 100644 index 0000000..5d6bdf2 --- /dev/null +++ b/ppapi/api/dev/ppb_query_policy_dev.idl @@ -0,0 +1,26 @@ +/* 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 <code>PPB_QueryPolicy_Dev</code> interface. + */ +label Chrome { + M14 = 0.1 +}; + +interface PPB_QueryPolicy_Dev { + /** + * Subscribes the instance to receive updates via the + * <code>PPP_PolicyUpdate_Dev</code> interface. + * + * The plugin is guaranteed to get one update immediately via the + * <code>PP_PolicyUpdate_Dev</code> interface. This allows the plugin to + * retrieve the current policy when subscribing for the first time. + * + * @param[in] instance A <code>PP_Instance</code> indentifying one instance + * of a module. + */ + void SubscribeToPolicyUpdates([in] PP_Instance instance); +}; diff --git a/ppapi/api/dev/ppb_scrollbar_dev.idl b/ppapi/api/dev/ppb_scrollbar_dev.idl new file mode 100644 index 0000000..5700f7d --- /dev/null +++ b/ppapi/api/dev/ppb_scrollbar_dev.idl @@ -0,0 +1,82 @@ +/* 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 <code>PPB_Buffer_Dev</code> interface. + */ +label Chrome { + M14 = 0.5 +}; + +[assert_size(4)] +enum PP_ScrollBy_Dev { + PP_SCROLLBY_PIXEL = 0, + PP_SCROLLBY_LINE = 1, + PP_SCROLLBY_PAGE = 2, + PP_SCROLLBY_DOCUMENT = 3 +}; + +/** + * The interface for a scrollbar. A scrollbar is a widget, so the functions + * in PPB_Widget can also be used with scrollbar objects. + */ +interface PPB_Scrollbar_Dev { + /** + * Create a new scrollbar. Returns 0 if the instance is invalid. + */ + PP_Resource Create([in] PP_Instance instance, + [in] PP_Bool vertical); + + /** + * Returns PP_TRUE if the given resource is a Scrollbar. Returns PP_FALSE if + * the resource is invalid or some type other than a scrollbar. + */ + PP_Bool IsScrollbar([in] PP_Resource resource); + + /** + * Gets the thickness of a scrollbar. + */ + uint32_t GetThickness([in] PP_Resource resource); + + /** + * Returns PP_TRUE if the system scrollbar style is an overlap scrollbar. + */ + PP_Bool IsOverlay([in] PP_Resource scrollbar); + + /** + * Gets the value of the scrollbar. + */ + uint32_t GetValue([in] PP_Resource scrollbar); + + /** + * Sets the value of the scrollbar. + */ + void SetValue([in] PP_Resource scrollbar, + [in] uint32_t value); + + /** + * Set the document size (i.e. total length of the region that's being + * scrolled). + */ + void SetDocumentSize([in] PP_Resource scrollbar, + [in] uint32_t size); + + /** + * Updates the tickmarks. Only valid for vertical scrollbars. "tick_marks" + * contains "count" PP_Rect objects. + */ + void SetTickMarks([in] PP_Resource scrollbar, + [in, size_as=count] PP_Rect[] tick_marks, + [in] uint32_t count); + + /** + * Scroll by "multiplier" pixels/lines/pages units. Positive values are + * forward and negative are backward. If "unit" is document then any positive + * value goes to the end while any negative value goes to the beginning. + */ + void ScrollBy([in] PP_Resource scrollbar, + [in] PP_ScrollBy_Dev unit, + [in] int32_t multiplier); +}; diff --git a/ppapi/api/dev/ppb_transport_dev.idl b/ppapi/api/dev/ppb_transport_dev.idl new file mode 100644 index 0000000..30beb00 --- /dev/null +++ b/ppapi/api/dev/ppb_transport_dev.idl @@ -0,0 +1,183 @@ +/* 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 <code>PPB_Transport_Dev</code> interface. + */ +label Chrome { + M14 = 0.7 +}; + +[assert_size(4)] +enum PP_TransportType { + PP_TRANSPORTTYPE_DATAGRAM = 0, + PP_TRANSPORTTYPE_STREAM = 1 +}; + +[assert_size(4)] +enum PP_TransportProperty { + /** + * STUN server address and port, e.g "stun.example.com:19302". + */ + PP_TRANSPORTPROPERTY_STUN_SERVER = 0, + + /** + * Relay server address and port, e.g. "relay.example.com:12344". + */ + PP_TRANSPORTPROPERTY_RELAY_SERVER = 1, + + /** + * Username for the relay server. + */ + PP_TRANSPORTPROPERTY_RELAY_USERNAME = 2, + + /** + * Password for the relay server. + */ + PP_TRANSPORTPROPERTY_RELAY_PASSWORD = 3, + + /** + * Type of Relay server. Must be one of the PP_TransportRelayMode values. By + * default is set to PP_TRANSPORTRELAYMODE_TURN. + */ + PP_TRANSPORTPROPERTY_RELAY_MODE = 4, + + /** + * TCP receive window in bytes. Takes effect only for PseudoTCP connections. + */ + PP_TRANSPORTPROPERTY_TCP_RECEIVE_WINDOW = 5, + + /** + * TCP send window in bytes. Takes effect only for PseudoTCP connections. + */ + PP_TRANSPORTPROPERTY_TCP_SEND_WINDOW = 6, + + /** + * Boolean value that disables Neagle's algorithm when set to true. When + * Neagle's algorithm is disabled, all outgoing packets are sent as soon as + * possible. When set to false (by default) data may be buffered until there + * is a sufficient amount to send. + */ + PP_TRANSPORTPROPERTY_TCP_NO_DELAY = 7, + + /** + * Delay for ACK packets in milliseconds. By default set to 100ms. + */ + PP_TRANSPORTPROPERTY_TCP_ACK_DELAY = 8, + + /** + * Boolean value that disables TCP-based transports when set to true. By + * default set to false. + */ + PP_TRANSPORTPROPERTY_DISABLE_TCP_TRANSPORT = 9 +}; + +[assert_size(4)] +enum PP_TransportRelayMode { + /** + * RFC5766 compliant relay server. + */ + PP_TRANSPORTRELAYMODE_TURN = 0, + + /** + * Legacy Google relay server. + */ + PP_TRANSPORTRELAYMODE_GOOGLE = 1 +}; + +/** + * The transport interface provides peer-to-peer communication. + * + * TODO(juberti): other getters/setters + * connect state + * connect type, protocol + * RTT + */ +interface PPB_Transport_Dev { + /** + * Creates a new transport object with the specified name using the + * specified protocol. + */ + PP_Resource CreateTransport( + [in] PP_Instance instance, + [in] str_t name, + [in] PP_TransportType type); + + /** + * Returns PP_TRUE if resource is a Transport, PP_FALSE otherwise. + */ + PP_Bool IsTransport( + [in] PP_Resource resource); + + /** + * Returns PP_TRUE if the transport is currently writable (i.e. can + * send data to the remote peer), PP_FALSE otherwise. + */ + PP_Bool IsWritable( + [in] PP_Resource transport); + + /** + * Sets various configuration properties of the transport. + */ + int32_t SetProperty( + [in] PP_Resource transport, + [in] PP_TransportProperty property, + [in] PP_Var value); + + /** + * Establishes a connection to the remote peer. Returns + * PP_OK_COMPLETIONPENDING and notifies on |cb| when connectivity is + * established (or timeout occurs). + */ + int32_t Connect( + [in] PP_Resource transport, + [in] PP_CompletionCallback cb); + + /** + * Obtains another ICE candidate address to be provided to the + * remote peer. Returns PP_OK_COMPLETIONPENDING if there are no more + * addresses to be sent. After the callback is called + * GetNextAddress() must be called again to get the address. + */ + int32_t GetNextAddress( + [in] PP_Resource transport, + [out] PP_Var address, + [in] PP_CompletionCallback cb); + + /** + * Provides an ICE candidate address that was received from the remote peer. + */ + int32_t ReceiveRemoteAddress( + [in] PP_Resource transport, + [in] PP_Var address); + + /** + * Like recv(), receives data. Returns PP_OK_COMPLETIONPENDING if there is + * currently no data to receive. In that case, the |data| pointer should + * remain valid until the callback is called. + */ + int32_t Recv( + [in] PP_Resource transport, + [out] mem_t data, + [in] uint32_t len, + [in] PP_CompletionCallback cb); + + /** + * Like send(), sends data. Returns PP_OK_COMPLETIONPENDING if the socket is + * currently flow-controlled. In that case, the |data| pointer should remain + * valid until the callback is called. + */ + int32_t Send( + [in] PP_Resource transport, + [in] mem_t data, + [in] uint32_t len, + [in] PP_CompletionCallback cb); + + /** + * Disconnects from the remote peer. + */ + int32_t Close( + [in] PP_Resource transport); +}; diff --git a/ppapi/api/dev/ppp_policy_update_dev.idl b/ppapi/api/dev/ppp_policy_update_dev.idl new file mode 100644 index 0000000..f2f7512 --- /dev/null +++ b/ppapi/api/dev/ppp_policy_update_dev.idl @@ -0,0 +1,27 @@ +/* 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 <code>PPP_PolicyUpdate_Dev</code> interface. + */ + +label Chrome { + M14 = 0.1 +}; + +interface PPP_PolicyUpdate_Dev { + /** + * Signals that the policy has been updated, and provides it via a JSON + * string. + * + * @param[in] instance A <code>PP_Instance</code> indentifying one instance + * of a module. + * @param[in] A <code>PP_Var</code> with a JSON string representing the + * encoded policy. + */ + void PolicyUpdated( + [in] PP_Instance instance, + [in] PP_Var policy_json); +}; |