Commit 216326c6 authored by jond@google.com's avatar jond@google.com

Changed all @code to <code> and @endcode to </code> as per dmichael. Adding...

Changed all @code to <code> and @endcode to </code> as per dmichael. Adding Polina to the review to look at url_loader.h and give approval of text that points to example.
Review URL: http://codereview.chromium.org/7715005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98856 0039d316-1c4b-4281-b951-d872f2087c98
parent 5ce7b1d9
...@@ -15,7 +15,7 @@ label Chrome { ...@@ -15,7 +15,7 @@ label Chrome {
/** /**
* <code>PPB_Audio_Callback</code> defines the type of an audio callback * <code>PPB_Audio_Callback</code> defines the type of an audio callback
* function used to fill the audio buffer with data. Please see the * function used to fill the audio buffer with data. Please see the
* <code>Create()</code> function in the <code>PPB_Audio</code> interface for * Create() function in the <code>PPB_Audio</code> interface for
* more details on this callback. * more details on this callback.
*/ */
typedef void PPB_Audio_Callback([out] mem_t sample_buffer, typedef void PPB_Audio_Callback([out] mem_t sample_buffer,
...@@ -28,10 +28,12 @@ typedef void PPB_Audio_Callback([out] mem_t sample_buffer, ...@@ -28,10 +28,12 @@ typedef void PPB_Audio_Callback([out] mem_t sample_buffer,
* <a href="/chrome/nativeclient/docs/audio.html">Pepper * <a href="/chrome/nativeclient/docs/audio.html">Pepper
* Audio API</a> for information on using this interface. * Audio API</a> for information on using this interface.
* Please see descriptions for each <code>PPB_Audio</code> and * Please see descriptions for each <code>PPB_Audio</code> and
* <code>PPB_AudioConfig</code> function for more details. * <code>PPB_AudioConfig</code> function for more details. A C example using
* <code>PPB_Audio</code> and <code>PPB_AudioConfig</code> follows.
* *
* A C example using PPB_Audio and PPB_AudioConfig: * <strong>Example: </strong>
* @code *
* <code>
* void audio_callback(void* sample_buffer, * void audio_callback(void* sample_buffer,
* uint32_t buffer_size_in_bytes, * uint32_t buffer_size_in_bytes,
* void* user_data) { * void* user_data) {
...@@ -39,7 +41,8 @@ typedef void PPB_Audio_Callback([out] mem_t sample_buffer, ...@@ -39,7 +41,8 @@ typedef void PPB_Audio_Callback([out] mem_t sample_buffer,
* } * }
* *
* ...Assume the application has cached the audio configuration interface in * ...Assume the application has cached the audio configuration interface in
* |audio_config_interface| and the audio interface in |audio_interface|... * <code>audio_config_interface</code> and the audio interface in
* <code>audio_interface</code>...
* *
* uint32_t count = audio_config_interface->RecommendSampleFrameCount( * uint32_t count = audio_config_interface->RecommendSampleFrameCount(
* PP_AUDIOSAMPLERATE_44100, 4096); * PP_AUDIOSAMPLERATE_44100, 4096);
...@@ -49,30 +52,33 @@ typedef void PPB_Audio_Callback([out] mem_t sample_buffer, ...@@ -49,30 +52,33 @@ typedef void PPB_Audio_Callback([out] mem_t sample_buffer,
* audio_callback, NULL); * audio_callback, NULL);
* audio_interface->StartPlayback(pp_audio); * audio_interface->StartPlayback(pp_audio);
* *
* ...audio_callback() will now be periodically invoked on a seperate thread... * ...audio_callback() will now be periodically invoked on a separate thread...
* @endcode * </code>
*/ */
interface PPB_Audio { interface PPB_Audio {
/** /**
* Create is a pointer to a function that creates an audio resource. * Create() creates an audio resource. No sound will be heard until
* No sound will be heard until StartPlayback() is called. The callback * StartPlayback() is called. The callback is called with the buffer address
* is called with the buffer address and given user data whenever the * and given user data whenever the buffer needs to be filled. From within the
* buffer needs to be filled. From within the callback, you should not * callback, you should not call <code>PPB_Audio</code> functions. The
* call PPB_Audio functions. The callback will be called on a different * callback will be called on a different thread than the one which created
* thread than the one which created the interface. For performance-critical * the interface. For performance-critical applications (i.e. low-latency
* applications (i.e. low-latency audio), the callback should avoid blocking * audio), the callback should avoid blocking or calling functions that can
* or calling functions that can obtain locks, such as malloc. The layout and * obtain locks, such as malloc. The layout and the size of the buffer passed
* the size of the buffer passed to the audio callback will be determined by * to the audio callback will be determined by the device configuration and is
* the device configuration and is specified in the AudioConfig documentation. * specified in the <code>AudioConfig</code> documentation.
* *
* @param[in] instance A PP_Instance indentifying one instance of a module. * @param[in] instance A <code>PP_Instance</code> identifying one instance
* @param[in] config A PP_Resource containing the audio config resource. * of a module.
* @param[in] audio_callback A PPB_Audio_Callback callback function that the * @param[in] config A <code>PP_Resource</code> corresponding to an audio
* browser calls when it needs more samples to play. * config resource.
* @param[in] audio_callback A <code>PPB_Audio_Callback</code> callback
* function that the browser calls when it needs more samples to play.
* @param[in] user_data A pointer to user data used in the callback function. * @param[in] user_data A pointer to user data used in the callback function.
* *
* @return A PP_Resource containing the audio resource if successful or * @return A <code>PP_Resource</code> containing the audio resource if
* 0 if the configuration cannot be honored or the callback is null. * successful or 0 if the configuration cannot be honored or the callback is
* null.
*/ */
PP_Resource Create( PP_Resource Create(
[in] PP_Instance instance, [in] PP_Instance instance,
...@@ -81,50 +87,56 @@ interface PPB_Audio { ...@@ -81,50 +87,56 @@ interface PPB_Audio {
[inout] mem_t user_data); [inout] mem_t user_data);
/** /**
* IsAudio is a pointer to a function that determines if the given * IsAudio() determines if the provided resource is an audio resource.
* resource is an audio resource.
* *
* @param[in] resource A PP_Resource containing a resource. * @param[in] resource A <code>PP_Resource</code> corresponding to a generic
* resource.
* *
* @return A PP_BOOL containing containing PP_TRUE if the given resource is * @return A <code>PP_Bool</code> containing containing <code>PP_TRUE</code>
* an Audio resource, otherwise PP_FALSE. * if the given resource is an Audio resource, otherwise
* <code>PP_FALSE</code>.
*/ */
PP_Bool IsAudio( PP_Bool IsAudio(
[in] PP_Resource resource); [in] PP_Resource resource);
/** /**
* GetCurrrentConfig is a pointer to a function that returns an audio config * GetCurrrentConfig() returns an audio config resource for the given audio
* resource for the given audio resource. * resource.
* *
* @param[in] config A PP_Resource containing the audio resource. * @param[in] config A <code>PP_Resource</code> corresponding to an audio
* resource.
* *
* @return A PP_Resource containing the audio config resource if successful. * @return A <code>PP_Resource</code> containing the audio config resource if
* successful.
*/ */
PP_Resource GetCurrentConfig( PP_Resource GetCurrentConfig(
[in] PP_Resource audio); [in] PP_Resource audio);
/** /**
* StartPlayback is a pointer to a function that starts the playback of * StartPlayback() starts the playback of the audio resource and begins
* the audio resource and begins periodically calling the callback. * periodically calling the callback.
* *
* @param[in] config A PP_Resource containing the audio resource. * @param[in] config A <code>PP_Resource</code> corresponding to an audio
* resource.
* *
* @return A PP_BOOL containing PP_TRUE if successful, otherwise PP_FALSE. * @return A <code>PP_Bool</code> containing <code>PP_TRUE</code> if
* Also returns PP_TRUE (and be a no-op) if called while playback is already * successful, otherwise <code>PP_FALSE</code>. Also returns
* <code>PP_TRUE</code> (and be a no-op) if called while playback is already
* in progress. * in progress.
*/ */
PP_Bool StartPlayback( PP_Bool StartPlayback(
[in] PP_Resource audio); [in] PP_Resource audio);
/** /**
* StopPlayback is a pointer to a function that stops the playback of * StopPlayback() stops the playback of the audio resource.
* the audio resource.
* *
* @param[in] config A PP_Resource containing the audio resource. * @param[in] config A <code>PP_Resource</code> corresponding to an audio
* resource.
* *
* @return A PP_BOOL containing PP_TRUE if successful, otherwise PP_FALSE. * @return A <code>PP_Bool</code> containing <code>PP_TRUE</code> if
* Also returns PP_TRUE (and is a no-op) if called while playback is already * successful, otherwise <code>PP_FALSE</code>. Also returns
* stopped. If a callback is in progress, StopPlayback will block until the * <code>PP_TRUE</code> (and is a no-op) if called while playback is already
* stopped. If a callback is in progress, StopPlayback() will block until the
* callback completes. * callback completes.
*/ */
PP_Bool StopPlayback( PP_Bool StopPlayback(
......
...@@ -71,13 +71,14 @@ interface PPB_AudioConfig { ...@@ -71,13 +71,14 @@ interface PPB_AudioConfig {
* right channel sample. * right channel sample.
* Data will always be in the native endian format of the platform. * Data will always be in the native endian format of the platform.
* *
* @param[in] instance A <code>PP_Instance indentifying</code> one instance * @param[in] instance A <code>PP_Instance</code> identifying one instance
* of a module. * of a module.
* @param[in] sample_rate A P<code>P_AudioSampleRate</code> which is either * @param[in] sample_rate A P<code>P_AudioSampleRate</code> which is either
* <code>PP_AUDIOSAMPLERATE_44100</code> or * <code>PP_AUDIOSAMPLERATE_44100</code> or
* <code>PP_AUDIOSAMPLERATE_48000</code>. * <code>PP_AUDIOSAMPLERATE_48000</code>.
* @param[in] sample_frame_count A <code>uint32_t</code> frame count returned * @param[in] sample_frame_count A <code>uint32_t</code> frame count returned
* from the <code>RecommendSampleFrameCount</code> function. * from the <code>RecommendSampleFrameCount</code> function.
*
* @return A <code>PP_Resource</code> containing the * @return A <code>PP_Resource</code> containing the
* <code>PPB_Audio_Config</code> if successful or a null resource if the * <code>PPB_Audio_Config</code> if successful or a null resource if the
* sample frame count or bit rate are not supported. * sample frame count or bit rate are not supported.
...@@ -106,6 +107,7 @@ interface PPB_AudioConfig { ...@@ -106,6 +107,7 @@ interface PPB_AudioConfig {
* <code>PP_AUDIOSAMPLERATE_48000.</code> * <code>PP_AUDIOSAMPLERATE_48000.</code>
* @param[in] requested_sample_frame_count A <code>uint_32t</code> requested * @param[in] requested_sample_frame_count A <code>uint_32t</code> requested
* frame count. * frame count.
*
* @return A <code>uint32_t</code> containing the recommended sample frame * @return A <code>uint32_t</code> containing the recommended sample frame
* count if successful. * count if successful.
*/ */
...@@ -117,9 +119,10 @@ interface PPB_AudioConfig { ...@@ -117,9 +119,10 @@ interface PPB_AudioConfig {
* IsAudioConfig() determines if the given resource is a * IsAudioConfig() determines if the given resource is a
* <code>PPB_Audio_Config</code>. * <code>PPB_Audio_Config</code>.
* *
* @param[in] resource A <code>PP_Resource</code> containing the audio config * @param[in] resource A <code>PP_Resource</code> corresponding to an audio
* resource. * config resource.
* @return A <code>PP_BOOL</code> containing <code>PP_TRUE</code> if the given *
* @return A <code>PP_Bool</code> containing <code>PP_TRUE</code> if the given
* resource is an <code>AudioConfig</code> resource, otherwise * resource is an <code>AudioConfig</code> resource, otherwise
* <code>PP_FALSE</code>. * <code>PP_FALSE</code>.
*/ */
...@@ -130,8 +133,9 @@ interface PPB_AudioConfig { ...@@ -130,8 +133,9 @@ interface PPB_AudioConfig {
* GetSampleRate() returns the sample rate for the given * GetSampleRate() returns the sample rate for the given
* <code>PPB_Audio_Config</code>. * <code>PPB_Audio_Config</code>.
* *
* @param[in] config A <code>PP_Resource</code> containing the * @param[in] config A <code>PP_Resource</code> corresponding to a
* <code>PPB_Audio_Config</code>. * <code>PPB_Audio_Config</code>.
*
* @return A <code>PP_AudioSampleRate</code> containing sample rate or * @return A <code>PP_AudioSampleRate</code> containing sample rate or
* <code>PP_AUDIOSAMPLERATE_NONE</code> if the resource is invalid. * <code>PP_AUDIOSAMPLERATE_NONE</code> if the resource is invalid.
*/ */
...@@ -142,11 +146,12 @@ interface PPB_AudioConfig { ...@@ -142,11 +146,12 @@ interface PPB_AudioConfig {
* GetSampleFrameCount() returns the sample frame count for the given * GetSampleFrameCount() returns the sample frame count for the given
* <code>PPB_Audio_Config</code>. * <code>PPB_Audio_Config</code>.
* *
* @param[in] config A <code>PP_Resource</code> containing the audio config * @param[in] config A <code>PP_Resource</code> corresponding to an audio
* resource. * config resource.
*
* @return A <code>uint32_t</code> containing sample frame count or * @return A <code>uint32_t</code> containing sample frame count or
* 0 if the resource is invalid. See <code>RecommendSampleFrameCount</code> * 0 if the resource is invalid. Refer to
* for more on sample frame counts. * RecommendSampleFrameCount() for more on sample frame counts.
*/ */
uint32_t GetSampleFrameCount( uint32_t GetSampleFrameCount(
[in] PP_Resource config); [in] PP_Resource config);
......
...@@ -24,7 +24,7 @@ interface PPB_Messaging { ...@@ -24,7 +24,7 @@ interface PPB_Messaging {
* the DOM element for the given module instance. A call to PostMessage() * the DOM element for the given module instance. A call to PostMessage()
* will not block while the message is processed. * will not block while the message is processed.
* *
* @param[in] instance A <code>PP_Instance</code> indentifying one instance * @param[in] instance A <code>PP_Instance</code> identifying one instance
* of a module. * of a module.
* @param[in] message A <code>PP_Var</code> containing the data to be sent to * @param[in] message A <code>PP_Var</code> containing the data to be sent to
* JavaScript. * JavaScript.
...@@ -44,7 +44,7 @@ interface PPB_Messaging { ...@@ -44,7 +44,7 @@ interface PPB_Messaging {
* *
* <strong>Example:</strong> * <strong>Example:</strong>
* *
* @code * <code>
* *
* <body> * <body>
* <object id="plugin" * <object id="plugin"
...@@ -57,11 +57,11 @@ interface PPB_Messaging { ...@@ -57,11 +57,11 @@ interface PPB_Messaging {
* </script> * </script>
* </body> * </body>
* *
* @endcode * </code>
* *
* The module instance then invokes PostMessage() as follows: * The module instance then invokes PostMessage() as follows:
* *
* @code * <code>
* *
* *
* char hello_world[] = "Hello world!"; * char hello_world[] = "Hello world!";
...@@ -71,7 +71,7 @@ interface PPB_Messaging { ...@@ -71,7 +71,7 @@ interface PPB_Messaging {
* ppb_messaging_interface->PostMessage(instance, hello_var); // Copies var. * ppb_messaging_interface->PostMessage(instance, hello_var); // Copies var.
* ppb_var_interface->Release(hello_var); * ppb_var_interface->Release(hello_var);
* *
* @endcode * </code>
* *
* The browser will pop-up an alert saying "Hello world!" * The browser will pop-up an alert saying "Hello world!"
*/ */
......
...@@ -27,19 +27,19 @@ interface PPP_Messaging { ...@@ -27,19 +27,19 @@ interface PPP_Messaging {
* JavaScript execution will not be blocked while HandleMessage() is * JavaScript execution will not be blocked while HandleMessage() is
* processing the message. * processing the message.
* *
* @param[in] instance A <code>PP_Instance</code> indentifying one instance * @param[in] instance A <code>PP_Instance</code> identifying one instance
* of a module. * of a module.
* @param[in] message A <code>PP_Var</code> containing the data to be sent * @param[in] message A <code>PP_Var</code> containing the data to be sent
* to JavaScript. Message can have an int32_t, double, bool, or string value * to JavaScript. Message can have an int32_t, double, bool, or string value
* (objects are not supported). * (objects are not supported).
* *
* <strong>Example:</strong>
*
* The following JavaScript code invokes <code>HandleMessage</code>, passing * The following JavaScript code invokes <code>HandleMessage</code>, passing
* the module instance on which it was invoked, with <code>message</code> * the module instance on which it was invoked, with <code>message</code>
* being a string <code>PP_Var</code> containing "Hello world!" * being a string <code>PP_Var</code> containing "Hello world!"
* *
* @code * <strong>Example:</strong>
*
* <code>
* *
* <body> * <body>
* <object id="plugin" * <object id="plugin"
...@@ -49,7 +49,7 @@ interface PPP_Messaging { ...@@ -49,7 +49,7 @@ interface PPP_Messaging {
* </script> * </script>
* </body> * </body>
* *
* @endcode * </code>
* *
*/ */
void HandleMessage([in] PP_Instance instance, [in] PP_Var message); void HandleMessage([in] PP_Instance instance, [in] PP_Var message);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* found in the LICENSE file. * found in the LICENSE file.
*/ */
/* From ppb_audio.idl modified Wed Aug 24 20:46:25 2011. */ /* From ppb_audio.idl modified Mon Aug 29 10:11:34 2011. */
#ifndef PPAPI_C_PPB_AUDIO_H_ #ifndef PPAPI_C_PPB_AUDIO_H_
#define PPAPI_C_PPB_AUDIO_H_ #define PPAPI_C_PPB_AUDIO_H_
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
/** /**
* <code>PPB_Audio_Callback</code> defines the type of an audio callback * <code>PPB_Audio_Callback</code> defines the type of an audio callback
* function used to fill the audio buffer with data. Please see the * function used to fill the audio buffer with data. Please see the
* <code>Create()</code> function in the <code>PPB_Audio</code> interface for * Create() function in the <code>PPB_Audio</code> interface for
* more details on this callback. * more details on this callback.
*/ */
typedef void (*PPB_Audio_Callback)(void* sample_buffer, typedef void (*PPB_Audio_Callback)(void* sample_buffer,
...@@ -51,10 +51,12 @@ typedef void (*PPB_Audio_Callback)(void* sample_buffer, ...@@ -51,10 +51,12 @@ typedef void (*PPB_Audio_Callback)(void* sample_buffer,
* <a href="/chrome/nativeclient/docs/audio.html">Pepper * <a href="/chrome/nativeclient/docs/audio.html">Pepper
* Audio API</a> for information on using this interface. * Audio API</a> for information on using this interface.
* Please see descriptions for each <code>PPB_Audio</code> and * Please see descriptions for each <code>PPB_Audio</code> and
* <code>PPB_AudioConfig</code> function for more details. * <code>PPB_AudioConfig</code> function for more details. A C example using
* <code>PPB_Audio</code> and <code>PPB_AudioConfig</code> follows.
* *
* A C example using PPB_Audio and PPB_AudioConfig: * <strong>Example: </strong>
* @code *
* <code>
* void audio_callback(void* sample_buffer, * void audio_callback(void* sample_buffer,
* uint32_t buffer_size_in_bytes, * uint32_t buffer_size_in_bytes,
* void* user_data) { * void* user_data) {
...@@ -62,7 +64,8 @@ typedef void (*PPB_Audio_Callback)(void* sample_buffer, ...@@ -62,7 +64,8 @@ typedef void (*PPB_Audio_Callback)(void* sample_buffer,
* } * }
* *
* ...Assume the application has cached the audio configuration interface in * ...Assume the application has cached the audio configuration interface in
* |audio_config_interface| and the audio interface in |audio_interface|... * <code>audio_config_interface</code> and the audio interface in
* <code>audio_interface</code>...
* *
* uint32_t count = audio_config_interface->RecommendSampleFrameCount( * uint32_t count = audio_config_interface->RecommendSampleFrameCount(
* PP_AUDIOSAMPLERATE_44100, 4096); * PP_AUDIOSAMPLERATE_44100, 4096);
...@@ -72,74 +75,83 @@ typedef void (*PPB_Audio_Callback)(void* sample_buffer, ...@@ -72,74 +75,83 @@ typedef void (*PPB_Audio_Callback)(void* sample_buffer,
* audio_callback, NULL); * audio_callback, NULL);
* audio_interface->StartPlayback(pp_audio); * audio_interface->StartPlayback(pp_audio);
* *
* ...audio_callback() will now be periodically invoked on a seperate thread... * ...audio_callback() will now be periodically invoked on a separate thread...
* @endcode * </code>
*/ */
struct PPB_Audio { struct PPB_Audio {
/** /**
* Create is a pointer to a function that creates an audio resource. * Create() creates an audio resource. No sound will be heard until
* No sound will be heard until StartPlayback() is called. The callback * StartPlayback() is called. The callback is called with the buffer address
* is called with the buffer address and given user data whenever the * and given user data whenever the buffer needs to be filled. From within the
* buffer needs to be filled. From within the callback, you should not * callback, you should not call <code>PPB_Audio</code> functions. The
* call PPB_Audio functions. The callback will be called on a different * callback will be called on a different thread than the one which created
* thread than the one which created the interface. For performance-critical * the interface. For performance-critical applications (i.e. low-latency
* applications (i.e. low-latency audio), the callback should avoid blocking * audio), the callback should avoid blocking or calling functions that can
* or calling functions that can obtain locks, such as malloc. The layout and * obtain locks, such as malloc. The layout and the size of the buffer passed
* the size of the buffer passed to the audio callback will be determined by * to the audio callback will be determined by the device configuration and is
* the device configuration and is specified in the AudioConfig documentation. * specified in the <code>AudioConfig</code> documentation.
* *
* @param[in] instance A PP_Instance indentifying one instance of a module. * @param[in] instance A <code>PP_Instance</code> identifying one instance
* @param[in] config A PP_Resource containing the audio config resource. * of a module.
* @param[in] audio_callback A PPB_Audio_Callback callback function that the * @param[in] config A <code>PP_Resource</code> corresponding to an audio
* browser calls when it needs more samples to play. * config resource.
* @param[in] audio_callback A <code>PPB_Audio_Callback</code> callback
* function that the browser calls when it needs more samples to play.
* @param[in] user_data A pointer to user data used in the callback function. * @param[in] user_data A pointer to user data used in the callback function.
* *
* @return A PP_Resource containing the audio resource if successful or * @return A <code>PP_Resource</code> containing the audio resource if
* 0 if the configuration cannot be honored or the callback is null. * successful or 0 if the configuration cannot be honored or the callback is
* null.
*/ */
PP_Resource (*Create)(PP_Instance instance, PP_Resource (*Create)(PP_Instance instance,
PP_Resource config, PP_Resource config,
PPB_Audio_Callback audio_callback, PPB_Audio_Callback audio_callback,
void* user_data); void* user_data);
/** /**
* IsAudio is a pointer to a function that determines if the given * IsAudio() determines if the provided resource is an audio resource.
* resource is an audio resource.
* *
* @param[in] resource A PP_Resource containing a resource. * @param[in] resource A <code>PP_Resource</code> corresponding to a generic
* resource.
* *
* @return A PP_BOOL containing containing PP_TRUE if the given resource is * @return A <code>PP_Bool</code> containing containing <code>PP_TRUE</code>
* an Audio resource, otherwise PP_FALSE. * if the given resource is an Audio resource, otherwise
* <code>PP_FALSE</code>.
*/ */
PP_Bool (*IsAudio)(PP_Resource resource); PP_Bool (*IsAudio)(PP_Resource resource);
/** /**
* GetCurrrentConfig is a pointer to a function that returns an audio config * GetCurrrentConfig() returns an audio config resource for the given audio
* resource for the given audio resource. * resource.
* *
* @param[in] config A PP_Resource containing the audio resource. * @param[in] config A <code>PP_Resource</code> corresponding to an audio
* resource.
* *
* @return A PP_Resource containing the audio config resource if successful. * @return A <code>PP_Resource</code> containing the audio config resource if
* successful.
*/ */
PP_Resource (*GetCurrentConfig)(PP_Resource audio); PP_Resource (*GetCurrentConfig)(PP_Resource audio);
/** /**
* StartPlayback is a pointer to a function that starts the playback of * StartPlayback() starts the playback of the audio resource and begins
* the audio resource and begins periodically calling the callback. * periodically calling the callback.
* *
* @param[in] config A PP_Resource containing the audio resource. * @param[in] config A <code>PP_Resource</code> corresponding to an audio
* resource.
* *
* @return A PP_BOOL containing PP_TRUE if successful, otherwise PP_FALSE. * @return A <code>PP_Bool</code> containing <code>PP_TRUE</code> if
* Also returns PP_TRUE (and be a no-op) if called while playback is already * successful, otherwise <code>PP_FALSE</code>. Also returns
* <code>PP_TRUE</code> (and be a no-op) if called while playback is already
* in progress. * in progress.
*/ */
PP_Bool (*StartPlayback)(PP_Resource audio); PP_Bool (*StartPlayback)(PP_Resource audio);
/** /**
* StopPlayback is a pointer to a function that stops the playback of * StopPlayback() stops the playback of the audio resource.
* the audio resource.
* *
* @param[in] config A PP_Resource containing the audio resource. * @param[in] config A <code>PP_Resource</code> corresponding to an audio
* resource.
* *
* @return A PP_BOOL containing PP_TRUE if successful, otherwise PP_FALSE. * @return A <code>PP_Bool</code> containing <code>PP_TRUE</code> if
* Also returns PP_TRUE (and is a no-op) if called while playback is already * successful, otherwise <code>PP_FALSE</code>. Also returns
* stopped. If a callback is in progress, StopPlayback will block until the * <code>PP_TRUE</code> (and is a no-op) if called while playback is already
* stopped. If a callback is in progress, StopPlayback() will block until the
* callback completes. * callback completes.
*/ */
PP_Bool (*StopPlayback)(PP_Resource audio); PP_Bool (*StopPlayback)(PP_Resource audio);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* found in the LICENSE file. * found in the LICENSE file.
*/ */
/* From ppb_audio_config.idl modified Wed Aug 24 20:49:30 2011. */ /* From ppb_audio_config.idl modified Mon Aug 29 10:11:34 2011. */
#ifndef PPAPI_C_PPB_AUDIO_CONFIG_H_ #ifndef PPAPI_C_PPB_AUDIO_CONFIG_H_
#define PPAPI_C_PPB_AUDIO_CONFIG_H_ #define PPAPI_C_PPB_AUDIO_CONFIG_H_
...@@ -91,13 +91,14 @@ struct PPB_AudioConfig { ...@@ -91,13 +91,14 @@ struct PPB_AudioConfig {
* right channel sample. * right channel sample.
* Data will always be in the native endian format of the platform. * Data will always be in the native endian format of the platform.
* *
* @param[in] instance A <code>PP_Instance indentifying</code> one instance * @param[in] instance A <code>PP_Instance</code> identifying one instance
* of a module. * of a module.
* @param[in] sample_rate A P<code>P_AudioSampleRate</code> which is either * @param[in] sample_rate A P<code>P_AudioSampleRate</code> which is either
* <code>PP_AUDIOSAMPLERATE_44100</code> or * <code>PP_AUDIOSAMPLERATE_44100</code> or
* <code>PP_AUDIOSAMPLERATE_48000</code>. * <code>PP_AUDIOSAMPLERATE_48000</code>.
* @param[in] sample_frame_count A <code>uint32_t</code> frame count returned * @param[in] sample_frame_count A <code>uint32_t</code> frame count returned
* from the <code>RecommendSampleFrameCount</code> function. * from the <code>RecommendSampleFrameCount</code> function.
*
* @return A <code>PP_Resource</code> containing the * @return A <code>PP_Resource</code> containing the
* <code>PPB_Audio_Config</code> if successful or a null resource if the * <code>PPB_Audio_Config</code> if successful or a null resource if the
* sample frame count or bit rate are not supported. * sample frame count or bit rate are not supported.
...@@ -124,6 +125,7 @@ struct PPB_AudioConfig { ...@@ -124,6 +125,7 @@ struct PPB_AudioConfig {
* <code>PP_AUDIOSAMPLERATE_48000.</code> * <code>PP_AUDIOSAMPLERATE_48000.</code>
* @param[in] requested_sample_frame_count A <code>uint_32t</code> requested * @param[in] requested_sample_frame_count A <code>uint_32t</code> requested
* frame count. * frame count.
*
* @return A <code>uint32_t</code> containing the recommended sample frame * @return A <code>uint32_t</code> containing the recommended sample frame
* count if successful. * count if successful.
*/ */
...@@ -134,9 +136,10 @@ struct PPB_AudioConfig { ...@@ -134,9 +136,10 @@ struct PPB_AudioConfig {
* IsAudioConfig() determines if the given resource is a * IsAudioConfig() determines if the given resource is a
* <code>PPB_Audio_Config</code>. * <code>PPB_Audio_Config</code>.
* *
* @param[in] resource A <code>PP_Resource</code> containing the audio config * @param[in] resource A <code>PP_Resource</code> corresponding to an audio
* resource. * config resource.
* @return A <code>PP_BOOL</code> containing <code>PP_TRUE</code> if the given *
* @return A <code>PP_Bool</code> containing <code>PP_TRUE</code> if the given
* resource is an <code>AudioConfig</code> resource, otherwise * resource is an <code>AudioConfig</code> resource, otherwise
* <code>PP_FALSE</code>. * <code>PP_FALSE</code>.
*/ */
...@@ -145,8 +148,9 @@ struct PPB_AudioConfig { ...@@ -145,8 +148,9 @@ struct PPB_AudioConfig {
* GetSampleRate() returns the sample rate for the given * GetSampleRate() returns the sample rate for the given
* <code>PPB_Audio_Config</code>. * <code>PPB_Audio_Config</code>.
* *
* @param[in] config A <code>PP_Resource</code> containing the * @param[in] config A <code>PP_Resource</code> corresponding to a
* <code>PPB_Audio_Config</code>. * <code>PPB_Audio_Config</code>.
*
* @return A <code>PP_AudioSampleRate</code> containing sample rate or * @return A <code>PP_AudioSampleRate</code> containing sample rate or
* <code>PP_AUDIOSAMPLERATE_NONE</code> if the resource is invalid. * <code>PP_AUDIOSAMPLERATE_NONE</code> if the resource is invalid.
*/ */
...@@ -155,11 +159,12 @@ struct PPB_AudioConfig { ...@@ -155,11 +159,12 @@ struct PPB_AudioConfig {
* GetSampleFrameCount() returns the sample frame count for the given * GetSampleFrameCount() returns the sample frame count for the given
* <code>PPB_Audio_Config</code>. * <code>PPB_Audio_Config</code>.
* *
* @param[in] config A <code>PP_Resource</code> containing the audio config * @param[in] config A <code>PP_Resource</code> corresponding to an audio
* resource. * config resource.
*
* @return A <code>uint32_t</code> containing sample frame count or * @return A <code>uint32_t</code> containing sample frame count or
* 0 if the resource is invalid. See <code>RecommendSampleFrameCount</code> * 0 if the resource is invalid. Refer to
* for more on sample frame counts. * RecommendSampleFrameCount() for more on sample frame counts.
*/ */
uint32_t (*GetSampleFrameCount)(PP_Resource config); uint32_t (*GetSampleFrameCount)(PP_Resource config);
}; };
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* found in the LICENSE file. * found in the LICENSE file.
*/ */
/* From ppb_messaging.idl modified Wed Aug 24 20:48:00 2011. */ /* From ppb_messaging.idl modified Mon Aug 29 10:11:34 2011. */
#ifndef PPAPI_C_PPB_MESSAGING_H_ #ifndef PPAPI_C_PPB_MESSAGING_H_
#define PPAPI_C_PPB_MESSAGING_H_ #define PPAPI_C_PPB_MESSAGING_H_
...@@ -40,7 +40,7 @@ struct PPB_Messaging { ...@@ -40,7 +40,7 @@ struct PPB_Messaging {
* the DOM element for the given module instance. A call to PostMessage() * the DOM element for the given module instance. A call to PostMessage()
* will not block while the message is processed. * will not block while the message is processed.
* *
* @param[in] instance A <code>PP_Instance</code> indentifying one instance * @param[in] instance A <code>PP_Instance</code> identifying one instance
* of a module. * of a module.
* @param[in] message A <code>PP_Var</code> containing the data to be sent to * @param[in] message A <code>PP_Var</code> containing the data to be sent to
* JavaScript. * JavaScript.
...@@ -60,7 +60,7 @@ struct PPB_Messaging { ...@@ -60,7 +60,7 @@ struct PPB_Messaging {
* *
* <strong>Example:</strong> * <strong>Example:</strong>
* *
* @code * <code>
* *
* <body> * <body>
* <object id="plugin" * <object id="plugin"
...@@ -73,11 +73,11 @@ struct PPB_Messaging { ...@@ -73,11 +73,11 @@ struct PPB_Messaging {
* </script> * </script>
* </body> * </body>
* *
* @endcode * </code>
* *
* The module instance then invokes PostMessage() as follows: * The module instance then invokes PostMessage() as follows:
* *
* @code * <code>
* *
* *
* char hello_world[] = "Hello world!"; * char hello_world[] = "Hello world!";
...@@ -87,7 +87,7 @@ struct PPB_Messaging { ...@@ -87,7 +87,7 @@ struct PPB_Messaging {
* ppb_messaging_interface->PostMessage(instance, hello_var); // Copies var. * ppb_messaging_interface->PostMessage(instance, hello_var); // Copies var.
* ppb_var_interface->Release(hello_var); * ppb_var_interface->Release(hello_var);
* *
* @endcode * </code>
* *
* The browser will pop-up an alert saying "Hello world!" * The browser will pop-up an alert saying "Hello world!"
*/ */
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* found in the LICENSE file. * found in the LICENSE file.
*/ */
/* From ppp_messaging.idl modified Wed Aug 24 20:50:56 2011. */ /* From ppp_messaging.idl modified Mon Aug 29 10:11:34 2011. */
#ifndef PPAPI_C_PPP_MESSAGING_H_ #ifndef PPAPI_C_PPP_MESSAGING_H_
#define PPAPI_C_PPP_MESSAGING_H_ #define PPAPI_C_PPP_MESSAGING_H_
...@@ -43,19 +43,19 @@ struct PPP_Messaging { ...@@ -43,19 +43,19 @@ struct PPP_Messaging {
* JavaScript execution will not be blocked while HandleMessage() is * JavaScript execution will not be blocked while HandleMessage() is
* processing the message. * processing the message.
* *
* @param[in] instance A <code>PP_Instance</code> indentifying one instance * @param[in] instance A <code>PP_Instance</code> identifying one instance
* of a module. * of a module.
* @param[in] message A <code>PP_Var</code> containing the data to be sent * @param[in] message A <code>PP_Var</code> containing the data to be sent
* to JavaScript. Message can have an int32_t, double, bool, or string value * to JavaScript. Message can have an int32_t, double, bool, or string value
* (objects are not supported). * (objects are not supported).
* *
* <strong>Example:</strong>
*
* The following JavaScript code invokes <code>HandleMessage</code>, passing * The following JavaScript code invokes <code>HandleMessage</code>, passing
* the module instance on which it was invoked, with <code>message</code> * the module instance on which it was invoked, with <code>message</code>
* being a string <code>PP_Var</code> containing "Hello world!" * being a string <code>PP_Var</code> containing "Hello world!"
* *
* @code * <strong>Example:</strong>
*
* <code>
* *
* <body> * <body>
* <object id="plugin" * <object id="plugin"
...@@ -65,7 +65,7 @@ struct PPP_Messaging { ...@@ -65,7 +65,7 @@ struct PPP_Messaging {
* </script> * </script>
* </body> * </body>
* *
* @endcode * </code>
* *
*/ */
void (*HandleMessage)(PP_Instance instance, struct PP_Var message); void (*HandleMessage)(PP_Instance instance, struct PP_Var message);
......
...@@ -40,7 +40,8 @@ class Instance; ...@@ -40,7 +40,8 @@ class Instance;
/// Data will always be in the native endian format of the platform. /// Data will always be in the native endian format of the platform.
/// ///
/// <strong>Example:</strong> /// <strong>Example:</strong>
/// @code /// <code>
///
/// // Create an audio config with a supported frame count. /// // Create an audio config with a supported frame count.
/// uint32_t sample_frame_count = AudioConfig::RecommendSampleFrameCount( /// uint32_t sample_frame_count = AudioConfig::RecommendSampleFrameCount(
/// PP_AUDIOSAMPLERATE_44100, 4096); /// PP_AUDIOSAMPLERATE_44100, 4096);
...@@ -52,7 +53,7 @@ class Instance; ...@@ -52,7 +53,7 @@ class Instance;
/// Audio audio(instance, config, callback, user_data); /// Audio audio(instance, config, callback, user_data);
/// if (audio.is_null()) /// if (audio.is_null())
/// return false; // Couldn't create audio. /// return false; // Couldn't create audio.
/// @endcode /// </code>
class AudioConfig : public Resource { class AudioConfig : public Resource {
public: public:
/// An empty constructor for an <code>AudioConfig</code> resource. /// An empty constructor for an <code>AudioConfig</code> resource.
...@@ -63,7 +64,7 @@ class AudioConfig : public Resource { ...@@ -63,7 +64,7 @@ class AudioConfig : public Resource {
/// resulting resource will be is_null(). You can pass the result of /// resulting resource will be is_null(). You can pass the result of
/// RecommendSampleFrameCount() as the sample frame count. /// RecommendSampleFrameCount() as the sample frame count.
/// ///
/// @param[in] instance A pointer to an <code>Instance</code> indentifying /// @param[in] instance A pointer to an <code>Instance</code> identifying
/// one instance of a module. /// one instance of a module.
/// @param[in] sample_rate A <code>PP_AudioSampleRate</code> which is either /// @param[in] sample_rate A <code>PP_AudioSampleRate</code> which is either
/// <code>PP_AUDIOSAMPLERATE_44100</code> or /// <code>PP_AUDIOSAMPLERATE_44100</code> or
......
...@@ -113,7 +113,7 @@ class CompletionCallback { ...@@ -113,7 +113,7 @@ class CompletionCallback {
/// ///
/// <strong>Example:</strong> /// <strong>Example:</strong>
/// ///
/// @code /// <code>
/// ///
/// int32_t OpenURL(pp::URLLoader* loader, /// int32_t OpenURL(pp::URLLoader* loader,
/// pp::URLRequestInfo* url_request_info, /// pp::URLRequestInfo* url_request_info,
...@@ -123,7 +123,7 @@ class CompletionCallback { ...@@ -123,7 +123,7 @@ class CompletionCallback {
/// return loader->Open(*loader, *url_request_info, cc); /// return loader->Open(*loader, *url_request_info, cc);
/// } /// }
/// ///
/// @endcode /// </code>
/// ///
/// @param[in] result PP_OK_COMPLETIONPENDING or the result of the completed /// @param[in] result PP_OK_COMPLETIONPENDING or the result of the completed
/// operation to be passed to the callback function. PP_OK_COMPLETIONPENDING /// operation to be passed to the callback function. PP_OK_COMPLETIONPENDING
...@@ -172,7 +172,7 @@ CompletionCallback BlockUntilComplete(); ...@@ -172,7 +172,7 @@ CompletionCallback BlockUntilComplete();
/// ///
/// <strong>Example: </strong> /// <strong>Example: </strong>
/// ///
/// @code /// <code>
/// ///
/// class MyHandler { /// class MyHandler {
/// public: /// public:
...@@ -231,7 +231,7 @@ CompletionCallback BlockUntilComplete(); ...@@ -231,7 +231,7 @@ CompletionCallback BlockUntilComplete();
/// int64_t offset_; /// int64_t offset_;
/// }; /// };
/// ///
/// @endcode /// </code>
/// ///
template <typename T, typename RefCount = NonThreadSafeRefCount> template <typename T, typename RefCount = NonThreadSafeRefCount>
class CompletionCallbackFactory { class CompletionCallbackFactory {
......
...@@ -28,7 +28,7 @@ class Var; ...@@ -28,7 +28,7 @@ class Var;
/// appropriate event-specific object to query the properties. /// appropriate event-specific object to query the properties.
/// ///
/// <strong>Example:</strong> /// <strong>Example:</strong>
/// @code /// <code>
/// ///
/// bool MyInstance::HandleInputEvent(const pp::InputEvent& event) { /// bool MyInstance::HandleInputEvent(const pp::InputEvent& event) {
/// switch (event.GetType()) { /// switch (event.GetType()) {
...@@ -40,7 +40,7 @@ class Var; ...@@ -40,7 +40,7 @@ class Var;
/// return false; /// return false;
/// } /// }
/// ///
/// @endcode /// </code>
class InputEvent : public Resource { class InputEvent : public Resource {
public: public:
/// Default constructor that creates an is_null() InputEvent object. /// Default constructor that creates an is_null() InputEvent object.
......
...@@ -223,7 +223,7 @@ class Instance { ...@@ -223,7 +223,7 @@ class Instance {
/// the instance on which it was invoked, with <code>message</code> being a /// the instance on which it was invoked, with <code>message</code> being a
/// string <code>Var</code> containing "Hello world!" /// string <code>Var</code> containing "Hello world!"
/// ///
/// @code /// <code>
/// ///
/// <body> /// <body>
/// <object id="plugin" /// <object id="plugin"
...@@ -233,7 +233,7 @@ class Instance { ...@@ -233,7 +233,7 @@ class Instance {
/// </script> /// </script>
/// </body> /// </body>
/// ///
/// @endcode /// </code>
/// ///
/// Refer to PostMessage() for sending messages to JavaScript. /// Refer to PostMessage() for sending messages to JavaScript.
/// ///
...@@ -327,12 +327,12 @@ class Instance { ...@@ -327,12 +327,12 @@ class Instance {
/// ///
/// <strong>Example:</strong> /// <strong>Example:</strong>
/// ///
/// @code /// <code>
/// RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE); /// RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE);
/// RequestFilteringInputEvents( /// RequestFilteringInputEvents(
/// PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD); /// PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD);
/// ///
/// @endcode /// </code>
/// ///
/// @param event_classes A combination of flags from /// @param event_classes A combination of flags from
/// <code>PP_InputEvent_Class</code> that identifies the classes of events /// <code>PP_InputEvent_Class</code> that identifies the classes of events
...@@ -365,13 +365,13 @@ class Instance { ...@@ -365,13 +365,13 @@ class Instance {
/// ///
/// <strong>Example:</strong> /// <strong>Example:</strong>
/// ///
/// @code /// <code>
/// ///
/// RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE); /// RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE);
/// RequestFilteringInputEvents( /// RequestFilteringInputEvents(
/// PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD); /// PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD);
/// ///
/// @endcode /// </code>
/// ///
/// @param event_classes A combination of flags from /// @param event_classes A combination of flags from
/// <code>PP_InputEvent_Class</code> that identifies the classes of events /// <code>PP_InputEvent_Class</code> that identifies the classes of events
...@@ -412,7 +412,7 @@ class Instance { ...@@ -412,7 +412,7 @@ class Instance {
/// ///
/// <strong>Example:</strong> /// <strong>Example:</strong>
/// ///
/// @code /// <code>
/// ///
/// <body> /// <body>
/// <object id="plugin" /// <object id="plugin"
...@@ -425,15 +425,15 @@ class Instance { ...@@ -425,15 +425,15 @@ class Instance {
/// </script> /// </script>
/// </body> /// </body>
/// ///
/// @endcode /// </code>
/// ///
/// The instance then invokes PostMessage() as follows: /// The instance then invokes PostMessage() as follows:
/// ///
/// @code /// <code>
/// ///
/// PostMessage(pp::Var("Hello world!")); /// PostMessage(pp::Var("Hello world!"));
/// ///
/// @endcode /// </code>
/// ///
/// The browser will pop-up an alert saying "Hello world!" /// The browser will pop-up an alert saying "Hello world!"
/// ///
......
...@@ -32,7 +32,7 @@ class Rect; ...@@ -32,7 +32,7 @@ class Rect;
/// ///
/// <strong>Example:</strong> /// <strong>Example:</strong>
/// ///
/// @code /// <code>
/// ///
/// class MyClass : public pp::Instance, public PaintManager::Client { /// class MyClass : public pp::Instance, public PaintManager::Client {
/// public: /// public:
...@@ -65,7 +65,7 @@ class Rect; ...@@ -65,7 +65,7 @@ class Rect;
/// private: /// private:
/// pp::PaintManager paint_manager_; /// pp::PaintManager paint_manager_;
/// }; /// };
/// @endcode /// </code>
class PaintManager { class PaintManager {
public: public:
class Client { class Client {
......
...@@ -18,67 +18,8 @@ class URLRequestInfo; ...@@ -18,67 +18,8 @@ class URLRequestInfo;
class URLResponseInfo; class URLResponseInfo;
/// URLLoader provides an API for loading URLs. /// URLLoader provides an API for loading URLs.
/// /// Refer to <code>ppapi/examples/url_loader/streaming.cc</code>
/// <strong>Example:</strong> /// for an example of how to use this class.
///
/// @code
///
/// class MyHandler {
/// public:
/// MyHandler(Instance* instance)
/// : factory_(this),
/// loader_(instance),
/// did_open_(false) {
/// }
/// void ProcessURL(const char* url) {
/// CompletionCallback* cc = NewCallback();
/// int32_t rv = loader_.Open(MakeRequest(url), cc);
/// if (rv != PP_Error_WouldBlock)
/// cc->Run(rv);
/// }
/// private:
/// CompletionCallback* NewCallback() {
/// return factory_.NewOptionalCallback(&MyHandler::DidCompleteIO);
/// }
/// URLRequestInfo MakeRequest(const char* url) {
/// URLRequestInfo request;
/// request.SetURL(url);
/// request.SetMethod("GET");
/// request.SetFollowRedirects(true);
/// return request;
/// }
/// void DidCompleteIO(int32_t result) {
/// if (result > 0) {
/// // buf_ now contains 'result' number of bytes from the URL.
/// ProcessBytes(buf_, result);
/// ReadMore();
/// } else if (result == PP_OK && !did_open_) {
/// // Headers are available, and we can start reading the body.
/// did_open_ = true;
/// ProcessResponseInfo(loader_.GetResponseInfo());
/// ReadMore();
/// } else {
/// // Done reading (possibly with an error given by 'result').
/// }
/// }
/// void ReadMore() {
/// CompletionCallback* cc = NewCallback();
/// int32_t rv = fio_.Read(offset_, buf_, sizeof(buf_), cc);
/// if (rv != PP_Error_WouldBlock)
/// cc->Run(rv);
/// }
/// void ProcessResponseInfo(const URLResponseInfo& response_info) {
/// // Read response headers, etc.
/// }
/// void ProcessBytes(const char* bytes, int32_t length) {
/// // Do work ...
/// }
/// pp::CompletionCallbackFactory<MyHandler> factory_;
/// pp::URLLoader loader_;
/// char buf_[4096];
/// bool did_open_;
/// };
/// @endcode
class URLLoader : public Resource { class URLLoader : public Resource {
public: public:
/// Default constructor for creating an is_null() /// Default constructor for creating an is_null()
...@@ -92,7 +33,8 @@ class URLLoader : public Resource { ...@@ -92,7 +33,8 @@ class URLLoader : public Resource {
/// A constructor used when a <code>PP_Resource</code> is provided as a /// A constructor used when a <code>PP_Resource</code> is provided as a
/// return value whose reference count we need to increment. /// return value whose reference count we need to increment.
/// ///
/// @param[in] resource A <code>PP_Resource</code>. /// @param[in] resource A <code>PP_Resource</code> corresponding to a
/// <code>URLLoader</code> resource.
explicit URLLoader(PP_Resource resource); explicit URLLoader(PP_Resource resource);
/// A constructor used to allocate a new URLLoader in the browser. The /// A constructor used to allocate a new URLLoader in the browser. The
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment