summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authornoelallen@google.com <noelallen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-18 22:34:24 +0000
committernoelallen@google.com <noelallen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-18 22:34:24 +0000
commit16168b97e7fabf060fa95a5372ce38107acec08b (patch)
tree5c82cae7650d7d5dfcd1ce8548e914f23791566e /ppapi
parent282608ba39abff75fa997d9ce604f394d5083d04 (diff)
downloadchromium_src-16168b97e7fabf060fa95a5372ce38107acec08b.zip
chromium_src-16168b97e7fabf060fa95a5372ce38107acec08b.tar.gz
chromium_src-16168b97e7fabf060fa95a5372ce38107acec08b.tar.bz2
More trivial cleanupi of ppapi/c/trusted headers
BUG= http://code.google.com/p/chromium/issues/detail?id=76271 TEST= run try Review URL: http://codereview.chromium.org/7396002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92914 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/c/trusted/ppb_audio_trusted.h34
-rw-r--r--ppapi/c/trusted/ppb_broker_trusted.h24
-rw-r--r--ppapi/c/trusted/ppb_buffer_trusted.h25
-rw-r--r--ppapi/c/trusted/ppb_file_io_trusted.h69
-rw-r--r--ppapi/c/trusted/ppb_image_data_trusted.h27
-rw-r--r--ppapi/c/trusted/ppb_url_loader_trusted.h87
-rw-r--r--ppapi/c/trusted/ppp_broker.h24
7 files changed, 205 insertions, 85 deletions
diff --git a/ppapi/c/trusted/ppb_audio_trusted.h b/ppapi/c/trusted/ppb_audio_trusted.h
index cac02f2..92076d3 100644
--- a/ppapi/c/trusted/ppb_audio_trusted.h
+++ b/ppapi/c/trusted/ppb_audio_trusted.h
@@ -2,25 +2,40 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#ifndef PPAPI_C_PPB_AUDIO_TRUSTED_H_
-#define PPAPI_C_PPB_AUDIO_TRUSTED_H_
+
+/* From trusted/ppb_audio_trusted.idl modified Sat Jul 16 16:51:03 2011. */
+
+#ifndef PPAPI_C_TRUSTED_PPB_AUDIO_TRUSTED_H_
+#define PPAPI_C_TRUSTED_PPB_AUDIO_TRUSTED_H_
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_resource.h"
+#include "ppapi/c/pp_stdint.h"
-#define PPB_AUDIO_TRUSTED_INTERFACE "PPB_AudioTrusted;0.6"
+/**
+ * @file
+ * This file defines the trusted audio interface.
+ */
+
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
/**
* This interface is to be used by proxy implementations. All
* functions should be called from the main thread only. The
* resource returned is an Audio resource; most of the PPB_Audio
* interface is also usable on this resource.
*/
+#define PPB_AUDIO_TRUSTED_INTERFACE_0_6 "PPB_AudioTrusted;0.6"
+#define PPB_AUDIO_TRUSTED_INTERFACE PPB_AUDIO_TRUSTED_INTERFACE_0_6
+
struct PPB_AudioTrusted {
/** Returns an audio resource. */
PP_Resource (*CreateTrusted)(PP_Instance instance);
-
/**
* Opens a paused audio interface, used by trusted side of proxy.
* Returns PP_ERROR_WOULD_BLOCK on success, and invokes
@@ -28,15 +43,14 @@ struct PPB_AudioTrusted {
* As this function should always be invoked from the main thread,
* do not use the blocking variant of PP_CompletionCallback.
*/
- int32_t (*Open)(PP_Resource audio, PP_Resource config,
+ int32_t (*Open)(PP_Resource audio,
+ PP_Resource config,
struct PP_CompletionCallback create_callback);
-
/**
* Get the sync socket. Use once Open has completed.
* Returns PP_OK on success.
*/
int32_t (*GetSyncSocket)(PP_Resource audio, int* sync_socket);
-
/**
* Get the shared memory interface. Use once Open has completed.
* Returns PP_OK on success.
@@ -45,5 +59,9 @@ struct PPB_AudioTrusted {
int* shm_handle,
uint32_t* shm_size);
};
+/**
+ * @}
+ */
+
+#endif /* PPAPI_C_TRUSTED_PPB_AUDIO_TRUSTED_H_ */
-#endif /* PPAPI_C_PPB_AUDIO_TRUSTED_H_ */
diff --git a/ppapi/c/trusted/ppb_broker_trusted.h b/ppapi/c/trusted/ppb_broker_trusted.h
index 5cf091f..ed4e372 100644
--- a/ppapi/c/trusted/ppb_broker_trusted.h
+++ b/ppapi/c/trusted/ppb_broker_trusted.h
@@ -2,15 +2,18 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#ifndef PPAPI_C_PPB_BROKER_TRUSTED_H_
-#define PPAPI_C_PPB_BROKER_TRUSTED_H_
-#include "ppapi/c/pp_completion_callback.h"
+/* From trusted/ppb_broker_trusted.idl modified Sat Jul 16 16:51:03 2011. */
+
+#ifndef PPAPI_C_TRUSTED_PPB_BROKER_TRUSTED_H_
+#define PPAPI_C_TRUSTED_PPB_BROKER_TRUSTED_H_
+
#include "ppapi/c/pp_bool.h"
+#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_resource.h"
-
-#define PPB_BROKER_TRUSTED_INTERFACE "PPB_BrokerTrusted;0.2"
+#include "ppapi/c/pp_stdint.h"
/**
* @file
@@ -18,11 +21,11 @@
* access to a trusted broker with greater privileges than the plugin.
*/
+
/**
* @addtogroup Interfaces
* @{
*/
-
/**
* The PPB_BrokerTrusted interface provides access to a trusted broker
* with greater privileges than the plugin. The interface only supports
@@ -34,17 +37,18 @@
* handle is closed. The handle should be closed before the resource is
* released.
*/
+#define PPB_BROKER_TRUSTED_INTERFACE_0_2 "PPB_BrokerTrusted;0.2"
+#define PPB_BROKER_TRUSTED_INTERFACE PPB_BROKER_TRUSTED_INTERFACE_0_2
+
struct PPB_BrokerTrusted {
/**
* Returns a trusted broker resource.
*/
PP_Resource (*CreateTrusted)(PP_Instance instance);
-
/**
* Returns true if the resource is a trusted broker.
*/
PP_Bool (*IsBrokerTrusted)(PP_Resource resource);
-
/**
* Connects to the trusted broker. It may have already
* been launched by another instance.
@@ -61,7 +65,6 @@ struct PPB_BrokerTrusted {
*/
int32_t (*Connect)(PP_Resource broker,
struct PP_CompletionCallback connect_callback);
-
/**
* Gets the handle to the pipe. Use once Connect has completed. Each instance
* of this interface has its own pipe.
@@ -76,4 +79,5 @@ struct PPB_BrokerTrusted {
* @}
*/
-#endif /* PPAPI_C_PPB_BROKER_TRUSTED_H_ */
+#endif /* PPAPI_C_TRUSTED_PPB_BROKER_TRUSTED_H_ */
+
diff --git a/ppapi/c/trusted/ppb_buffer_trusted.h b/ppapi/c/trusted/ppb_buffer_trusted.h
index d8568c5..5cd1b3a 100644
--- a/ppapi/c/trusted/ppb_buffer_trusted.h
+++ b/ppapi/c/trusted/ppb_buffer_trusted.h
@@ -2,13 +2,28 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
+/* From trusted/ppb_buffer_trusted.idl modified Fri Jul 15 13:34:45 2011. */
+
#ifndef PPAPI_C_TRUSTED_PPB_BUFFER_TRUSTED_H_
#define PPAPI_C_TRUSTED_PPB_BUFFER_TRUSTED_H_
-#include "ppapi/c/pp_stdint.h"
+#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_resource.h"
+#include "ppapi/c/pp_stdint.h"
+
+/**
+ * @file
+ * This file defines the trusted buffer interface.
+ */
+
-#define PPB_BUFFER_TRUSTED_INTERFACE "PPB_BufferTrusted;0.1"
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
+#define PPB_BUFFER_TRUSTED_INTERFACE_0_1 "PPB_BufferTrusted;0.1"
+#define PPB_BUFFER_TRUSTED_INTERFACE PPB_BUFFER_TRUSTED_INTERFACE_0_1
struct PPB_BufferTrusted {
/**
@@ -20,5 +35,9 @@ struct PPB_BufferTrusted {
*/
int32_t (*GetSharedMemory)(PP_Resource buffer, int* handle);
};
+/**
+ * @}
+ */
+
+#endif /* PPAPI_C_TRUSTED_PPB_BUFFER_TRUSTED_H_ */
-#endif // PPAPI_C_TRUSTED_PPB_BUFFER_TRUSTED_H_
diff --git a/ppapi/c/trusted/ppb_file_io_trusted.h b/ppapi/c/trusted/ppb_file_io_trusted.h
index 766ed3f..6e684c3 100644
--- a/ppapi/c/trusted/ppb_file_io_trusted.h
+++ b/ppapi/c/trusted/ppb_file_io_trusted.h
@@ -2,47 +2,68 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#ifndef PPAPI_C_PPB_FILE_IO_TRUSTED_H_
-#define PPAPI_C_PPB_FILE_IO_TRUSTED_H_
+/* From trusted/ppb_file_io_trusted.idl modified Mon Jul 18 10:45:10 2011. */
+
+#ifndef PPAPI_C_TRUSTED_PPB_FILE_IO_TRUSTED_H_
+#define PPAPI_C_TRUSTED_PPB_FILE_IO_TRUSTED_H_
+
+#include "ppapi/c/pp_completion_callback.h"
+#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_stdint.h"
-struct PP_CompletionCallback;
+/**
+ * @file
+ *
+ * This file defines the trusted file IO interface
+ */
+
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
+/* Available only to trusted implementations. */
#define PPB_FILEIOTRUSTED_INTERFACE_0_4 "PPB_FileIOTrusted;0.4"
#define PPB_FILEIOTRUSTED_INTERFACE PPB_FILEIOTRUSTED_INTERFACE_0_4
-// Available only to trusted implementations.
struct PPB_FileIOTrusted {
- // Returns a file descriptor corresponding to the given FileIO object. On
- // Windows, returns a HANDLE; on all other platforms, returns a POSIX file
- // descriptor. The FileIO object must have been opened with a successful
- // call to FileIO::Open. The file descriptor will be closed automatically
- // when the FileIO object is closed or destroyed.
+ /**
+ * Returns a file descriptor corresponding to the given FileIO object. On
+ * Windows, returns a HANDLE; on all other platforms, returns a POSIX file
+ * descriptor. The FileIO object must have been opened with a successful
+ * call to FileIO::Open. The file descriptor will be closed automatically
+ * when the FileIO object is closed or destroyed.
+ */
int32_t (*GetOSFileDescriptor)(PP_Resource file_io);
-
- // Notifies the browser that underlying file will be modified. This gives
- // the browser the opportunity to apply quota restrictions and possibly
- // return an error to indicate that the write is not allowed.
+ /**
+ * Notifies the browser that underlying file will be modified. This gives
+ * the browser the opportunity to apply quota restrictions and possibly
+ * return an error to indicate that the write is not allowed.
+ */
int32_t (*WillWrite)(PP_Resource file_io,
int64_t offset,
int32_t bytes_to_write,
struct PP_CompletionCallback callback);
-
- // Notifies the browser that underlying file will be modified. This gives
- // the browser the opportunity to apply quota restrictions and possibly
- // return an error to indicate that the write is not allowed.
+ /**
+ * Notifies the browser that underlying file will be modified. This gives
+ * the browser the opportunity to apply quota restrictions and possibly
+ * return an error to indicate that the write is not allowed.
+ *
+ * TODO(darin): Maybe unify the above into a single WillChangeFileSize
+ * method? The above methods have the advantage of mapping to PPB_FileIO
+ * Write and SetLength calls. WillChangeFileSize would require the caller to
+ * compute the file size resulting from a Write call, which may be
+ * undesirable.
+ */
int32_t (*WillSetLength)(PP_Resource file_io,
int64_t length,
struct PP_CompletionCallback callback);
-
- // TODO(darin): Maybe unify the above into a single WillChangeFileSize
- // method? The above methods have the advantage of mapping to PPB_FileIO
- // Write and SetLength calls. WillChangeFileSize would require the caller to
- // compute the file size resulting from a Write call, which may be
- // undesirable.
};
+/**
+ * @}
+ */
-#endif /* PPAPI_C_PPB_FILE_IO_TRUSTED_H_ */
+#endif /* PPAPI_C_TRUSTED_PPB_FILE_IO_TRUSTED_H_ */
diff --git a/ppapi/c/trusted/ppb_image_data_trusted.h b/ppapi/c/trusted/ppb_image_data_trusted.h
index c8ad889..00bef7d 100644
--- a/ppapi/c/trusted/ppb_image_data_trusted.h
+++ b/ppapi/c/trusted/ppb_image_data_trusted.h
@@ -1,14 +1,30 @@
-/* Copyright (c) 2010 The Chromium Authors. All rights reserved.
+/* 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.
*/
+
+/* From trusted/ppb_image_data_trusted.idl modified Sat Jul 16 16:51:03 2011. */
+
#ifndef PPAPI_C_TRUSTED_PPB_IMAGE_DATA_TRUSTED_H_
#define PPAPI_C_TRUSTED_PPB_IMAGE_DATA_TRUSTED_H_
-#include "ppapi/c/pp_stdint.h"
+#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_resource.h"
+#include "ppapi/c/pp_stdint.h"
-#define PPB_IMAGEDATA_TRUSTED_INTERFACE "PPB_ImageDataTrusted;0.4"
+/**
+ * @file
+ * This file defines the trusted ImageData interface.
+ */
+
+
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
+/** Trusted interface */
+#define PPB_IMAGEDATA_TRUSTED_INTERFACE_0_4 "PPB_ImageDataTrusted;0.4"
+#define PPB_IMAGEDATA_TRUSTED_INTERFACE PPB_IMAGEDATA_TRUSTED_INTERFACE_0_4
struct PPB_ImageDataTrusted {
/**
@@ -22,6 +38,9 @@ struct PPB_ImageDataTrusted {
int* handle,
uint32_t* byte_count);
};
+/**
+ * @}
+ */
-#endif // PPAPI_C_TRUSTED_PPB_IMAGE_DATA_TRUSTED_H_
+#endif /* PPAPI_C_TRUSTED_PPB_IMAGE_DATA_TRUSTED_H_ */
diff --git a/ppapi/c/trusted/ppb_url_loader_trusted.h b/ppapi/c/trusted/ppb_url_loader_trusted.h
index f37a14b..e5ced68 100644
--- a/ppapi/c/trusted/ppb_url_loader_trusted.h
+++ b/ppapi/c/trusted/ppb_url_loader_trusted.h
@@ -1,46 +1,75 @@
-/* Copyright (c) 2010 The Chromium Authors. All rights reserved.
+/* 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.
*/
-#ifndef PPAPI_C_PPB_URL_LOADER_TRUSTED_H_
-#define PPAPI_C_PPB_URL_LOADER_TRUSTED_H_
+
+/* From trusted/ppb_url_loader_trusted.idl modified Sat Jul 16 16:51:03 2011. */
+
+#ifndef PPAPI_C_TRUSTED_PPB_URL_LOADER_TRUSTED_H_
+#define PPAPI_C_TRUSTED_PPB_URL_LOADER_TRUSTED_H_
#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_stdint.h"
-#define PPB_URLLOADERTRUSTED_INTERFACE "PPB_URLLoaderTrusted;0.3"
+/**
+ * @file
+ * URL loader trusted interfaces. */
+
-// Callback that indicates the status of the download and upload for the
-// given URLLoader resource.
+/**
+ * @addtogroup Typedefs
+ * @{
+ */
+/**
+ * Callback that indicates the status of the download and upload for the
+ * given URLLoader resource.
+ */
typedef void (*PP_URLLoaderTrusted_StatusCallback)(
- PP_Instance pp_instance,
- PP_Resource pp_resource,
- int64_t bytes_sent,
- int64_t total_bytes_to_be_sent,
- int64_t bytes_received,
- int64_t total_bytes_to_be_received);
-
-// Available only to trusted implementations.
+ PP_Instance pp_instance,
+ PP_Resource pp_resource,
+ int64_t bytes_sent,
+ int64_t total_bytes_to_be_sent,
+ int64_t bytes_received,
+ int64_t total_bytes_to_be_received);
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup Interfaces
+ * @{
+ */
+/* Available only to trusted implementations. */
+#define PPB_URLLOADERTRUSTED_INTERFACE_0_3 "PPB_URLLoaderTrusted;0.3"
+#define PPB_URLLOADERTRUSTED_INTERFACE PPB_URLLOADERTRUSTED_INTERFACE_0_3
+
struct PPB_URLLoaderTrusted {
- // Grant this URLLoader the capability to make unrestricted cross-origin
- // requests.
+ /**
+ * Grant this URLLoader the capability to make unrestricted cross-origin
+ * requests.
+ */
void (*GrantUniversalAccess)(PP_Resource loader);
-
- // Registers that the given function will be called when the upload or
- // downloaded byte count has changed. This is not exposed on the untrusted
- // interface because it can be quite chatty and encourages people to write
- // feedback UIs that update as frequently as the progress updates.
- //
- // The other serious gotcha with this callback is that the callback must not
- // mutate the URL loader or cause it to be destroyed.
- //
- // However, the proxy layer needs this information to push to the other
- // process, so we expose it here. Only one callback can be set per URL
- // Loader. Setting to a NULL callback will disable it.
+ /**
+ * Registers that the given function will be called when the upload or
+ * downloaded byte count has changed. This is not exposed on the untrusted
+ * interface because it can be quite chatty and encourages people to write
+ * feedback UIs that update as frequently as the progress updates.
+ *
+ * The other serious gotcha with this callback is that the callback must not
+ * mutate the URL loader or cause it to be destroyed.
+ *
+ * However, the proxy layer needs this information to push to the other
+ * process, so we expose it here. Only one callback can be set per URL
+ * Loader. Setting to a NULL callback will disable it.
+ */
void (*RegisterStatusCallback)(PP_Resource loader,
PP_URLLoaderTrusted_StatusCallback cb);
};
+/**
+ * @}
+ */
-#endif // PPAPI_C_PPB_URL_LOADER_H_
+#endif /* PPAPI_C_TRUSTED_PPB_URL_LOADER_TRUSTED_H_ */
diff --git a/ppapi/c/trusted/ppp_broker.h b/ppapi/c/trusted/ppp_broker.h
index 923c1828..ccd6706 100644
--- a/ppapi/c/trusted/ppp_broker.h
+++ b/ppapi/c/trusted/ppp_broker.h
@@ -2,25 +2,34 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
+/* From trusted/ppp_broker.idl modified Sat Jul 16 16:51:03 2011. */
+
#ifndef PPAPI_C_TRUSTED_PPP_BROKER_H_
#define PPAPI_C_TRUSTED_PPP_BROKER_H_
+#include "ppapi/c/pp_macros.h"
+
+/**
+ * @file
+ * This file defines functions that your module must implement to support a
+ * broker.
+ */
+
+
+// {PENDING: undefine PP_EXPORT?}
+
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_stdint.h"
+
#if __GNUC__ >= 4
+
#define PP_EXPORT __attribute__ ((visibility("default")))
#elif defined(_MSC_VER)
#define PP_EXPORT __declspec(dllexport)
#endif
-/**
- * @file
- * This file defines functions that your module must implement to support a
- * broker.
- */
-
-// {PENDING: undefine PP_EXPORT?}
/* We don't want name mangling for these external functions. We only need
@@ -90,3 +99,4 @@ PP_EXPORT void PPP_ShutdownBroker();
#endif
#endif /* PPAPI_C_TRUSTED_PPP_BROKER_H_ */
+