diff options
author | Torne (Richard Coles) <torne@google.com> | 2013-12-18 16:25:09 +0000 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2013-12-18 16:25:09 +0000 |
commit | a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7 (patch) | |
tree | dafc1c6417406a7fbd422ad0bb890e96909ef564 /ppapi | |
parent | d5f893c0bc79db3066bb5ae5d3d972ba1be7dd5f (diff) | |
download | chromium_org-a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7.tar.gz |
Merge from Chromium at DEPS revision 240154
This commit was generated by merge_to_master.py.
Change-Id: I8f2ba858cf0e7f413dddedc2ae91dc37f7136c2e
Diffstat (limited to 'ppapi')
65 files changed, 1388 insertions, 2438 deletions
diff --git a/ppapi/api/dev/pp_optional_structs_dev.idl b/ppapi/api/dev/pp_optional_structs_dev.idl new file mode 100644 index 0000000000..3e0829fe40 --- /dev/null +++ b/ppapi/api/dev/pp_optional_structs_dev.idl @@ -0,0 +1,14 @@ +/* Copyright 2013 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 optional structs for primitive types. + */ + +struct PP_Optional_Double_Dev { + double_t value; + PP_Bool is_set; +}; + diff --git a/ppapi/api/dev/ppb_alarms_dev.idl b/ppapi/api/dev/ppb_alarms_dev.idl new file mode 100644 index 0000000000..b2345c4c5c --- /dev/null +++ b/ppapi/api/dev/ppb_alarms_dev.idl @@ -0,0 +1,181 @@ +/* Copyright 2013 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 Pepper equivalent of the <code>chrome.alarms</code> + * extension API. + */ + +label Chrome { + M33 = 0.1 +}; + +struct PP_Alarms_Alarm_Dev { + /** + * Name of this alarm. + */ + PP_Var name; + /** + * Time at which this alarm was scheduled to fire, in milliseconds past the + * epoch. For performance reasons, the alarm may have been delayed an + * arbitrary amount beyond this. + */ + double_t scheduled_time; + /** + * If set, the alarm is a repeating alarm and will fire again in + * <code>period_in_minutes</code> minutes. + */ + PP_Optional_Double_Dev period_in_minutes; +}; + +struct PP_Alarms_AlarmCreateInfo_Dev { + /** + * Time at which the alarm should fire, in milliseconds past the epoch. + */ + PP_Optional_Double_Dev when; + /** + * Length of time in minutes after which the + * <code>PP_Alarms_OnAlarm_Dev</code> event should fire. + */ + PP_Optional_Double_Dev delay_in_minutes; + /** + * If set, the <code>PP_Alarms_OnAlarm_Dev</code> event should fire every + * <code>period_in_minutes</code> minutes after the initial event specified by + * <code>when</code> or <code>delay_in_minutes</code>. If not set, the alarm + * will only fire once. + */ + PP_Optional_Double_Dev period_in_minutes; +}; + +struct PP_Alarms_Alarm_Array_Dev { + uint32_t size; + [size_is(count)] PP_Alarms_Alarm_Dev[] elements; +}; + +/** + * Fired when an alarm has elapsed. Useful for event pages. + * + * @param[in] listener_id The listener ID. + * @param[inout] user_data The opaque pointer that was used when registering the + * listener. + * @param[in] alarm The alarm that has elapsed. + */ +typedef void PP_Alarms_OnAlarm_Dev( + [in] uint32_t listener_id, + [inout] mem_t user_data, + [in] PP_Alarms_Alarm_Dev alarm); + +interface PPB_Alarms_Dev { + /** + * Creates an alarm. Near the time(s) specified by <code>alarm_info</code>, + * the <code>PP_Alarms_OnAlarm_Dev</code> event is fired. If there is another + * alarm with the same name (or no name if none is specified), it will be + * cancelled and replaced by this alarm. + * + * In order to reduce the load on the user's machine, Chrome limits alarms + * to at most once every 1 minute but may delay them an arbitrary amount more. + * That is, setting + * <code>PP_Alarms_AlarmCreateInfo_Dev.delay_in_minutes</code> or + * <code>PP_Alarms_AlarmCreateInfo_Dev.period_in_minutes</code> to less than + * <code>1</code> will not be honored and will cause a warning. + * <code>PP_Alarms_AlarmCreateInfo_Dev.when</code> can be set to less than 1 + * minute after "now" without warning but won't actually cause the alarm to + * fire for at least 1 minute. + * + * To help you debug your app or extension, when you've loaded it unpacked, + * there's no limit to how often the alarm can fire. + * + * @param[in] instance A <code>PP_Instance</code>. + * @param[in] name A string or undefined <code>PP_Var</code>. Optional name to + * identify this alarm. Defaults to the empty string. + * @param[in] alarm_info Describes when the alarm should fire. The initial + * time must be specified by either <code>when</code> or + * <code>delay_in_minutes</code> (but not both). If + * <code>period_in_minutes</code> is set, the alarm will repeat every + * <code>period_in_minutes</code> minutes after the initial event. If neither + * <code>when</code> or <code>delay_in_minutes</code> is set for a repeating + * alarm, <code>period_in_minutes</code> is used as the default for + * <code>delay_in_minutes</code>. + */ + void Create( + [in] PP_Instance instance, + [in] PP_Var name, + [in] PP_Alarms_AlarmCreateInfo_Dev alarm_info); + + /** + * Retrieves details about the specified alarm. + * + * @param[in] instance A <code>PP_Instance</code>. + * @param[in] name A string or undefined <code>PP_Var</code>. The name of the + * alarm to get. Defaults to the empty string. + * @param[out] alarm A <code>PP_Alarms_Alarm_Dev</code> struct to store the + * output result. + * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon + * completion. + * + * @return An error code from <code>pp_errors.h</code> + */ + int32_t Get( + [in] PP_Instance instance, + [in] PP_Var name, + [out] PP_Alarms_Alarm_Dev alarm, + [in] PP_CompletionCallback callback); + + /** + * Gets an array of all the alarms. + * + * @param[in] instance A <code>PP_Instance</code>. + * @param[out] alarms A <code>PP_Alarms_Alarm_Array_Dev</code> to store the + * output result. + * @param[in] array_allocator A <code>PP_ArrayOutput</code> to allocate memory + * for <code>alarms</code>. + * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon + * completion. + * + * @return An error code from <code>pp_errors.h</code> + */ + int32_t GetAll( + [in] PP_Instance instance, + [out] PP_Alarms_Alarm_Array_Dev alarms, + [in] PP_ArrayOutput array_allocator, + [in] PP_CompletionCallback callback); + + /** + * Clears the alarm with the given name. + * + * @param[in] instance A <code>PP_Instance</code>. + * @param[in] name A string or undefined <code>PP_Var</code>. The name of the + * alarm to clear. Defaults to the empty string. + */ + void Clear( + [in] PP_Instance instance, + [in] PP_Var name); + + /** + * Clears all alarms. + * + * @param[in] instance A <code>PP_Instance</code>. + */ + void ClearAll( + [in] PP_Instance instance); + + /** + * Registers <code>PP_Alarms_OnAlarm_Dev</code> event. + * + * @param[in] instance A <code>PP_Instance</code>. + * @param[in] callback The callback to receive notifications. + * @param[inout] user_data An opaque pointer that will be passed to + * <code>callback</code>. + * + * @return A listener ID, or 0 if failed. + * + * TODO(yzshen): add a PPB_Events_Dev interface for unregistering: + * void UnregisterListener(PP_instance instance, uint32_t listener_id); + */ + uint32_t AddOnAlarmListener( + [in] PP_Instance instance, + [in] PP_Alarms_OnAlarm_Dev callback, + [inout] mem_t user_data); +}; diff --git a/ppapi/api/extensions/dev/ppb_ext_alarms_dev.idl b/ppapi/api/extensions/dev/ppb_ext_alarms_dev.idl deleted file mode 100644 index 9e1fc65e29..0000000000 --- a/ppapi/api/extensions/dev/ppb_ext_alarms_dev.idl +++ /dev/null @@ -1,178 +0,0 @@ -/* Copyright (c) 2013 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 Pepper equivalent of the <code>chrome.alarms</code> - * extension API. - */ - -label Chrome { - M27 = 0.1 -}; - -#inline c -#include "ppapi/c/extensions/dev/ppb_ext_events_dev.h" -#endinl - -/** - * A dictionary <code>PP_Var</code> which contains: - * - "name" : string <code>PP_Var</code> - * Name of this alarm. - * - * - "scheduledTime" : double <code>PP_Var</code> - * Time at which this alarm was scheduled to fire, in milliseconds past the - * epoch (e.g. <code>Date.now() + n</code>). For performance reasons, the - * alarm may have been delayed an arbitrary amount beyond this. - * - * - "periodInMinutes" : double or undefined <code>PP_Var</code> - * If not undefined, the alarm is a repeating alarm and will fire again in - * <var>periodInMinutes</var> minutes. - */ -typedef PP_Var PP_Ext_Alarms_Alarm_Dev; - -/** - * A dictionary <code>PP_Var</code> which contains - * - "when" : double or undefined <code>PP_Var</code> - * Time at which the alarm should fire, in milliseconds past the epoch - * (e.g. <code>Date.now() + n</code>). - * - * - "delayInMinutes" : double or undefined <code>PP_Var</code> - * Length of time in minutes after which the - * <code>PP_Ext_Alarms_OnAlarm_Dev</code> event should fire. - * - * - "periodInMinutes" : double or undefined <code>PP_Var</code> - * If set, the <code>PP_Ext_Alarms_OnAlarm_Dev</code> event should fire every - * <var>periodInMinutes</var> minutes after the initial event specified by - * <var>when</var> or <var>delayInMinutes</var>. If not set, the alarm will - * only fire once. - */ -typedef PP_Var PP_Ext_Alarms_AlarmCreateInfo_Dev; - -/** - * An array <code>PP_Var</code> which contains elements of - * <code>PP_Ext_Alarms_Alarm_Dev</code>. - */ -typedef PP_Var PP_Ext_Alarms_Alarm_Dev_Array; - -interface PPB_Ext_Alarms_Dev { - /** - * Creates an alarm. Near the time(s) specified by <var>alarm_info</var>, - * the <code>PP_Ext_Alarms_OnAlarm_Dev</code> event is fired. If there is - * another alarm with the same name (or no name if none is specified), it will - * be cancelled and replaced by this alarm. - * - * In order to reduce the load on the user's machine, Chrome limits alarms - * to at most once every 1 minute but may delay them an arbitrary amount - * more. That is, setting - * <code>$ref:[PP_Ext_Alarms_AlarmCreateInfo_Dev.delayInMinutes - * delayInMinutes]</code> or - * <code>$ref:[PP_Ext_Alarms_AlarmCreateInfo_Dev.periodInMinutes - * periodInMinutes]</code> to less than <code>1</code> will not be honored - * and will cause a warning. - * <code>$ref:[PP_Ext_Alarms_AlarmCreateInfo_Dev.when when]</code> can be set - * to less than 1 minute after "now" without warning but won't actually cause - * the alarm to fire for at least 1 minute. - * - * To help you debug your app or extension, when you've loaded it unpacked, - * there's no limit to how often the alarm can fire. - * - * @param[in] instance A <code>PP_Instance</code>. - * @param[in] name A string or undefined <code>PP_Var</code>. Optional name to - * identify this alarm. Defaults to the empty string. - * @param[in] alarm_info A <code>PP_Var</code> whose contents conform to the - * description of <code>PP_Ext_Alarms_AlarmCreateInfo_Dev</code>. Describes - * when the alarm should fire. The initial time must be specified by either - * <var>when</var> or <var>delayInMinutes</var> (but not both). If - * <var>periodInMinutes</var> is set, the alarm will repeat every - * <var>periodInMinutes</var> minutes after the initial event. If neither - * <var>when</var> or <var>delayInMinutes</var> is set for a repeating alarm, - * <var>periodInMinutes</var> is used as the default for - * <var>delayInMinutes</var>. - */ - void Create( - [in] PP_Instance instance, - [in] PP_Var name, - [in] PP_Ext_Alarms_AlarmCreateInfo_Dev alarm_info); - - /** - * Retrieves details about the specified alarm. - * - * @param[in] instance A <code>PP_Instance</code>. - * @param[in] name A string or undefined <code>PP_Var</code>. The name of the - * alarm to get. Defaults to the empty string. - * @param[out] alarm A <code>PP_Var</code> whose contents conform to the - * description of <code>PP_Ext_Alarms_Alarm_Dev</code>. - * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon - * completion. - * - * @return An error code from <code>pp_errors.h</code> - */ - int32_t Get( - [in] PP_Instance instance, - [in] PP_Var name, - [out] PP_Ext_Alarms_Alarm_Dev alarm, - [in] PP_CompletionCallback callback); - - /** - * Gets an array of all the alarms. - * - * @param[in] instance A <code>PP_Instance</code>. - * @param[out] alarms A <code>PP_Var</code> whose contents conform to the - * description of <code>PP_Ext_Alarms_Alarm_Dev_Array</code>. - * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon - * completion. - * - * @return An error code from <code>pp_errors.h</code> - */ - int32_t GetAll( - [in] PP_Instance instance, - [out] PP_Ext_Alarms_Alarm_Dev_Array alarms, - [in] PP_CompletionCallback callback); - - /** - * Clears the alarm with the given name. - * - * @param[in] instance A <code>PP_Instance</code>. - * @param[in] name A string or undefined <code>PP_Var</code>. The name of the - * alarm to clear. Defaults to the empty string. - */ - void Clear( - [in] PP_Instance instance, - [in] PP_Var name); - - /** - * Clears all alarms. - * - * @param[in] instance A <code>PP_Instance</code>. - */ - void ClearAll( - [in] PP_Instance instance); -}; - -/** - * Fired when an alarm has elapsed. Useful for event pages. - * - * @param[in] listener_id The listener ID. - * @param[inout] user_data The opaque pointer that was used when registering the - * listener. - * @param[in] alarm A <code>PP_Var</code> whose contents conform to the - * description of <code>PP_Ext_Alarms_Alarm_Dev</code>. The alarm that has - * elapsed. - */ -typedef void PP_Ext_Alarms_OnAlarm_Func_Dev_0_1( - [in] uint32_t listener_id, - [inout] mem_t user_data, - [in] PP_Ext_Alarms_Alarm_Dev alarm); - -#inline c -PP_INLINE struct PP_Ext_EventListener PP_Ext_Alarms_OnAlarm_Dev_0_1( - PP_Ext_Alarms_OnAlarm_Func_Dev_0_1 func, - void* user_data) { - return PP_Ext_MakeEventListener("alarms.onAlarm;0.1", - (PP_Ext_GenericFuncType)(func), user_data); -} - -#define PP_Ext_Alarms_OnAlarm_Dev PP_Ext_Alarms_OnAlarm_Dev_0_1 -#endinl diff --git a/ppapi/api/extensions/dev/ppb_ext_events_dev.idl b/ppapi/api/extensions/dev/ppb_ext_events_dev.idl deleted file mode 100644 index cfcc809c7c..0000000000 --- a/ppapi/api/extensions/dev/ppb_ext_events_dev.idl +++ /dev/null @@ -1,87 +0,0 @@ -/* Copyright (c) 2013 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. - */ - -label Chrome { - M27 = 0.1 -}; - -/** - * Used to represent arbitrary C function pointers. Please note that usually - * the function that a <code>PP_Ext_GenericFuncType</code> pointer points to - * has a different signature than <code>void (*)()</code>. - */ -typedef void PP_Ext_GenericFuncType(); - -/** - * An event listener that can be registered with the browser and receive - * notifications via the callback function. - * - * A function is defined for each event type to return a properly-filled - * <code>PP_Ext_EventListener</code> struct, for example, - * <code>PP_Ext_Alarms_OnAlarm_Dev()</code>. - */ -[passByValue] -struct PP_Ext_EventListener { - /** - * The name of the event to register to. - */ - cstr_t event_name; - /** - * A callback function whose signature is determined by - * <code>event_name</code>. All calls will happen on the same thread as the - * one on which <code>AddListener()</code> is called. - */ - PP_Ext_GenericFuncType func; - /** - * An opaque pointer that will be passed to <code>func</code>. - */ - mem_t user_data; -}; - -interface PPB_Ext_Events_Dev { - /** - * Registers a listener to an event. - * - * @param[in] instance A <code>PP_Instance</code> identifying one instance of - * a module. - * @param[in] listener A <code>PP_Ext_EventListener</code> struct. - * - * @return An listener ID, or 0 if failed. - */ - uint32_t AddListener( - [in] PP_Instance instance, - [in] PP_Ext_EventListener listener); - - /** - * Deregisters a listener. - * - * @param[in] instance A <code>PP_Instance</code> identifying one instance of - * a module. - * @param[in] listener_id The ID returned by <code>AddListener()</code>. - */ - void RemoveListener( - [in] PP_Instance instance, - [in] uint32_t listener_id); -}; - -#inline c -/** - * Creates a <code>PP_Ext_EventListener</code> struct. - * - * Usually you should not call it directly. Instead you should call those - * functions that return a <code>PP_Ext_EventListener</code> struct for a - * specific event type, for example, <code>PP_Ext_Alarms_OnAlarm_Dev()</code>. - */ -PP_INLINE struct PP_Ext_EventListener PP_Ext_MakeEventListener( - const char* event_name, - PP_Ext_GenericFuncType func, - void* user_data) { - struct PP_Ext_EventListener listener; - listener.event_name = event_name; - listener.func = func; - listener.user_data = user_data; - return listener; -} -#endinl diff --git a/ppapi/api/private/ppb_content_decryptor_private.idl b/ppapi/api/private/ppb_content_decryptor_private.idl index 8577de2d0f..cade724598 100644 --- a/ppapi/api/private/ppb_content_decryptor_private.idl +++ b/ppapi/api/private/ppb_content_decryptor_private.idl @@ -12,97 +12,109 @@ [generate_thunk] label Chrome { - M32 = 0.8 + M33 = 0.9 }; /** * <code>PPB_ContentDecryptor_Private</code> structure contains the function * pointers the browser must implement to support plugins implementing the * <code>PPP_ContentDecryptor_Private</code> interface. This interface provides - * browser side support for the Content Decryption Module (CDM) for v0.1 of the - * proposed Encrypted Media Extensions: http://goo.gl/rbdnR + * browser side support for the Content Decryption Module (CDM) for Encrypted + * Media Extensions: http://www.w3.org/TR/encrypted-media/ */ interface PPB_ContentDecryptor_Private { /** - * A key has been added as the result of a call to the <code>AddKey()</code> - * method on the <code>PPP_ContentDecryptor_Private</code> interface. + * A session has been created by the CDM. * - * Note: The above describes the most simple case. Depending on the key - * system, a series of <code>KeyMessage()</code> calls from the CDM will be - * sent to the browser, and then on to the web application. The web - * application must then provide more data to the CDM by directing the browser - * to pass the data to the CDM via calls to <code>AddKey()</code> on the - * <code>PPP_ContentDecryptor_Private</code> interface. - * The CDM must call <code>KeyAdded()</code> when the sequence is completed, - * and, in response, the browser must notify the web application. + * @param[in] session_id Identifies the session for which the CDM + * created a session. + * + * @param[in] web_session_id A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the string for the + * MediaKeySession's sessionId attribute. * - * @param[in] reference_id A reference for the session for which a key - * was added. */ - void KeyAdded( + void SessionCreated( [in] PP_Instance instance, - [in] uint32_t reference_id); + [in] uint32_t session_id, + [in] PP_Var web_session_id); /** * A message or request has been generated for key_system in the CDM, and * must be sent to the web application. * - * For example, when the browser invokes <code>GenerateKeyRequest()</code> + * For example, when the browser invokes <code>CreateSession()</code> * on the <code>PPP_ContentDecryptor_Private</code> interface, the plugin - * must send a key message containing the key request. + * must send a message containing the license request. * - * Note that <code>KeyMessage()</code> can be used for purposes other than - * responses to <code>GenerateKeyRequest()</code> calls. See also the text - * in the comment for <code>KeyAdded()</code>, which describes a sequence of - * <code>AddKey()</code> and <code>KeyMessage()</code> calls required to - * prepare for decryption. + * Note that <code>SessionMessage()</code> can be used for purposes other than + * responses to <code>CreateSession()</code> calls. See also the text + * in the comment for <code>SessionReady()</code>, which describes a sequence + * of <code>UpdateSession()</code> and <code>SessionMessage()</code> calls + * required to prepare for decryption. * - * @param[in] reference_id A reference for the session for which the message + * @param[in] session_id Identifies the session for which the message * is intended. * * @param[in] message A <code>PP_Var</code> of type * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the message. * - * @param[in] default_url A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the default URL for the message. + * @param[in] destination_url A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the destination URL for the + * message. */ - void KeyMessage( + void SessionMessage( [in] PP_Instance instance, - [in] uint32_t reference_id, + [in] uint32_t session_id, [in] PP_Var message, - [in] PP_Var default_url); + [in] PP_Var destination_url); /** - * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, - * or within the plugin implementing the interface. + * The session is now ready to decrypt the media stream. * - * @param[in] reference_id A reference for the session for which the error - * is intended. + * Note: The above describes the most simple case. Depending on the key + * system, a series of <code>SessionMessage()</code> calls from the CDM will + * be sent to the browser, and then on to the web application. The web + * application must then provide more data to the CDM by directing the browser + * to pass the data to the CDM via calls to <code>UpdateSession()</code> on + * the <code>PPP_ContentDecryptor_Private</code> interface. + * The CDM must call <code>SessionReady()</code> when the sequence is + * completed, and, in response, the browser must notify the web application. * - * @param[in] media_error A MediaKeyError. + * @param[in] session_id Identifies the session that is ready. + */ + void SessionReady( + [in] PP_Instance instance, + [in] uint32_t session_id); + + /** + * The session has been closed as the result of a call to the + * <code>ReleaseSession()</code> method on the + * <code>PPP_ContentDecryptor_Private</code> interface, or due to other + * factors as determined by the CDM. * - * @param[in] system_error A system error code. + * @param[in] session_id Identifies the session that is closed. */ - void KeyError( + void SessionClosed( [in] PP_Instance instance, - [in] uint32_t reference_id, - [in] int32_t media_error, - [in] int32_t system_code); + [in] uint32_t session_id); /** - * A session ID has been generated by the CDM for a session. + * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, + * or within the plugin implementing the interface. * - * @param[in] reference_id A reference for the session for which the session - * id is intended. + * @param[in] session_id Identifies the session for which the error + * is intended. * - * @param[in] session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the session ID. + * @param[in] media_error A MediaKeyError. * + * @param[in] system_error A system error code. */ - void SetSessionId( + void SessionError( [in] PP_Instance instance, - [in] uint32_t reference_id, - [in] PP_Var session_id); + [in] uint32_t session_id, + [in] int32_t media_error, + [in] int32_t system_code); /** * Called after the <code>Decrypt()</code> method on the diff --git a/ppapi/api/private/ppb_nacl_private.idl b/ppapi/api/private/ppb_nacl_private.idl index 2d85044ac7..4e215d7fa8 100644 --- a/ppapi/api/private/ppb_nacl_private.idl +++ b/ppapi/api/private/ppb_nacl_private.idl @@ -146,10 +146,6 @@ interface PPB_NaCl_Private { void ReportTranslationFinished([in] PP_Instance instance, [in] PP_Bool success); - /* Return true if we are off the record. - */ - PP_Bool IsOffTheRecord(); - /* Display a UI message to the user. */ PP_ExternalPluginResult ReportNaClError([in] PP_Instance instance, [in] PP_NaClError message_id); diff --git a/ppapi/api/private/ppp_content_decryptor_private.idl b/ppapi/api/private/ppp_content_decryptor_private.idl index 0136ff07f8..b943efe4a8 100644 --- a/ppapi/api/private/ppp_content_decryptor_private.idl +++ b/ppapi/api/private/ppp_content_decryptor_private.idl @@ -9,15 +9,15 @@ * Decryption Modules, not normal plugins. */ label Chrome { - M32 = 0.8 + M33 = 0.9 }; /** * <code>PPP_ContentDecryptor_Private</code> structure contains the function * pointers the decryption plugin must implement to provide services needed by * the browser. This interface provides the plugin side support for the Content - * Decryption Module (CDM) for v0.1 of the proposed Encrypted Media Extensions: - * http://goo.gl/rbdnR + * Decryption Module (CDM) for Encrypted Media Extensions: + * http://www.w3.org/TR/encrypted-media/ */ interface PPP_ContentDecryptor_Private { /** @@ -31,16 +31,16 @@ interface PPP_ContentDecryptor_Private { [in] PP_Var key_system); /** - * Generates a key request. key_system specifies the key or licensing system - * to use. type contains the MIME type of init_data. init_data is a data - * buffer containing data for use in generating the request. + * Creates a session. <code>type</code> contains the MIME type of + * <code>init_data</code>. <code>init_data</code> is a data buffer + * containing data for use in generating the request. * - * Note: <code>GenerateKeyRequest()</code> must create the session ID used in + * Note: <code>CreateSession()</code> must create the session ID used in * other methods on this interface. The session ID must be provided to the - * browser by the CDM via <code>KeyMessage()</code> on the + * browser by the CDM via <code>SessionCreated()</code> on the * <code>PPB_ContentDecryptor_Private</code> interface. * - * @param[in] reference_id A reference for the session for which the key + * @param[in] session_id A reference for the session for which a session * should be generated. * * @param[in] type A <code>PP_Var</code> of type @@ -50,49 +50,44 @@ interface PPP_ContentDecryptor_Private { * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific * initialization data. */ - void GenerateKeyRequest( + void CreateSession( [in] PP_Instance instance, - [in] uint32_t reference_id, + [in] uint32_t session_id, [in] PP_Var type, [in] PP_Var init_data); /** - * Provides a key or license to the decryptor for decrypting media data. + * Provides a license or other message to the decryptor. * - * When the CDM needs more information to complete addition of the key it - * will call <code>KeyMessage()</code> on the - * <code>PPB_ContentDecryptor_Private</code> interface, which the browser - * passes to the application. When the key is ready to use, the CDM - * must call call <code>KeyAdded()</code> on the + * When the CDM needs more information, it must call + * <code>SessionMessage()</code> on the + * <code>PPB_ContentDecryptor_Private</code> interface, and the browser + * must notify the web application. When the CDM has finished processing + * <code>response</code> and needs no more information, it must call + * <code>SessionReady()</code> on the * <code>PPB_ContentDecryptor_Private</code> interface, and the browser * must notify the web application. * - * @param[in] reference_id A reference for the session for which the key - * should be added. - * - * @param[in] key A <code>PP_Var</code> of type - * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license, - * or other message for the given session ID. + * @param[in] session_id A reference for the session to update. * - * @param[in] init_data A <code>PP_Var</code> of type - * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific - * initialization data. + * @param[in] response A <code>PP_Var</code> of type + * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the license or other + * message for the given session ID. */ - void AddKey( + void UpdateSession( [in] PP_Instance instance, - [in] uint32_t reference_id, - [in] PP_Var key, - [in] PP_Var init_data); + [in] uint32_t session_id, + [in] PP_Var response); /** - * Cancels a pending key request for the specified session ID. + * Release the specified session and related resources. * - * @param[in] reference_id A reference for the session for which the key - * request should be cancelled. + * @param[in] session_id A reference for the session that should be + * released. */ - void CancelKeyRequest( + void ReleaseSession( [in] PP_Instance instance, - [in] uint32_t reference_id); + [in] uint32_t session_id); /** * Decrypts the block and returns the unencrypted block via diff --git a/ppapi/c/dev/pp_optional_structs_dev.h b/ppapi/c/dev/pp_optional_structs_dev.h new file mode 100644 index 0000000000..06608febb7 --- /dev/null +++ b/ppapi/c/dev/pp_optional_structs_dev.h @@ -0,0 +1,34 @@ +/* Copyright 2013 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 dev/pp_optional_structs_dev.idl modified Tue Dec 10 17:39:38 2013. */ + +#ifndef PPAPI_C_DEV_PP_OPTIONAL_STRUCTS_DEV_H_ +#define PPAPI_C_DEV_PP_OPTIONAL_STRUCTS_DEV_H_ + +#include "ppapi/c/pp_bool.h" +#include "ppapi/c/pp_macros.h" +#include "ppapi/c/pp_stdint.h" + +/** + * @file + * This file defines optional structs for primitive types. + */ + + +/** + * @addtogroup Structs + * @{ + */ +struct PP_Optional_Double_Dev { + double value; + PP_Bool is_set; +}; +/** + * @} + */ + +#endif /* PPAPI_C_DEV_PP_OPTIONAL_STRUCTS_DEV_H_ */ + diff --git a/ppapi/c/dev/ppb_alarms_dev.h b/ppapi/c/dev/ppb_alarms_dev.h new file mode 100644 index 0000000000..96617930b3 --- /dev/null +++ b/ppapi/c/dev/ppb_alarms_dev.h @@ -0,0 +1,210 @@ +/* Copyright 2013 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 dev/ppb_alarms_dev.idl modified Tue Dec 10 17:40:20 2013. */ + +#ifndef PPAPI_C_DEV_PPB_ALARMS_DEV_H_ +#define PPAPI_C_DEV_PPB_ALARMS_DEV_H_ + +#include "ppapi/c/dev/pp_optional_structs_dev.h" +#include "ppapi/c/pp_array_output.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_stdint.h" +#include "ppapi/c/pp_var.h" + +#define PPB_ALARMS_DEV_INTERFACE_0_1 "PPB_Alarms(Dev);0.1" +#define PPB_ALARMS_DEV_INTERFACE PPB_ALARMS_DEV_INTERFACE_0_1 + +/** + * @file + * This file defines the Pepper equivalent of the <code>chrome.alarms</code> + * extension API. + */ + + +/** + * @addtogroup Structs + * @{ + */ +struct PP_Alarms_Alarm_Dev { + /** + * Name of this alarm. + */ + struct PP_Var name; + /** + * Time at which this alarm was scheduled to fire, in milliseconds past the + * epoch. For performance reasons, the alarm may have been delayed an + * arbitrary amount beyond this. + */ + double scheduled_time; + /** + * If set, the alarm is a repeating alarm and will fire again in + * <code>period_in_minutes</code> minutes. + */ + struct PP_Optional_Double_Dev period_in_minutes; +}; + +struct PP_Alarms_AlarmCreateInfo_Dev { + /** + * Time at which the alarm should fire, in milliseconds past the epoch. + */ + struct PP_Optional_Double_Dev when; + /** + * Length of time in minutes after which the + * <code>PP_Alarms_OnAlarm_Dev</code> event should fire. + */ + struct PP_Optional_Double_Dev delay_in_minutes; + /** + * If set, the <code>PP_Alarms_OnAlarm_Dev</code> event should fire every + * <code>period_in_minutes</code> minutes after the initial event specified by + * <code>when</code> or <code>delay_in_minutes</code>. If not set, the alarm + * will only fire once. + */ + struct PP_Optional_Double_Dev period_in_minutes; +}; + +struct PP_Alarms_Alarm_Array_Dev { + uint32_t size; + struct PP_Alarms_Alarm_Dev *elements; +}; +/** + * @} + */ + +/** + * @addtogroup Typedefs + * @{ + */ +/** + * Fired when an alarm has elapsed. Useful for event pages. + * + * @param[in] listener_id The listener ID. + * @param[inout] user_data The opaque pointer that was used when registering the + * listener. + * @param[in] alarm The alarm that has elapsed. + */ +typedef void (*PP_Alarms_OnAlarm_Dev)( + uint32_t listener_id, + void* user_data, + const struct PP_Alarms_Alarm_Dev* alarm); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_Alarms_Dev_0_1 { + /** + * Creates an alarm. Near the time(s) specified by <code>alarm_info</code>, + * the <code>PP_Alarms_OnAlarm_Dev</code> event is fired. If there is another + * alarm with the same name (or no name if none is specified), it will be + * cancelled and replaced by this alarm. + * + * In order to reduce the load on the user's machine, Chrome limits alarms + * to at most once every 1 minute but may delay them an arbitrary amount more. + * That is, setting + * <code>PP_Alarms_AlarmCreateInfo_Dev.delay_in_minutes</code> or + * <code>PP_Alarms_AlarmCreateInfo_Dev.period_in_minutes</code> to less than + * <code>1</code> will not be honored and will cause a warning. + * <code>PP_Alarms_AlarmCreateInfo_Dev.when</code> can be set to less than 1 + * minute after "now" without warning but won't actually cause the alarm to + * fire for at least 1 minute. + * + * To help you debug your app or extension, when you've loaded it unpacked, + * there's no limit to how often the alarm can fire. + * + * @param[in] instance A <code>PP_Instance</code>. + * @param[in] name A string or undefined <code>PP_Var</code>. Optional name to + * identify this alarm. Defaults to the empty string. + * @param[in] alarm_info Describes when the alarm should fire. The initial + * time must be specified by either <code>when</code> or + * <code>delay_in_minutes</code> (but not both). If + * <code>period_in_minutes</code> is set, the alarm will repeat every + * <code>period_in_minutes</code> minutes after the initial event. If neither + * <code>when</code> or <code>delay_in_minutes</code> is set for a repeating + * alarm, <code>period_in_minutes</code> is used as the default for + * <code>delay_in_minutes</code>. + */ + void (*Create)(PP_Instance instance, + struct PP_Var name, + const struct PP_Alarms_AlarmCreateInfo_Dev* alarm_info); + /** + * Retrieves details about the specified alarm. + * + * @param[in] instance A <code>PP_Instance</code>. + * @param[in] name A string or undefined <code>PP_Var</code>. The name of the + * alarm to get. Defaults to the empty string. + * @param[out] alarm A <code>PP_Alarms_Alarm_Dev</code> struct to store the + * output result. + * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon + * completion. + * + * @return An error code from <code>pp_errors.h</code> + */ + int32_t (*Get)(PP_Instance instance, + struct PP_Var name, + struct PP_Alarms_Alarm_Dev* alarm, + struct PP_CompletionCallback callback); + /** + * Gets an array of all the alarms. + * + * @param[in] instance A <code>PP_Instance</code>. + * @param[out] alarms A <code>PP_Alarms_Alarm_Array_Dev</code> to store the + * output result. + * @param[in] array_allocator A <code>PP_ArrayOutput</code> to allocate memory + * for <code>alarms</code>. + * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon + * completion. + * + * @return An error code from <code>pp_errors.h</code> + */ + int32_t (*GetAll)(PP_Instance instance, + struct PP_Alarms_Alarm_Array_Dev* alarms, + struct PP_ArrayOutput array_allocator, + struct PP_CompletionCallback callback); + /** + * Clears the alarm with the given name. + * + * @param[in] instance A <code>PP_Instance</code>. + * @param[in] name A string or undefined <code>PP_Var</code>. The name of the + * alarm to clear. Defaults to the empty string. + */ + void (*Clear)(PP_Instance instance, struct PP_Var name); + /** + * Clears all alarms. + * + * @param[in] instance A <code>PP_Instance</code>. + */ + void (*ClearAll)(PP_Instance instance); + /** + * Registers <code>PP_Alarms_OnAlarm_Dev</code> event. + * + * @param[in] instance A <code>PP_Instance</code>. + * @param[in] callback The callback to receive notifications. + * @param[inout] user_data An opaque pointer that will be passed to + * <code>callback</code>. + * + * @return A listener ID, or 0 if failed. + * + * TODO(yzshen): add a PPB_Events_Dev interface for unregistering: + * void UnregisterListener(PP_instance instance, uint32_t listener_id); + */ + uint32_t (*AddOnAlarmListener)(PP_Instance instance, + PP_Alarms_OnAlarm_Dev callback, + void* user_data); +}; + +typedef struct PPB_Alarms_Dev_0_1 PPB_Alarms_Dev; +/** + * @} + */ + +#endif /* PPAPI_C_DEV_PPB_ALARMS_DEV_H_ */ + diff --git a/ppapi/c/extensions/dev/ppb_ext_alarms_dev.h b/ppapi/c/extensions/dev/ppb_ext_alarms_dev.h deleted file mode 100644 index e73de60e23..0000000000 --- a/ppapi/c/extensions/dev/ppb_ext_alarms_dev.h +++ /dev/null @@ -1,204 +0,0 @@ -/* Copyright (c) 2013 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 extensions/dev/ppb_ext_alarms_dev.idl, - * modified Wed Mar 20 13:50:11 2013. - */ - -#ifndef PPAPI_C_EXTENSIONS_DEV_PPB_EXT_ALARMS_DEV_H_ -#define PPAPI_C_EXTENSIONS_DEV_PPB_EXT_ALARMS_DEV_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_stdint.h" -#include "ppapi/c/pp_var.h" - -#define PPB_EXT_ALARMS_DEV_INTERFACE_0_1 "PPB_Ext_Alarms(Dev);0.1" -#define PPB_EXT_ALARMS_DEV_INTERFACE PPB_EXT_ALARMS_DEV_INTERFACE_0_1 - -/** - * @file - * This file defines the Pepper equivalent of the <code>chrome.alarms</code> - * extension API. - */ - - -#include "ppapi/c/extensions/dev/ppb_ext_events_dev.h" - -/** - * @addtogroup Typedefs - * @{ - */ -/** - * A dictionary <code>PP_Var</code> which contains: - * - "name" : string <code>PP_Var</code> - * Name of this alarm. - * - * - "scheduledTime" : double <code>PP_Var</code> - * Time at which this alarm was scheduled to fire, in milliseconds past the - * epoch (e.g. <code>Date.now() + n</code>). For performance reasons, the - * alarm may have been delayed an arbitrary amount beyond this. - * - * - "periodInMinutes" : double or undefined <code>PP_Var</code> - * If not undefined, the alarm is a repeating alarm and will fire again in - * <var>periodInMinutes</var> minutes. - */ -typedef struct PP_Var PP_Ext_Alarms_Alarm_Dev; - -/** - * A dictionary <code>PP_Var</code> which contains - * - "when" : double or undefined <code>PP_Var</code> - * Time at which the alarm should fire, in milliseconds past the epoch - * (e.g. <code>Date.now() + n</code>). - * - * - "delayInMinutes" : double or undefined <code>PP_Var</code> - * Length of time in minutes after which the - * <code>PP_Ext_Alarms_OnAlarm_Dev</code> event should fire. - * - * - "periodInMinutes" : double or undefined <code>PP_Var</code> - * If set, the <code>PP_Ext_Alarms_OnAlarm_Dev</code> event should fire every - * <var>periodInMinutes</var> minutes after the initial event specified by - * <var>when</var> or <var>delayInMinutes</var>. If not set, the alarm will - * only fire once. - */ -typedef struct PP_Var PP_Ext_Alarms_AlarmCreateInfo_Dev; - -/** - * An array <code>PP_Var</code> which contains elements of - * <code>PP_Ext_Alarms_Alarm_Dev</code>. - */ -typedef struct PP_Var PP_Ext_Alarms_Alarm_Dev_Array; -/** - * @} - */ - -/** - * @addtogroup Interfaces - * @{ - */ -struct PPB_Ext_Alarms_Dev_0_1 { - /** - * Creates an alarm. Near the time(s) specified by <var>alarm_info</var>, - * the <code>PP_Ext_Alarms_OnAlarm_Dev</code> event is fired. If there is - * another alarm with the same name (or no name if none is specified), it will - * be cancelled and replaced by this alarm. - * - * In order to reduce the load on the user's machine, Chrome limits alarms - * to at most once every 1 minute but may delay them an arbitrary amount - * more. That is, setting - * <code>$ref:[PP_Ext_Alarms_AlarmCreateInfo_Dev.delayInMinutes - * delayInMinutes]</code> or - * <code>$ref:[PP_Ext_Alarms_AlarmCreateInfo_Dev.periodInMinutes - * periodInMinutes]</code> to less than <code>1</code> will not be honored - * and will cause a warning. - * <code>$ref:[PP_Ext_Alarms_AlarmCreateInfo_Dev.when when]</code> can be set - * to less than 1 minute after "now" without warning but won't actually cause - * the alarm to fire for at least 1 minute. - * - * To help you debug your app or extension, when you've loaded it unpacked, - * there's no limit to how often the alarm can fire. - * - * @param[in] instance A <code>PP_Instance</code>. - * @param[in] name A string or undefined <code>PP_Var</code>. Optional name to - * identify this alarm. Defaults to the empty string. - * @param[in] alarm_info A <code>PP_Var</code> whose contents conform to the - * description of <code>PP_Ext_Alarms_AlarmCreateInfo_Dev</code>. Describes - * when the alarm should fire. The initial time must be specified by either - * <var>when</var> or <var>delayInMinutes</var> (but not both). If - * <var>periodInMinutes</var> is set, the alarm will repeat every - * <var>periodInMinutes</var> minutes after the initial event. If neither - * <var>when</var> or <var>delayInMinutes</var> is set for a repeating alarm, - * <var>periodInMinutes</var> is used as the default for - * <var>delayInMinutes</var>. - */ - void (*Create)(PP_Instance instance, - struct PP_Var name, - PP_Ext_Alarms_AlarmCreateInfo_Dev alarm_info); - /** - * Retrieves details about the specified alarm. - * - * @param[in] instance A <code>PP_Instance</code>. - * @param[in] name A string or undefined <code>PP_Var</code>. The name of the - * alarm to get. Defaults to the empty string. - * @param[out] alarm A <code>PP_Var</code> whose contents conform to the - * description of <code>PP_Ext_Alarms_Alarm_Dev</code>. - * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon - * completion. - * - * @return An error code from <code>pp_errors.h</code> - */ - int32_t (*Get)(PP_Instance instance, - struct PP_Var name, - PP_Ext_Alarms_Alarm_Dev* alarm, - struct PP_CompletionCallback callback); - /** - * Gets an array of all the alarms. - * - * @param[in] instance A <code>PP_Instance</code>. - * @param[out] alarms A <code>PP_Var</code> whose contents conform to the - * description of <code>PP_Ext_Alarms_Alarm_Dev_Array</code>. - * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon - * completion. - * - * @return An error code from <code>pp_errors.h</code> - */ - int32_t (*GetAll)(PP_Instance instance, - PP_Ext_Alarms_Alarm_Dev_Array* alarms, - struct PP_CompletionCallback callback); - /** - * Clears the alarm with the given name. - * - * @param[in] instance A <code>PP_Instance</code>. - * @param[in] name A string or undefined <code>PP_Var</code>. The name of the - * alarm to clear. Defaults to the empty string. - */ - void (*Clear)(PP_Instance instance, struct PP_Var name); - /** - * Clears all alarms. - * - * @param[in] instance A <code>PP_Instance</code>. - */ - void (*ClearAll)(PP_Instance instance); -}; - -typedef struct PPB_Ext_Alarms_Dev_0_1 PPB_Ext_Alarms_Dev; -/** - * @} - */ - -/** - * @addtogroup Typedefs - * @{ - */ -/** - * Fired when an alarm has elapsed. Useful for event pages. - * - * @param[in] listener_id The listener ID. - * @param[inout] user_data The opaque pointer that was used when registering the - * listener. - * @param[in] alarm A <code>PP_Var</code> whose contents conform to the - * description of <code>PP_Ext_Alarms_Alarm_Dev</code>. The alarm that has - * elapsed. - */ -typedef void (*PP_Ext_Alarms_OnAlarm_Func_Dev_0_1)( - uint32_t listener_id, - void* user_data, - PP_Ext_Alarms_Alarm_Dev alarm); -/** - * @} - */ - -PP_INLINE struct PP_Ext_EventListener PP_Ext_Alarms_OnAlarm_Dev_0_1( - PP_Ext_Alarms_OnAlarm_Func_Dev_0_1 func, - void* user_data) { - return PP_Ext_MakeEventListener("alarms.onAlarm;0.1", - (PP_Ext_GenericFuncType)(func), user_data); -} - -#define PP_Ext_Alarms_OnAlarm_Dev PP_Ext_Alarms_OnAlarm_Dev_0_1 -#endif /* PPAPI_C_EXTENSIONS_DEV_PPB_EXT_ALARMS_DEV_H_ */ - diff --git a/ppapi/c/extensions/dev/ppb_ext_events_dev.h b/ppapi/c/extensions/dev/ppb_ext_events_dev.h deleted file mode 100644 index 0c1c57ae41..0000000000 --- a/ppapi/c/extensions/dev/ppb_ext_events_dev.h +++ /dev/null @@ -1,120 +0,0 @@ -/* Copyright (c) 2013 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 extensions/dev/ppb_ext_events_dev.idl, - * modified Mon Mar 18 17:18:20 2013. - */ - -#ifndef PPAPI_C_EXTENSIONS_DEV_PPB_EXT_EVENTS_DEV_H_ -#define PPAPI_C_EXTENSIONS_DEV_PPB_EXT_EVENTS_DEV_H_ - -#include "ppapi/c/pp_instance.h" -#include "ppapi/c/pp_macros.h" -#include "ppapi/c/pp_stdint.h" - -#define PPB_EXT_EVENTS_DEV_INTERFACE_0_1 "PPB_Ext_Events(Dev);0.1" -#define PPB_EXT_EVENTS_DEV_INTERFACE PPB_EXT_EVENTS_DEV_INTERFACE_0_1 - -/** - * @file - */ - - -/** - * @addtogroup Typedefs - * @{ - */ -/** - * Used to represent arbitrary C function pointers. Please note that usually - * the function that a <code>PP_Ext_GenericFuncType</code> pointer points to - * has a different signature than <code>void (*)()</code>. - */ -typedef void (*PP_Ext_GenericFuncType)(void); -/** - * @} - */ - -/** - * @addtogroup Structs - * @{ - */ -/** - * An event listener that can be registered with the browser and receive - * notifications via the callback function. - * - * A function is defined for each event type to return a properly-filled - * <code>PP_Ext_EventListener</code> struct, for example, - * <code>PP_Ext_Alarms_OnAlarm_Dev()</code>. - */ -struct PP_Ext_EventListener { - /** - * The name of the event to register to. - */ - const char* event_name; - /** - * A callback function whose signature is determined by - * <code>event_name</code>. All calls will happen on the same thread as the - * one on which <code>AddListener()</code> is called. - */ - PP_Ext_GenericFuncType func; - /** - * An opaque pointer that will be passed to <code>func</code>. - */ - void* user_data; -}; -/** - * @} - */ - -/** - * @addtogroup Interfaces - * @{ - */ -struct PPB_Ext_Events_Dev_0_1 { - /** - * Registers a listener to an event. - * - * @param[in] instance A <code>PP_Instance</code> identifying one instance of - * a module. - * @param[in] listener A <code>PP_Ext_EventListener</code> struct. - * - * @return An listener ID, or 0 if failed. - */ - uint32_t (*AddListener)(PP_Instance instance, - struct PP_Ext_EventListener listener); - /** - * Deregisters a listener. - * - * @param[in] instance A <code>PP_Instance</code> identifying one instance of - * a module. - * @param[in] listener_id The ID returned by <code>AddListener()</code>. - */ - void (*RemoveListener)(PP_Instance instance, uint32_t listener_id); -}; - -typedef struct PPB_Ext_Events_Dev_0_1 PPB_Ext_Events_Dev; -/** - * @} - */ - -/** - * Creates a <code>PP_Ext_EventListener</code> struct. - * - * Usually you should not call it directly. Instead you should call those - * functions that return a <code>PP_Ext_EventListener</code> struct for a - * specific event type, for example, <code>PP_Ext_Alarms_OnAlarm_Dev()</code>. - */ -PP_INLINE struct PP_Ext_EventListener PP_Ext_MakeEventListener( - const char* event_name, - PP_Ext_GenericFuncType func, - void* user_data) { - struct PP_Ext_EventListener listener; - listener.event_name = event_name; - listener.func = func; - listener.user_data = user_data; - return listener; -} -#endif /* PPAPI_C_EXTENSIONS_DEV_PPB_EXT_EVENTS_DEV_H_ */ - diff --git a/ppapi/c/private/ppb_content_decryptor_private.h b/ppapi/c/private/ppb_content_decryptor_private.h index 72bd457e53..58492a00a4 100644 --- a/ppapi/c/private/ppb_content_decryptor_private.h +++ b/ppapi/c/private/ppb_content_decryptor_private.h @@ -4,7 +4,7 @@ */ /* From private/ppb_content_decryptor_private.idl, - * modified Mon Oct 21 17:11:33 2013. + * modified Fri Dec 6 12:16:22 2013. */ #ifndef PPAPI_C_PRIVATE_PPB_CONTENT_DECRYPTOR_PRIVATE_H_ @@ -18,10 +18,10 @@ #include "ppapi/c/pp_var.h" #include "ppapi/c/private/pp_content_decryptor.h" -#define PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_8 \ - "PPB_ContentDecryptor_Private;0.8" +#define PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_9 \ + "PPB_ContentDecryptor_Private;0.9" #define PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ - PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_8 + PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_9 /** * @file @@ -39,82 +39,91 @@ * <code>PPB_ContentDecryptor_Private</code> structure contains the function * pointers the browser must implement to support plugins implementing the * <code>PPP_ContentDecryptor_Private</code> interface. This interface provides - * browser side support for the Content Decryption Module (CDM) for v0.1 of the - * proposed Encrypted Media Extensions: http://goo.gl/rbdnR + * browser side support for the Content Decryption Module (CDM) for Encrypted + * Media Extensions: http://www.w3.org/TR/encrypted-media/ */ -struct PPB_ContentDecryptor_Private_0_8 { +struct PPB_ContentDecryptor_Private_0_9 { /** - * A key has been added as the result of a call to the <code>AddKey()</code> - * method on the <code>PPP_ContentDecryptor_Private</code> interface. + * A session has been created by the CDM. * - * Note: The above describes the most simple case. Depending on the key - * system, a series of <code>KeyMessage()</code> calls from the CDM will be - * sent to the browser, and then on to the web application. The web - * application must then provide more data to the CDM by directing the browser - * to pass the data to the CDM via calls to <code>AddKey()</code> on the - * <code>PPP_ContentDecryptor_Private</code> interface. - * The CDM must call <code>KeyAdded()</code> when the sequence is completed, - * and, in response, the browser must notify the web application. + * @param[in] session_id Identifies the session for which the CDM + * created a session. + * + * @param[in] web_session_id A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the string for the + * MediaKeySession's sessionId attribute. * - * @param[in] reference_id A reference for the session for which a key - * was added. */ - void (*KeyAdded)(PP_Instance instance, uint32_t reference_id); + void (*SessionCreated)(PP_Instance instance, + uint32_t session_id, + struct PP_Var web_session_id); /** * A message or request has been generated for key_system in the CDM, and * must be sent to the web application. * - * For example, when the browser invokes <code>GenerateKeyRequest()</code> + * For example, when the browser invokes <code>CreateSession()</code> * on the <code>PPP_ContentDecryptor_Private</code> interface, the plugin - * must send a key message containing the key request. + * must send a message containing the license request. * - * Note that <code>KeyMessage()</code> can be used for purposes other than - * responses to <code>GenerateKeyRequest()</code> calls. See also the text - * in the comment for <code>KeyAdded()</code>, which describes a sequence of - * <code>AddKey()</code> and <code>KeyMessage()</code> calls required to - * prepare for decryption. + * Note that <code>SessionMessage()</code> can be used for purposes other than + * responses to <code>CreateSession()</code> calls. See also the text + * in the comment for <code>SessionReady()</code>, which describes a sequence + * of <code>UpdateSession()</code> and <code>SessionMessage()</code> calls + * required to prepare for decryption. * - * @param[in] reference_id A reference for the session for which the message + * @param[in] session_id Identifies the session for which the message * is intended. * * @param[in] message A <code>PP_Var</code> of type * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the message. * - * @param[in] default_url A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the default URL for the message. + * @param[in] destination_url A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the destination URL for the + * message. */ - void (*KeyMessage)(PP_Instance instance, - uint32_t reference_id, - struct PP_Var message, - struct PP_Var default_url); + void (*SessionMessage)(PP_Instance instance, + uint32_t session_id, + struct PP_Var message, + struct PP_Var destination_url); /** - * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, - * or within the plugin implementing the interface. + * The session is now ready to decrypt the media stream. * - * @param[in] reference_id A reference for the session for which the error - * is intended. + * Note: The above describes the most simple case. Depending on the key + * system, a series of <code>SessionMessage()</code> calls from the CDM will + * be sent to the browser, and then on to the web application. The web + * application must then provide more data to the CDM by directing the browser + * to pass the data to the CDM via calls to <code>UpdateSession()</code> on + * the <code>PPP_ContentDecryptor_Private</code> interface. + * The CDM must call <code>SessionReady()</code> when the sequence is + * completed, and, in response, the browser must notify the web application. * - * @param[in] media_error A MediaKeyError. + * @param[in] session_id Identifies the session that is ready. + */ + void (*SessionReady)(PP_Instance instance, uint32_t session_id); + /** + * The session has been closed as the result of a call to the + * <code>ReleaseSession()</code> method on the + * <code>PPP_ContentDecryptor_Private</code> interface, or due to other + * factors as determined by the CDM. * - * @param[in] system_error A system error code. + * @param[in] session_id Identifies the session that is closed. */ - void (*KeyError)(PP_Instance instance, - uint32_t reference_id, - int32_t media_error, - int32_t system_code); + void (*SessionClosed)(PP_Instance instance, uint32_t session_id); /** - * A session ID has been generated by the CDM for a session. + * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, + * or within the plugin implementing the interface. * - * @param[in] reference_id A reference for the session for which the session - * id is intended. + * @param[in] session_id Identifies the session for which the error + * is intended. * - * @param[in] session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the session ID. + * @param[in] media_error A MediaKeyError. * + * @param[in] system_error A system error code. */ - void (*SetSessionId)(PP_Instance instance, - uint32_t reference_id, - struct PP_Var session_id); + void (*SessionError)(PP_Instance instance, + uint32_t session_id, + int32_t media_error, + int32_t system_code); /** * Called after the <code>Decrypt()</code> method on the * <code>PPP_ContentDecryptor_Private</code> interface completes to @@ -244,7 +253,7 @@ struct PPB_ContentDecryptor_Private_0_8 { const struct PP_DecryptedSampleInfo* decrypted_sample_info); }; -typedef struct PPB_ContentDecryptor_Private_0_8 PPB_ContentDecryptor_Private; +typedef struct PPB_ContentDecryptor_Private_0_9 PPB_ContentDecryptor_Private; /** * @} */ diff --git a/ppapi/c/private/ppb_nacl_private.h b/ppapi/c/private/ppb_nacl_private.h index 7ba7583e08..44bbb9fde9 100644 --- a/ppapi/c/private/ppb_nacl_private.h +++ b/ppapi/c/private/ppb_nacl_private.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From private/ppb_nacl_private.idl modified Thu Nov 14 08:29:25 2013. */ +/* From private/ppb_nacl_private.idl modified Fri Nov 29 09:11:40 2013. */ #ifndef PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ #define PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ @@ -160,9 +160,6 @@ struct PPB_NaCl_Private_1_0 { * the plugin.) */ void (*ReportTranslationFinished)(PP_Instance instance, PP_Bool success); - /* Return true if we are off the record. - */ - PP_Bool (*IsOffTheRecord)(void); /* Display a UI message to the user. */ PP_ExternalPluginResult (*ReportNaClError)(PP_Instance instance, PP_NaClError message_id); diff --git a/ppapi/c/private/ppp_content_decryptor_private.h b/ppapi/c/private/ppp_content_decryptor_private.h index 97ecf0dc63..27d172d7e7 100644 --- a/ppapi/c/private/ppp_content_decryptor_private.h +++ b/ppapi/c/private/ppp_content_decryptor_private.h @@ -4,7 +4,7 @@ */ /* From private/ppp_content_decryptor_private.idl, - * modified Fri Oct 18 18:11:09 2013. + * modified Tue Dec 3 17:05:10 2013. */ #ifndef PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ @@ -18,10 +18,10 @@ #include "ppapi/c/pp_var.h" #include "ppapi/c/private/pp_content_decryptor.h" -#define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_8 \ - "PPP_ContentDecryptor_Private;0.8" +#define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_9 \ + "PPP_ContentDecryptor_Private;0.9" #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ - PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_8 + PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_9 /** * @file @@ -39,10 +39,10 @@ * <code>PPP_ContentDecryptor_Private</code> structure contains the function * pointers the decryption plugin must implement to provide services needed by * the browser. This interface provides the plugin side support for the Content - * Decryption Module (CDM) for v0.1 of the proposed Encrypted Media Extensions: - * http://goo.gl/rbdnR + * Decryption Module (CDM) for Encrypted Media Extensions: + * http://www.w3.org/TR/encrypted-media/ */ -struct PPP_ContentDecryptor_Private_0_8 { +struct PPP_ContentDecryptor_Private_0_9 { /** * Initialize for the specified key system. * @@ -51,16 +51,16 @@ struct PPP_ContentDecryptor_Private_0_8 { */ void (*Initialize)(PP_Instance instance, struct PP_Var key_system); /** - * Generates a key request. key_system specifies the key or licensing system - * to use. type contains the MIME type of init_data. init_data is a data - * buffer containing data for use in generating the request. + * Creates a session. <code>type</code> contains the MIME type of + * <code>init_data</code>. <code>init_data</code> is a data buffer + * containing data for use in generating the request. * - * Note: <code>GenerateKeyRequest()</code> must create the session ID used in + * Note: <code>CreateSession()</code> must create the session ID used in * other methods on this interface. The session ID must be provided to the - * browser by the CDM via <code>KeyMessage()</code> on the + * browser by the CDM via <code>SessionCreated()</code> on the * <code>PPB_ContentDecryptor_Private</code> interface. * - * @param[in] reference_id A reference for the session for which the key + * @param[in] session_id A reference for the session for which a session * should be generated. * * @param[in] type A <code>PP_Var</code> of type @@ -70,43 +70,38 @@ struct PPP_ContentDecryptor_Private_0_8 { * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific * initialization data. */ - void (*GenerateKeyRequest)(PP_Instance instance, - uint32_t reference_id, - struct PP_Var type, - struct PP_Var init_data); + void (*CreateSession)(PP_Instance instance, + uint32_t session_id, + struct PP_Var type, + struct PP_Var init_data); /** - * Provides a key or license to the decryptor for decrypting media data. + * Provides a license or other message to the decryptor. * - * When the CDM needs more information to complete addition of the key it - * will call <code>KeyMessage()</code> on the - * <code>PPB_ContentDecryptor_Private</code> interface, which the browser - * passes to the application. When the key is ready to use, the CDM - * must call call <code>KeyAdded()</code> on the + * When the CDM needs more information, it must call + * <code>SessionMessage()</code> on the + * <code>PPB_ContentDecryptor_Private</code> interface, and the browser + * must notify the web application. When the CDM has finished processing + * <code>response</code> and needs no more information, it must call + * <code>SessionReady()</code> on the * <code>PPB_ContentDecryptor_Private</code> interface, and the browser * must notify the web application. * - * @param[in] reference_id A reference for the session for which the key - * should be added. - * - * @param[in] key A <code>PP_Var</code> of type - * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license, - * or other message for the given session ID. + * @param[in] session_id A reference for the session to update. * - * @param[in] init_data A <code>PP_Var</code> of type - * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific - * initialization data. + * @param[in] response A <code>PP_Var</code> of type + * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the license or other + * message for the given session ID. */ - void (*AddKey)(PP_Instance instance, - uint32_t reference_id, - struct PP_Var key, - struct PP_Var init_data); + void (*UpdateSession)(PP_Instance instance, + uint32_t session_id, + struct PP_Var response); /** - * Cancels a pending key request for the specified session ID. + * Release the specified session and related resources. * - * @param[in] reference_id A reference for the session for which the key - * request should be cancelled. + * @param[in] session_id A reference for the session that should be + * released. */ - void (*CancelKeyRequest)(PP_Instance instance, uint32_t reference_id); + void (*ReleaseSession)(PP_Instance instance, uint32_t session_id); /** * Decrypts the block and returns the unencrypted block via * <code>DeliverBlock()</code> on the @@ -233,7 +228,7 @@ struct PPP_ContentDecryptor_Private_0_8 { const struct PP_EncryptedBlockInfo* encrypted_block_info); }; -typedef struct PPP_ContentDecryptor_Private_0_8 PPP_ContentDecryptor_Private; +typedef struct PPP_ContentDecryptor_Private_0_9 PPP_ContentDecryptor_Private; /** * @} */ diff --git a/ppapi/cpp/extensions/dev/alarms_dev.cc b/ppapi/cpp/extensions/dev/alarms_dev.cc deleted file mode 100644 index 1cf8464635..0000000000 --- a/ppapi/cpp/extensions/dev/alarms_dev.cc +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) 2013 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. - -#include "ppapi/cpp/extensions/dev/alarms_dev.h" - -#include "ppapi/cpp/completion_callback.h" -#include "ppapi/cpp/extensions/optional.h" -#include "ppapi/cpp/extensions/to_var_converter.h" -#include "ppapi/cpp/logging.h" -#include "ppapi/cpp/module_impl.h" -#include "ppapi/cpp/var_dictionary.h" - -namespace pp { - -namespace { - -template <> const char* interface_name<PPB_Ext_Alarms_Dev_0_1>() { - return PPB_EXT_ALARMS_DEV_INTERFACE_0_1; -} - -} // namespace - -namespace ext { -namespace alarms { - -const char* const Alarm_Dev::kName = "name"; -const char* const Alarm_Dev::kScheduledTime = "scheduledTime"; -const char* const Alarm_Dev::kPeriodInMinutes = "periodInMinutes"; - -Alarm_Dev::Alarm_Dev() - : name(kName), - scheduled_time(kScheduledTime), - period_in_minutes(kPeriodInMinutes) { -} - -Alarm_Dev::~Alarm_Dev() { -} - -bool Alarm_Dev::Populate(const PP_Ext_Alarms_Alarm_Dev& value) { - if (value.type != PP_VARTYPE_DICTIONARY) - return false; - - VarDictionary dict(value); - bool result = name.Populate(dict); - result = scheduled_time.Populate(dict) && result; - result = period_in_minutes.Populate(dict) && result; - - return result; -} - -Var Alarm_Dev::CreateVar() const { - VarDictionary dict; - - bool result = name.AddTo(&dict); - result = scheduled_time.AddTo(&dict) && result; - result = period_in_minutes.MayAddTo(&dict) && result; - PP_DCHECK(result); - - return dict; -} - -const char* const AlarmCreateInfo_Dev::kWhen = "when"; -const char* const AlarmCreateInfo_Dev::kDelayInMinutes = "delayInMinutes"; -const char* const AlarmCreateInfo_Dev::kPeriodInMinutes = "periodInMinutes"; - -AlarmCreateInfo_Dev::AlarmCreateInfo_Dev() - : when(kWhen), - delay_in_minutes(kDelayInMinutes), - period_in_minutes(kPeriodInMinutes) { -} - -AlarmCreateInfo_Dev::~AlarmCreateInfo_Dev() { -} - -bool AlarmCreateInfo_Dev::Populate( - const PP_Ext_Alarms_AlarmCreateInfo_Dev& value) { - if (value.type != PP_VARTYPE_DICTIONARY) - return false; - - VarDictionary dict(value); - bool result = when.Populate(dict); - result = delay_in_minutes.Populate(dict) && result; - result = period_in_minutes.Populate(dict) && result; - - return result; -} - -Var AlarmCreateInfo_Dev::CreateVar() const { - VarDictionary dict; - - bool result = when.MayAddTo(&dict); - result = delay_in_minutes.MayAddTo(&dict) && result; - result = period_in_minutes.MayAddTo(&dict) && result; - PP_DCHECK(result); - - return dict; -} - -Alarms_Dev::Alarms_Dev(const InstanceHandle& instance) : instance_(instance) { -} - -Alarms_Dev::~Alarms_Dev() { -} - -void Alarms_Dev::Create(const Optional<std::string>& name, - const AlarmCreateInfo_Dev& alarm_info) { - if (!has_interface<PPB_Ext_Alarms_Dev_0_1>()) - return; - - internal::ToVarConverter<Optional<std::string> > name_var(name); - internal::ToVarConverter<AlarmCreateInfo_Dev> alarm_info_var(alarm_info); - - return get_interface<PPB_Ext_Alarms_Dev_0_1>()->Create( - instance_.pp_instance(), - name_var.pp_var(), - alarm_info_var.pp_var()); -} - -int32_t Alarms_Dev::Get(const Optional<std::string>& name, - const GetCallback& callback) { - if (!has_interface<PPB_Ext_Alarms_Dev_0_1>()) - return callback.MayForce(PP_ERROR_NOINTERFACE); - - internal::ToVarConverter<Optional<std::string> > name_var(name); - - return get_interface<PPB_Ext_Alarms_Dev_0_1>()->Get( - instance_.pp_instance(), - name_var.pp_var(), - callback.output(), - callback.pp_completion_callback()); -} - -int32_t Alarms_Dev::GetAll(const GetAllCallback& callback) { - if (!has_interface<PPB_Ext_Alarms_Dev_0_1>()) - return callback.MayForce(PP_ERROR_NOINTERFACE); - - return get_interface<PPB_Ext_Alarms_Dev_0_1>()->GetAll( - instance_.pp_instance(), - callback.output(), - callback.pp_completion_callback()); -} - -void Alarms_Dev::Clear(const Optional<std::string>& name) { - if (!has_interface<PPB_Ext_Alarms_Dev_0_1>()) - return; - - internal::ToVarConverter<Optional<std::string> > name_var(name); - - return get_interface<PPB_Ext_Alarms_Dev_0_1>()->Clear( - instance_.pp_instance(), - name_var.pp_var()); -} - -void Alarms_Dev::ClearAll() { - if (!has_interface<PPB_Ext_Alarms_Dev_0_1>()) - return; - - return get_interface<PPB_Ext_Alarms_Dev_0_1>()->ClearAll( - instance_.pp_instance()); -} - -OnAlarmEvent_Dev::OnAlarmEvent_Dev( - const InstanceHandle& instance, - Listener* listener) - : internal::EventBase1<PP_Ext_Alarms_OnAlarm_Dev, Alarm_Dev>(instance), - listener_(listener) { -} - -OnAlarmEvent_Dev::~OnAlarmEvent_Dev() { -} - -void OnAlarmEvent_Dev::Callback(Alarm_Dev& alarm) { - listener_->OnAlarm(alarm); -} - -} // namespace alarms -} // namespace ext -} // namespace pp diff --git a/ppapi/cpp/extensions/dev/alarms_dev.h b/ppapi/cpp/extensions/dev/alarms_dev.h deleted file mode 100644 index 57d82d0bf8..0000000000 --- a/ppapi/cpp/extensions/dev/alarms_dev.h +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) 2013 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_CPP_EXTENSIONS_DEV_ALARMS_DEV_H_ -#define PPAPI_CPP_EXTENSIONS_DEV_ALARMS_DEV_H_ - -#include <string> -#include <vector> - -#include "ppapi/c/extensions/dev/ppb_ext_alarms_dev.h" -#include "ppapi/cpp/extensions/dict_field.h" -#include "ppapi/cpp/extensions/event_base.h" -#include "ppapi/cpp/extensions/ext_output_traits.h" -#include "ppapi/cpp/instance_handle.h" -#include "ppapi/cpp/var.h" - -namespace pp { -namespace ext { - -template <class T> -class ExtCompletionCallbackWithOutput; - -template <class T> -class Optional; - -namespace alarms { - -// Data types ------------------------------------------------------------------ -class Alarm_Dev { - public: - Alarm_Dev(); - ~Alarm_Dev(); - - bool Populate(const PP_Ext_Alarms_Alarm_Dev& value); - - Var CreateVar() const; - - static const char* const kName; - static const char* const kScheduledTime; - static const char* const kPeriodInMinutes; - - DictField<std::string> name; - DictField<double> scheduled_time; - OptionalDictField<double> period_in_minutes; -}; - -class AlarmCreateInfo_Dev { - public: - AlarmCreateInfo_Dev(); - ~AlarmCreateInfo_Dev(); - - bool Populate(const PP_Ext_Alarms_AlarmCreateInfo_Dev& value); - - Var CreateVar() const; - - static const char* const kWhen; - static const char* const kDelayInMinutes; - static const char* const kPeriodInMinutes; - - OptionalDictField<double> when; - OptionalDictField<double> delay_in_minutes; - OptionalDictField<double> period_in_minutes; -}; - -// Functions ------------------------------------------------------------------- -class Alarms_Dev { - public: - explicit Alarms_Dev(const InstanceHandle& instance); - ~Alarms_Dev(); - - void Create(const Optional<std::string>& name, - const AlarmCreateInfo_Dev& alarm_info); - - typedef ExtCompletionCallbackWithOutput<Alarm_Dev> GetCallback; - int32_t Get(const Optional<std::string>& name, const GetCallback& callback); - - typedef ExtCompletionCallbackWithOutput<std::vector<Alarm_Dev> > - GetAllCallback; - int32_t GetAll(const GetAllCallback& callback); - - void Clear(const Optional<std::string>& name); - - void ClearAll(); - - private: - InstanceHandle instance_; -}; - -// Events ---------------------------------------------------------------------- -// Please see ppapi/cpp/extensions/event_base.h for how to use an event class. - -class OnAlarmEvent_Dev - : public internal::EventBase1<PP_Ext_Alarms_OnAlarm_Dev, Alarm_Dev> { - public: - class Listener { - public: - virtual ~Listener() {} - - virtual void OnAlarm(Alarm_Dev& alarm) = 0; - }; - - // |listener| is not owned by this instance and must outlive it. - OnAlarmEvent_Dev(const InstanceHandle& instance, Listener* listener); - virtual ~OnAlarmEvent_Dev(); - - private: - virtual void Callback(Alarm_Dev& alarm); - - Listener* listener_; -}; - -} // namespace alarms -} // namespace ext -} // namespace pp - -#endif // PPAPI_CPP_EXTENSIONS_DEV_ALARMS_DEV_H_ diff --git a/ppapi/cpp/extensions/dev/events_dev.cc b/ppapi/cpp/extensions/dev/events_dev.cc deleted file mode 100644 index d80008f2dc..0000000000 --- a/ppapi/cpp/extensions/dev/events_dev.cc +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2013 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. - -#include "ppapi/cpp/extensions/dev/events_dev.h" - -#include "ppapi/c/extensions/dev/ppb_ext_events_dev.h" -#include "ppapi/cpp/module_impl.h" - -namespace pp { - -namespace { - -template <> const char* interface_name<PPB_Ext_Events_Dev_0_1>() { - return PPB_EXT_EVENTS_DEV_INTERFACE_0_1; -} - -} // namespace - -namespace ext { -namespace events { - -// static -uint32_t Events_Dev::AddListener(PP_Instance instance, - const PP_Ext_EventListener& listener) { - if (!has_interface<PPB_Ext_Events_Dev_0_1>()) - return 0; - return get_interface<PPB_Ext_Events_Dev_0_1>()->AddListener(instance, - listener); -} - -// static -void Events_Dev::RemoveListener(PP_Instance instance, - uint32_t listener_id) { - if (has_interface<PPB_Ext_Events_Dev_0_1>()) { - get_interface<PPB_Ext_Events_Dev_0_1>()->RemoveListener(instance, - listener_id); - } -} - -} // namespace events -} // namespace ext -} // namespace pp diff --git a/ppapi/cpp/extensions/dev/events_dev.h b/ppapi/cpp/extensions/dev/events_dev.h deleted file mode 100644 index e816ca5fb8..0000000000 --- a/ppapi/cpp/extensions/dev/events_dev.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2013 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_CPP_EXTENSIONS_DEV_EVENTS_DEV_H_ -#define PPAPI_CPP_EXTENSIONS_DEV_EVENTS_DEV_H_ - -#include "ppapi/c/pp_instance.h" -#include "ppapi/c/pp_stdint.h" - -struct PP_Ext_EventListener; - -namespace pp { -namespace ext { -namespace events { - -// This is a simple wrapper of the PPB_Ext_Events_Dev interface. -// -// Usually you don't have to directly use this interface. Instead, you could -// use those more object-oriented event classes. Please see -// ppapi/cpp/extensions/event_base.h for more details. -class Events_Dev { - public: - static uint32_t AddListener(PP_Instance instance, - const PP_Ext_EventListener& listener); - - static void RemoveListener(PP_Instance instance, uint32_t listener_id); -}; - -} // namespace events -} // namespace ext -} // namespace pp - -#endif // PPAPI_CPP_EXTENSIONS_DEV_EVENTS_DEV_H_ diff --git a/ppapi/cpp/extensions/event_base.cc b/ppapi/cpp/extensions/event_base.cc deleted file mode 100644 index 210b213d0e..0000000000 --- a/ppapi/cpp/extensions/event_base.cc +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2013 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. - -#include "ppapi/cpp/extensions/event_base.h" - -#include "ppapi/cpp/extensions/dev/events_dev.h" - -namespace pp { -namespace ext { -namespace internal { - -GenericEventBase::GenericEventBase( - const InstanceHandle& instance, - const PP_Ext_EventListener& pp_listener) - : instance_(instance), - listener_id_(0), - pp_listener_(pp_listener) { -} - -GenericEventBase::~GenericEventBase() { - StopListening(); -} - -bool GenericEventBase::StartListening() { - if (IsListening()) - return true; - - listener_id_ = events::Events_Dev::AddListener(instance_.pp_instance(), - pp_listener_); - return IsListening(); -} - -void GenericEventBase::StopListening() { - if (!IsListening()) - return; - - events::Events_Dev::RemoveListener(instance_.pp_instance(), listener_id_); - listener_id_ = 0; -} - -} // namespace internal -} // namespace ext -} // namespace pp diff --git a/ppapi/cpp/extensions/event_base.h b/ppapi/cpp/extensions/event_base.h deleted file mode 100644 index 75144c0d8b..0000000000 --- a/ppapi/cpp/extensions/event_base.h +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) 2013 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_CPP_EXTENSIONS_EVENT_BASE_H_ -#define PPAPI_CPP_EXTENSIONS_EVENT_BASE_H_ - -#include "ppapi/c/extensions/dev/ppb_ext_events_dev.h" -#include "ppapi/c/pp_macros.h" -#include "ppapi/c/pp_stdint.h" -#include "ppapi/c/pp_var.h" -#include "ppapi/cpp/extensions/from_var_converter.h" -#include "ppapi/cpp/instance_handle.h" -#include "ppapi/cpp/logging.h" - -namespace pp { -namespace ext { -namespace internal { - -// This file contains base classes for events. Usually you don't need to use -// them directly. -// -// For each event type, there is a corresponding event class derived from -// EventBase[0-3]. The event class defines a Listener interface and exposes the -// public methods of GenericEventBase. -// -// Take pp::ext::alarms::OnAlarmEvent_Dev as example, your code to listen to the -// event would look like this: -// -// class MyListener : public pp::ext::alarms::OnAlarmEvent_Dev { -// ... -// // The parameter is a non-const reference so you could directly modify it -// // if necessary. -// virtual void OnAlarm(Alarm_Dev& alarm) { -// ...handle the event... -// } -// }; -// -// MyListener on_alarm_listener; -// // The listener is not owned by the event and must outlive it. -// pp::ext::alarms::OnAlarmEvent_Dev on_alarm(instance, &on_alarm_listener); -// on_alarm.StartListening(); -// ... -// // It is guaranteed that |on_alarm_listener| won't get called after -// // |on_alarm| goes away. So this step is optional. -// on_alarm.StopListening(); - -class GenericEventBase { - public: - bool StartListening(); - void StopListening(); - - bool IsListening() const { return listener_id_ != 0; } - uint32_t listener_id() const { return listener_id_; } - - protected: - GenericEventBase(const InstanceHandle& instance, - const PP_Ext_EventListener& pp_listener); - ~GenericEventBase(); - - InstanceHandle instance_; - uint32_t listener_id_; - const PP_Ext_EventListener pp_listener_; - - private: - // Disallow copying and assignment. - GenericEventBase(const GenericEventBase&); - GenericEventBase& operator=(const GenericEventBase&); -}; - -// EventBase[0-3] are event base classes which can be instantiated with a -// pointer to a PP_Ext_EventListener creation function and the input parameter -// types of the listener callback. -// -// For example, EvenBase1<PP_Ext_Alarms_OnAlarm_Dev, Alarm_Dev> deals with -// the event type defined by the PP_Ext_Alarms_OnAlarm_Dev function pointer. And -// it defines a pure virtual method as the listener callback: -// virtual void Callback(Alarm_Dev&) = 0; - -typedef PP_Ext_EventListener (*CreatePPEventListener0)( - void (*)(uint32_t, void*), void*); -template <const CreatePPEventListener0 kCreatePPEventListener0> -class EventBase0 : public GenericEventBase { - public: - explicit EventBase0(const InstanceHandle& instance) - : PP_ALLOW_THIS_IN_INITIALIZER_LIST( - GenericEventBase(instance, - kCreatePPEventListener0(&CallbackThunk, this))) { - } - - virtual ~EventBase0() {} - - private: - virtual void Callback() = 0; - - static void CallbackThunk(uint32_t listener_id, void* user_data) { - EventBase0<kCreatePPEventListener0>* event_base = - static_cast<EventBase0<kCreatePPEventListener0>*>(user_data); - PP_DCHECK(listener_id == event_base->listener_id_); - // Suppress unused variable warnings. - static_cast<void>(listener_id); - - event_base->Callback(); - } - - // Disallow copying and assignment. - EventBase0(const EventBase0<kCreatePPEventListener0>&); - EventBase0<kCreatePPEventListener0>& operator=( - const EventBase0<kCreatePPEventListener0>&); -}; - -typedef PP_Ext_EventListener (*CreatePPEventListener1)( - void (*)(uint32_t, void*, PP_Var), void*); -template <const CreatePPEventListener1 kCreatePPEventListener1, class A> -class EventBase1 : public GenericEventBase { - public: - explicit EventBase1(const InstanceHandle& instance) - : PP_ALLOW_THIS_IN_INITIALIZER_LIST( - GenericEventBase(instance, - kCreatePPEventListener1(&CallbackThunk, this))) { - } - - virtual ~EventBase1() {} - - private: - virtual void Callback(A&) = 0; - - static void CallbackThunk(uint32_t listener_id, - void* user_data, - PP_Var var_a) { - EventBase1<kCreatePPEventListener1, A>* event_base = - static_cast<EventBase1<kCreatePPEventListener1, A>*>(user_data); - PP_DCHECK(listener_id == event_base->listener_id_); - // Suppress unused variable warnings. - static_cast<void>(listener_id); - - FromVarConverter<A> a(var_a); - event_base->Callback(a.value()); - } - - // Disallow copying and assignment. - EventBase1(const EventBase1<kCreatePPEventListener1, A>&); - EventBase1<kCreatePPEventListener1, A>& operator=( - const EventBase1<kCreatePPEventListener1, A>&); -}; - -typedef PP_Ext_EventListener (*CreatePPEventListener2)( - void (*)(uint32_t, void*, PP_Var, PP_Var), void*); -template <const CreatePPEventListener2 kCreatePPEventListener2, - class A, - class B> -class EventBase2 : public GenericEventBase { - public: - explicit EventBase2(const InstanceHandle& instance) - : PP_ALLOW_THIS_IN_INITIALIZER_LIST( - GenericEventBase(instance, - kCreatePPEventListener2(&CallbackThunk, this))) { - } - - virtual ~EventBase2() {} - - private: - virtual void Callback(A&, B&) = 0; - - static void CallbackThunk(uint32_t listener_id, - void* user_data, - PP_Var var_a, - PP_Var var_b) { - EventBase2<kCreatePPEventListener2, A, B>* event_base = - static_cast<EventBase2<kCreatePPEventListener2, A, B>*>(user_data); - PP_DCHECK(listener_id == event_base->listener_id_); - // Suppress unused variable warnings. - static_cast<void>(listener_id); - - FromVarConverter<A> a(var_a); - FromVarConverter<B> b(var_b); - event_base->Callback(a.value(), b.value()); - } - - // Disallow copying and assignment. - EventBase2(const EventBase2<kCreatePPEventListener2, A, B>&); - EventBase2<kCreatePPEventListener2, A, B>& operator=( - const EventBase2<kCreatePPEventListener2, A, B>&); -}; - -typedef PP_Ext_EventListener (*CreatePPEventListener3)( - void (*)(uint32_t, void*, PP_Var, PP_Var, PP_Var), void*); -template <const CreatePPEventListener3 kCreatePPEventListener3, - class A, - class B, - class C> -class EventBase3 : public GenericEventBase { - public: - explicit EventBase3(const InstanceHandle& instance) - : PP_ALLOW_THIS_IN_INITIALIZER_LIST( - GenericEventBase(instance, - kCreatePPEventListener3(&CallbackThunk, this))) { - } - - virtual ~EventBase3() {} - - private: - virtual void Callback(A&, B&, C&) = 0; - - static void CallbackThunk(uint32_t listener_id, - void* user_data, - PP_Var var_a, - PP_Var var_b, - PP_Var var_c) { - EventBase3<kCreatePPEventListener3, A, B, C>* event_base = - static_cast<EventBase3<kCreatePPEventListener3, A, B, C>*>(user_data); - PP_DCHECK(listener_id == event_base->listener_id_); - // Suppress unused variable warnings. - static_cast<void>(listener_id); - - FromVarConverter<A> a(var_a); - FromVarConverter<B> b(var_b); - FromVarConverter<C> c(var_c); - event_base->Callback(a.value(), b.value(), c.value()); - } - - // Disallow copying and assignment. - EventBase3(const EventBase3<kCreatePPEventListener3, A, B, C>&); - EventBase3<kCreatePPEventListener3, A, B, C>& operator=( - const EventBase3<kCreatePPEventListener3, A, B, C>&); -}; - -} // namespace internal -} // namespace ext -} // namespace pp - -#endif // PPAPI_CPP_EXTENSIONS_EVENT_BASE_H_ diff --git a/ppapi/cpp/private/content_decryptor_private.cc b/ppapi/cpp/private/content_decryptor_private.cc index 905b115d49..776393a2e2 100644 --- a/ppapi/cpp/private/content_decryptor_private.cc +++ b/ppapi/cpp/private/content_decryptor_private.cc @@ -38,10 +38,10 @@ void Initialize(PP_Instance instance, key_system_var.AsString()); } -void GenerateKeyRequest(PP_Instance instance, - uint32_t reference_id, - PP_Var type_arg, - PP_Var init_data_arg) { +void CreateSession(PP_Instance instance, + uint32_t session_id, + PP_Var type_arg, + PP_Var init_data_arg) { void* object = Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); if (!object) @@ -56,45 +56,34 @@ void GenerateKeyRequest(PP_Instance instance, return; pp::VarArrayBuffer init_data_array_buffer(init_data_var); - static_cast<ContentDecryptor_Private*>(object)->GenerateKeyRequest( - reference_id, - type_var.AsString(), - init_data_array_buffer); + static_cast<ContentDecryptor_Private*>(object) + ->CreateSession(session_id, type_var.AsString(), init_data_array_buffer); } -void AddKey(PP_Instance instance, - uint32_t reference_id, - PP_Var key_arg, - PP_Var init_data_arg) { +void UpdateSession(PP_Instance instance, + uint32_t session_id, + PP_Var response_arg) { void* object = Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); if (!object) return; - pp::Var key_var(pp::PASS_REF, key_arg); - if (!key_var.is_array_buffer()) + pp::Var response_var(pp::PASS_REF, response_arg); + if (!response_var.is_array_buffer()) return; - pp::VarArrayBuffer key(key_var); + pp::VarArrayBuffer response(response_var); - pp::Var init_data_var(pp::PASS_REF, init_data_arg); - if (!init_data_var.is_array_buffer()) - return; - pp::VarArrayBuffer init_data(init_data_var); - - static_cast<ContentDecryptor_Private*>(object)->AddKey( - reference_id, - key, - init_data); + static_cast<ContentDecryptor_Private*>(object) + ->UpdateSession(session_id, response); } -void CancelKeyRequest(PP_Instance instance, uint32_t reference_id) { +void ReleaseSession(PP_Instance instance, uint32_t session_id) { void* object = Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); if (!object) return; - static_cast<ContentDecryptor_Private*>(object)->CancelKeyRequest( - reference_id); + static_cast<ContentDecryptor_Private*>(object)->ReleaseSession(session_id); } @@ -187,9 +176,9 @@ void DecryptAndDecode(PP_Instance instance, const PPP_ContentDecryptor_Private ppp_content_decryptor = { &Initialize, - &GenerateKeyRequest, - &AddKey, - &CancelKeyRequest, + &CreateSession, + &UpdateSession, + &ReleaseSession, &Decrypt, &InitializeAudioDecoder, &InitializeVideoDecoder, @@ -217,47 +206,54 @@ ContentDecryptor_Private::~ContentDecryptor_Private() { this); } -void ContentDecryptor_Private::KeyAdded(uint32_t reference_id) { +void ContentDecryptor_Private::SessionCreated( + uint32_t session_id, + const std::string& web_session_id) { if (has_interface<PPB_ContentDecryptor_Private>()) { - get_interface<PPB_ContentDecryptor_Private>()->KeyAdded( + pp::Var web_session_id_var(web_session_id); + get_interface<PPB_ContentDecryptor_Private>()->SessionCreated( associated_instance_.pp_instance(), - reference_id); + session_id, + web_session_id_var.pp_var()); } } -void ContentDecryptor_Private::KeyMessage(uint32_t reference_id, - pp::VarArrayBuffer message, - const std::string& default_url) { +void ContentDecryptor_Private::SessionMessage(uint32_t session_id, + pp::VarArrayBuffer message, + const std::string& default_url) { if (has_interface<PPB_ContentDecryptor_Private>()) { pp::Var default_url_var(default_url); - get_interface<PPB_ContentDecryptor_Private>()->KeyMessage( + get_interface<PPB_ContentDecryptor_Private>()->SessionMessage( associated_instance_.pp_instance(), - reference_id, + session_id, message.pp_var(), default_url_var.pp_var()); } } -void ContentDecryptor_Private::KeyError(uint32_t reference_id, - int32_t media_error, - int32_t system_code) { +void ContentDecryptor_Private::SessionReady(uint32_t session_id) { if (has_interface<PPB_ContentDecryptor_Private>()) { - get_interface<PPB_ContentDecryptor_Private>()->KeyError( - associated_instance_.pp_instance(), - reference_id, - media_error, - system_code); + get_interface<PPB_ContentDecryptor_Private>()->SessionReady( + associated_instance_.pp_instance(), session_id); } } -void ContentDecryptor_Private::SetSessionId(uint32_t reference_id, - const std::string& session_id) { +void ContentDecryptor_Private::SessionClosed(uint32_t session_id) { if (has_interface<PPB_ContentDecryptor_Private>()) { - pp::Var session_id_var(session_id); - get_interface<PPB_ContentDecryptor_Private>()->SetSessionId( + get_interface<PPB_ContentDecryptor_Private>()->SessionClosed( + associated_instance_.pp_instance(), session_id); + } +} + +void ContentDecryptor_Private::SessionError(uint32_t session_id, + int32_t media_error, + int32_t system_code) { + if (has_interface<PPB_ContentDecryptor_Private>()) { + get_interface<PPB_ContentDecryptor_Private>()->SessionError( associated_instance_.pp_instance(), - reference_id, - session_id_var.pp_var()); + session_id, + media_error, + system_code); } } diff --git a/ppapi/cpp/private/content_decryptor_private.h b/ppapi/cpp/private/content_decryptor_private.h index e8a93dc38e..d2c17c1869 100644 --- a/ppapi/cpp/private/content_decryptor_private.h +++ b/ppapi/cpp/private/content_decryptor_private.h @@ -32,13 +32,12 @@ class ContentDecryptor_Private { // strings. The change would allow the CDM wrapper to reuse vars when // replying to the browser. virtual void Initialize(const std::string& key_system) = 0; - virtual void GenerateKeyRequest(uint32_t reference_id, - const std::string& type, - pp::VarArrayBuffer init_data) = 0; - virtual void AddKey(uint32_t reference_id, - pp::VarArrayBuffer key, - pp::VarArrayBuffer init_data) = 0; - virtual void CancelKeyRequest(uint32_t reference_id) = 0; + virtual void CreateSession(uint32_t session_id, + const std::string& type, + pp::VarArrayBuffer init_data) = 0; + virtual void UpdateSession(uint32_t session_id, + pp::VarArrayBuffer response) = 0; + virtual void ReleaseSession(uint32_t session_id) = 0; virtual void Decrypt(pp::Buffer_Dev encrypted_buffer, const PP_EncryptedBlockInfo& encrypted_block_info) = 0; virtual void InitializeAudioDecoder( @@ -59,14 +58,15 @@ class ContentDecryptor_Private { // PPB_ContentDecryptor_Private methods for passing data from the decryptor // to the browser. - void KeyAdded(uint32_t reference_id); - void KeyMessage(uint32_t reference_id, - pp::VarArrayBuffer message, - const std::string& default_url); - void KeyError(uint32_t reference_id, - int32_t media_error, - int32_t system_code); - void SetSessionId(uint32_t reference_id, const std::string& session_id); + void SessionCreated(uint32_t session_id, const std::string& web_session_id); + void SessionMessage(uint32_t session_id, + pp::VarArrayBuffer message, + const std::string& default_url); + void SessionReady(uint32_t session_id); + void SessionClosed(uint32_t session_id); + void SessionError(uint32_t session_id, + int32_t media_error, + int32_t system_code); // The plugin must not hold a reference to the encrypted buffer resource // provided to Decrypt() when it calls this method. The browser will reuse diff --git a/ppapi/generators/idl_ast.py b/ppapi/generators/idl_ast.py index ce5dc38b39..74dce942a8 100644 --- a/ppapi/generators/idl_ast.py +++ b/ppapi/generators/idl_ast.py @@ -5,19 +5,10 @@ """Nodes for PPAPI IDL AST.""" from idl_namespace import IDLNamespace -from idl_node import IDLAttribute, IDLFile, IDLNode +from idl_node import IDLNode from idl_option import GetOption from idl_visitor import IDLVisitor -from idl_release import IDLReleaseList, IDLReleaseMap - -# -# IDL Predefined types -# -BuiltIn = set(['int8_t', 'int16_t', 'int32_t', 'int64_t', 'uint8_t', - 'uint16_t', 'uint32_t', 'uint64_t', 'double_t', 'float_t', - 'handle_t', 'interface_t', 'char', 'mem_t', 'mem_ptr_t', - 'str_t', 'void']) - +from idl_release import IDLReleaseMap # # IDLLabelResolver @@ -42,7 +33,7 @@ class IDLLabelResolver(IDLVisitor): # For File objects, set the minimum version if node.IsA('File'): - file_min, file_max = node.release_map.GetReleaseRange() + file_min, _ = node.release_map.GetReleaseRange() node.SetMin(file_min) return None @@ -69,7 +60,7 @@ class IDLNamespaceVersionResolver(IDLVisitor): # Set the min version on any non Label within the File if not node.IsA('AST', 'File', 'Label', 'LabelItem'): - my_min, my_max = node.GetMinMax() + my_min, _ = node.GetMinMax() if not my_min: node.SetMin(self.rmin) @@ -78,7 +69,7 @@ class IDLNamespaceVersionResolver(IDLVisitor): node.namespace = parent_namespace else: # otherwise create one. - node.namespace = IDLNamespace(parent_namespace, node.GetName()) + node.namespace = IDLNamespace(parent_namespace) # If this node is named, place it in its parent's namespace if parent_namespace and node.cls in IDLNode.NamedSet: @@ -118,13 +109,13 @@ class IDLFileTypeResolver(IDLVisitor): filenode = node if not node.IsA('AST'): - file_min, file_max = filenode.release_map.GetReleaseRange() + file_min, _ = filenode.release_map.GetReleaseRange() if not file_min: print 'Resetting min on %s to %s' % (node, file_min) node.SetMinRange(file_min) # If this node has a TYPEREF, resolve it to a version list - typeref = node.property_node.GetPropertyLocal('TYPEREF') + typeref = node.GetPropertyLocal('TYPEREF') if typeref: node.typelist = node.parent.namespace.FindList(typeref) if not node.typelist: @@ -164,7 +155,7 @@ class IDLAst(IDLNode): IDLLabelResolver().Visit(self, None) # Generate the Namesapce Tree - self.namespace = IDLNamespace(None, 'AST') + self.namespace = IDLNamespace(None) IDLNamespaceVersionResolver().Visit(self, self.namespace) # Using the namespace, resolve type references @@ -179,6 +170,8 @@ class IDLAst(IDLNode): IDLReleaseResolver().Visit(self, sorted(releases)) for filenode in self.GetListOf('File'): - self.errors += int(filenode.GetProperty('ERRORS', 0)) + errors = filenode.GetProperty('ERRORS') + if errors: + self.errors += errors diff --git a/ppapi/generators/idl_c_header.py b/ppapi/generators/idl_c_header.py index a3b868874d..d3a1b32a3e 100755 --- a/ppapi/generators/idl_c_header.py +++ b/ppapi/generators/idl_c_header.py @@ -145,12 +145,7 @@ def CheckTypedefs(filenode, releases): See http://crbug.com/233439 for details. """ cgen = CGen() - # TODO(teravest): Fix the following callback to pass PP_Var by pointer - # instead of by value. - node_whitelist = ['PP_Ext_Alarms_OnAlarm_Func_Dev_0_1'] for node in filenode.GetListOf('Typedef'): - if node.GetName() in node_whitelist: - continue build_list = node.GetUniqueReleases(releases) callnode = node.GetOneOf('Callspec') if callnode: @@ -162,7 +157,7 @@ def CheckTypedefs(filenode, releases): t = param.GetType(build_list[0]) while t.IsA('Typedef'): t = t.GetType(build_list[0]) - if t.IsA('Struct'): + if t.IsA('Struct') and t.GetProperty('passByValue'): raise Exception('%s is a struct in callback %s. ' 'See http://crbug.com/233439' % (t.GetName(), node.GetName())) diff --git a/ppapi/generators/idl_c_proto.py b/ppapi/generators/idl_c_proto.py index 7e49c02d50..34d5361a82 100755 --- a/ppapi/generators/idl_c_proto.py +++ b/ppapi/generators/idl_c_proto.py @@ -568,28 +568,22 @@ class CGen(object): if len(build_list) != 1: node.Error('Can not support multiple versions of node.') assert len(build_list) == 1 - + out = self.DefineStructInternals(node, build_list[-1], + include_version=False, comment=True) if node.IsA('Interface'): # Build the most recent one versioned, with comments out = self.DefineStructInternals(node, build_list[-1], include_version=True, comment=True) - # Define an unversioned typedef for the most recent version out += '\ntypedef struct %s %s;\n' % ( self.GetStructName(node, build_list[-1], include_version=True), self.GetStructName(node, build_list[-1], include_version=False)) - else: - # Build the most recent one versioned, with comments - out = self.DefineStructInternals(node, build_list[-1], - include_version=False, comment=True) - - - # Build the rest without comments and with the version number appended - for rel in build_list[0:-1]: - out += '\n' + self.DefineStructInternals(node, rel, - include_version=True, - comment=False) + # Build the rest without comments and with the version number appended + for rel in build_list[0:-1]: + out += '\n' + self.DefineStructInternals(node, rel, + include_version=True, + comment=False) self.LogExit('Exit DefineStruct') return out @@ -752,7 +746,7 @@ def main(args): print 'Skipping %s' % f.GetName() continue for node in f.GetChildren()[2:]: - print cgen.Define(node, comment=True, prefix='tst_') + print cgen.Define(node, ast.releases, comment=True, prefix='tst_') if __name__ == '__main__': diff --git a/ppapi/generators/idl_log.py b/ppapi/generators/idl_log.py index b7f2151a4d..f5b103e751 100644 --- a/ppapi/generators/idl_log.py +++ b/ppapi/generators/idl_log.py @@ -4,54 +4,49 @@ """ Error and information logging for IDL """ -# -# IDL Log -# -# And IDLLog object provides a mechanism for capturing logging output -# and/or sending out via a file handle (usually stdout or stderr). -# import sys class IDLLog(object): + """Captures and routes logging output. + + Caputres logging output and/or sends out via a file handle, typically + stdout or stderr. + """ def __init__(self, name, out): if name: - self.name = '%s : ' % name + self._name = '%s : ' % name else: - self.name = '' + self._name = '' - self.out = out - self.capture = False - self.console = True - self.log = [] + self._out = out + self._capture = False + self._console = True + self._log = [] def Log(self, msg): - line = "%s\n" % (msg) - if self.console: self.out.write(line) - if self.capture: - self.log.append(msg) - - def LogTag(self, msg): - line = "%s%s\n" % (self.name, msg) - if self.console: self.out.write(line) - if self.capture: - self.log.append(msg) + if self._console: + line = "%s\n" % (msg) + self._out.write(line) + if self._capture: + self._log.append(msg) def LogLine(self, filename, lineno, pos, msg): - line = "%s(%d) : %s%s\n" % (filename, lineno, self.name, msg) - if self.console: self.out.write(line) - if self.capture: self.log.append(msg) + if self._console: + line = "%s(%d) : %s%s\n" % (filename, lineno, self._name, msg) + self._out.write(line) + if self._capture: + self._log.append(msg) - def SetConsole(self, enable, out = None): - self.console = enable - if out: self.out = out + def SetConsole(self, enable): + self._console = enable def SetCapture(self, enable): - self.capture = enable + self._capture = enable def DrainLog(self): - out = self.log - self.log = [] + out = self._log + self._log = [] return out ErrOut = IDLLog('Error', sys.stderr) diff --git a/ppapi/generators/idl_namespace.py b/ppapi/generators/idl_namespace.py index 0d74b547ca..b81411e68d 100755 --- a/ppapi/generators/idl_namespace.py +++ b/ppapi/generators/idl_namespace.py @@ -28,10 +28,9 @@ Option('namespace_debug', 'Use the specified release') # one or more IDLNodes based on a release or range of releases. # class IDLNamespace(object): - def __init__(self, parent, name): + def __init__(self, parent): self._name_to_releases = {} self._parent = parent - self._name = name def Dump(self): for name in self._name_to_releases: @@ -73,7 +72,6 @@ class IDLNamespace(object): return verlist.AddNode(node) - # # Testing Code # diff --git a/ppapi/generators/idl_node.py b/ppapi/generators/idl_node.py index a6b1c88c4f..3c9470709c 100755 --- a/ppapi/generators/idl_node.py +++ b/ppapi/generators/idl_node.py @@ -16,12 +16,10 @@ # as the source data by the various generators. # -import hashlib import sys from idl_log import ErrOut, InfoOut, WarnOut from idl_propertynode import IDLPropertyNode -from idl_namespace import IDLNamespace from idl_release import IDLRelease, IDLReleaseMap @@ -53,7 +51,6 @@ class IDLNode(IDLRelease): NamedSet = set(['Enum', 'EnumItem', 'File', 'Function', 'Interface', 'Member', 'Param', 'Struct', 'Type', 'Typedef']) - show_versions = False def __init__(self, cls, filename, lineno, pos, children=None): # Initialize with no starting or ending Version IDLRelease.__init__(self, None, None) @@ -61,16 +58,14 @@ class IDLNode(IDLRelease): self.cls = cls self.lineno = lineno self.pos = pos - self.filename = filename - self.filenode = None - self.hashes = {} - self.deps = {} + self._filename = filename + self._deps = {} self.errors = 0 self.namespace = None self.typelist = None self.parent = None - self.property_node = IDLPropertyNode() - self.unique_releases = None + self._property_node = IDLPropertyNode() + self._unique_releases = None # A list of unique releases for this node self.releases = None @@ -78,66 +73,58 @@ class IDLNode(IDLRelease): # A map from any release, to the first unique release self.first_release = None - # self.children is a list of children ordered as defined - self.children = [] + # self._children is a list of children ordered as defined + self._children = [] # Process the passed in list of children, placing ExtAttributes into the # property dictionary, and nodes into the local child list in order. In # addition, add nodes to the namespace if the class is in the NamedSet. - if not children: children = [] - for child in children: - if child.cls == 'ExtAttribute': - self.SetProperty(child.name, child.value) - else: - self.AddChild(child) - -# -# String related functions -# -# + if children: + for child in children: + if child.cls == 'ExtAttribute': + self.SetProperty(child.name, child.value) + else: + self.AddChild(child) - # Return a string representation of this node def __str__(self): name = self.GetName() - ver = IDLRelease.__str__(self) - if name is None: name = '' - if not IDLNode.show_versions: ver = '' - return '%s(%s%s)' % (self.cls, name, ver) + if name is None: + name = '' + return '%s(%s)' % (self.cls, name) - # Return file and line number for where node was defined def Location(self): - return '%s(%d)' % (self.filename, self.lineno) + """Return a file and line number for where this node was defined.""" + return '%s(%d)' % (self._filename, self.lineno) - # Log an error for this object def Error(self, msg): + """Log an error for this object.""" self.errors += 1 - ErrOut.LogLine(self.filename, self.lineno, 0, ' %s %s' % + ErrOut.LogLine(self._filename, self.lineno, 0, ' %s %s' % (str(self), msg)) - if self.filenode: - errcnt = self.filenode.GetProperty('ERRORS', 0) - self.filenode.SetProperty('ERRORS', errcnt + 1) + filenode = self.GetProperty('FILE') + if filenode: + errcnt = filenode.GetProperty('ERRORS') + if not errcnt: + errcnt = 0 + filenode.SetProperty('ERRORS', errcnt + 1) - # Log a warning for this object def Warning(self, msg): - WarnOut.LogLine(self.filename, self.lineno, 0, ' %s %s' % + """Log a warning for this object.""" + WarnOut.LogLine(self._filename, self.lineno, 0, ' %s %s' % (str(self), msg)) def GetName(self): return self.GetProperty('NAME') - def GetNameVersion(self): - name = self.GetProperty('NAME', default='') - ver = IDLRelease.__str__(self) - return '%s%s' % (name, ver) - - # Dump this object and its children def Dump(self, depth=0, comments=False, out=sys.stdout): + """Dump this object and its children""" if self.cls in ['Comment', 'Copyright']: is_comment = True else: is_comment = False # Skip this node if it's a comment, and we are not printing comments - if not comments and is_comment: return + if not comments and is_comment: + return tab = ''.rjust(depth * 2) if is_comment: @@ -153,7 +140,7 @@ class IDLNode(IDLRelease): out.write('%s%s%s%s\n' % (tab, self, ver, release_list)) if self.typelist: out.write('%s Typelist: %s\n' % (tab, self.typelist.GetReleases()[0])) - properties = self.property_node.GetPropertyList() + properties = self._property_node.GetPropertyList() if properties: out.write('%s Properties\n' % tab) for p in properties: @@ -161,90 +148,45 @@ class IDLNode(IDLRelease): # Skip printing the name for comments, since we printed above already continue out.write('%s %s : %s\n' % (tab, p, self.GetProperty(p))) - for child in self.children: + for child in self._children: child.Dump(depth+1, comments=comments, out=out) -# -# Search related functions -# - # Check if node is of a given type def IsA(self, *typelist): - if self.cls in typelist: return True - return False + """Check if node is of a given type.""" + return self.cls in typelist - # Get a list of objects for this key def GetListOf(self, *keys): + """Get a list of objects for the given key(s).""" out = [] - for child in self.children: - if child.cls in keys: out.append(child) + for child in self._children: + if child.cls in keys: + out.append(child) return out def GetOneOf(self, *keys): + """Get an object for the given key(s).""" out = self.GetListOf(*keys) - if out: return out[0] + if out: + return out[0] return None def SetParent(self, parent): - self.property_node.AddParent(parent) + self._property_node.AddParent(parent) self.parent = parent def AddChild(self, node): node.SetParent(self) - self.children.append(node) + self._children.append(node) # Get a list of all children def GetChildren(self): - return self.children - - # Get a list of all children of a given version - def GetChildrenVersion(self, version): - out = [] - for child in self.children: - if child.IsVersion(version): out.append(child) - return out - - # Get a list of all children in a given range - def GetChildrenRange(self, vmin, vmax): - out = [] - for child in self.children: - if child.IsRange(vmin, vmax): out.append(child) - return out - - def FindVersion(self, name, version): - node = self.namespace.FindNode(name, version) - if not node and self.parent: - node = self.parent.FindVersion(name, version) - return node - - def FindRange(self, name, vmin, vmax): - nodes = self.namespace.FindNodes(name, vmin, vmax) - if not nodes and self.parent: - nodes = self.parent.FindVersion(name, vmin, vmax) - return nodes + return self._children def GetType(self, release): - if not self.typelist: return None + if not self.typelist: + return None return self.typelist.FindRelease(release) - def GetHash(self, release): - hashval = self.hashes.get(release, None) - if hashval is None: - hashval = hashlib.sha1() - hashval.update(self.cls) - for key in self.property_node.GetPropertyList(): - val = self.GetProperty(key) - hashval.update('%s=%s' % (key, str(val))) - typeref = self.GetType(release) - if typeref: - hashval.update(typeref.GetHash(release)) - for child in self.GetChildren(): - if child.IsA('Copyright', 'Comment', 'Label'): continue - if not child.IsRelease(release): - continue - hashval.update( child.GetHash(release) ) - self.hashes[release] = hashval - return hashval.hexdigest() - def GetDeps(self, release, visited=None): visited = visited or set() @@ -253,7 +195,7 @@ class IDLNode(IDLRelease): return set([]) # If we have cached the info for this release, return the cached value - deps = self.deps.get(release, None) + deps = self._deps.get(release, None) if deps is not None: return deps @@ -275,7 +217,7 @@ class IDLNode(IDLRelease): if typeref: deps |= typeref.GetDeps(release, visited) - self.deps[release] = deps + self._deps[release] = deps return deps def GetVersion(self, release): @@ -296,17 +238,18 @@ class IDLNode(IDLRelease): out = set() for rel in releases: remapped = self.first_release[rel] - if not remapped: continue + if not remapped: + continue out |= set([remapped]) # Cache the most recent set of unique_releases - self.unique_releases = sorted(out) - return self.unique_releases + self._unique_releases = sorted(out) + return self._unique_releases def LastRelease(self, release): # Get the most recent release from the most recently generated set of # cached unique releases. - if self.unique_releases and self.unique_releases[-1] > release: + if self._unique_releases and self._unique_releases[-1] > release: return False return True @@ -316,21 +259,6 @@ class IDLNode(IDLRelease): return None return filenode.release_map.GetRelease(version) - def _GetReleases(self, releases): - if not self.releases: - my_min, my_max = self.GetMinMax(releases) - my_releases = [my_min] - if my_max != releases[-1]: - my_releases.append(my_max) - my_releases = set(my_releases) - for child in self.GetChildren(): - if child.IsA('Copyright', 'Comment', 'Label'): - continue - my_releases |= child.GetReleases(releases) - self.releases = my_releases - return self.releases - - def _GetReleaseList(self, releases, visited=None): visited = visited or set() if not self.releases: @@ -364,7 +292,7 @@ class IDLNode(IDLRelease): # Exclude sibling results from parent visited set cur_visits = visited - for child in self.children: + for child in self._children: child_releases |= set(child._GetReleaseList(releases, cur_visits)) visited |= set(child_releases) @@ -379,7 +307,7 @@ class IDLNode(IDLRelease): if my_min < type_release_list[0]: type_node = type_list[0] self.Error('requires %s in %s which is undefined at %s.' % ( - type_node, type_node.filename, my_min)) + type_node, type_node._filename, my_min)) for rel in child_releases | type_releases: if rel >= my_min and rel <= my_max: @@ -388,12 +316,9 @@ class IDLNode(IDLRelease): self.releases = sorted(my_releases) return self.releases - def GetReleaseList(self): - return self.releases - def BuildReleaseMap(self, releases): unique_list = self._GetReleaseList(releases) - my_min, my_max = self.GetMinMax(releases) + _, my_max = self.GetMinMax(releases) self.first_release = {} last_rel = None @@ -405,16 +330,13 @@ class IDLNode(IDLRelease): last_rel = None def SetProperty(self, name, val): - self.property_node.SetProperty(name, val) - - def GetProperty(self, name, default=None): - return self.property_node.GetProperty(name, default) + self._property_node.SetProperty(name, val) - def Traverse(self, data, func): - func(self, data) - for child in self.children: - child.Traverse(data, func) + def GetProperty(self, name): + return self._property_node.GetProperty(name) + def GetPropertyLocal(self, name): + return self._property_node.GetPropertyLocal(name) # # IDLFile @@ -425,8 +347,11 @@ class IDLFile(IDLNode): def __init__(self, name, children, errors=0): attrs = [IDLAttribute('NAME', name), IDLAttribute('ERRORS', errors)] - if not children: children = [] + if not children: + children = [] IDLNode.__init__(self, 'File', name, 1, 0, attrs + children) + # TODO(teravest): Why do we set release map like this here? This looks + # suspicious... self.release_map = IDLReleaseMap([('M13', 1.0)]) @@ -448,7 +373,8 @@ def StringTest(): if str(node) != text_str: ErrOut.Log('str() returned >%s< not >%s<' % (str(node), text_str)) errors += 1 - if not errors: InfoOut.Log('Passed StringTest') + if not errors: + InfoOut.Log('Passed StringTest') return errors @@ -482,7 +408,8 @@ def ChildTest(): ErrOut.Log('Failed GetChildren2.') errors += 1 - if not errors: InfoOut.Log('Passed ChildTest') + if not errors: + InfoOut.Log('Passed ChildTest') return errors diff --git a/ppapi/generators/idl_parser.py b/ppapi/generators/idl_parser.py index 6f0ea12436..df330702a5 100755 --- a/ppapi/generators/idl_parser.py +++ b/ppapi/generators/idl_parser.py @@ -310,6 +310,14 @@ class IDLParser(IDLLexer): """dictionary_block : modifiers DICTIONARY SYMBOL '{' struct_list '}' ';'""" p[0] = self.BuildNamed('Dictionary', p, 3, ListFromConcat(p[1], p[5])) + def p_dictionary_errorA(self, p): + """dictionary_block : modifiers DICTIONARY error ';'""" + p[0] = [] + + def p_dictionary_errorB(self, p): + """dictionary_block : modifiers DICTIONARY error '{' struct_list '}' ';'""" + p[0] = [] + # # Callback # @@ -976,7 +984,7 @@ class IDLParser(IDLLexer): def FlattenTree(node): add_self = False out = [] - for child in node.children: + for child in node.GetChildren(): if child.IsA('Comment'): add_self = True else: diff --git a/ppapi/generators/idl_propertynode.py b/ppapi/generators/idl_propertynode.py index 33837a3cef..e15354ad0a 100755 --- a/ppapi/generators/idl_propertynode.py +++ b/ppapi/generators/idl_propertynode.py @@ -8,7 +8,6 @@ import re import sys from idl_log import ErrOut, InfoOut, WarnOut -from idl_option import GetOption, Option, ParseOptions # # IDLPropertyNode @@ -22,11 +21,6 @@ class IDLPropertyNode(object): self.parents = [] self.property_map = {} - def Error(self, msg): - name = self.GetProperty('NAME', 'Unknown') - parents = [parent.GetProperty('NAME', '???') for parent in self.parents] - ErrOut.Log('%s [%s] : %s' % (name, ' '.join(parents), msg)) - def AddParent(self, parent): assert parent self.parents.append(parent) @@ -34,56 +28,26 @@ class IDLPropertyNode(object): def SetProperty(self, name, val): self.property_map[name] = val - def _GetProperty_(self, name): + def GetProperty(self, name): # Check locally for the property, and return it if found. prop = self.property_map.get(name, None) - if prop is not None: return prop + if prop is not None: + return prop # If not, seach parents in order for parent in self.parents: prop = parent.GetProperty(name) - if prop is not None: return prop + if prop is not None: + return prop # Otherwise, it can not be found. return None - def GetProperty(self, name, default=None): - prop = self._GetProperty_(name) - if prop is None: - return default - else: - return prop - - def GetPropertyLocal(self, name, default=None): - # Search for the property, but only locally, returning the - # default if not found. - prop = self.property_map.get(name, default) - return prop - - # Regular expression to parse property keys in a string such that a string - # "My string $NAME$" will find the key "NAME". - regex_var = re.compile('(?P<src>[^\\$]+)|(?P<key>\\$\\w+\\$)') + def GetPropertyLocal(self, name): + # Search for the property, but only locally. + return self.property_map.get(name, None) def GetPropertyList(self): return self.property_map.keys() - # Recursively expands text keys in the form of $KEY$ with the value - # of the property of the same name. Since this is done recursively - # one property can be defined in terms of another. - def Replace(self, text): - itr = IDLPropertyNode.regex_var.finditer(text) - out = '' - for m in itr: - (start, stop) = m.span() - if m.lastgroup == 'src': - out += text[start:stop] - if m.lastgroup == 'key': - key = text[start+1:stop-1] - val = self.GetProperty(key, None) - if not val: - self.Error('No property "%s"' % key) - out += self.Replace(str(val)) - return out - - # # Testing functions # @@ -91,16 +55,18 @@ class IDLPropertyNode(object): # Build a property node, setting the properties including a name, and # associate the children with this new node. # -def BuildNode(name, props, children=[], parents=[]): +def BuildNode(name, props, children=None, parents=None): node = IDLPropertyNode() node.SetProperty('NAME', name) for prop in props: toks = prop.split('=') node.SetProperty(toks[0], toks[1]) - for child in children: - child.AddParent(node) - for parent in parents: - node.AddParent(parent) + if children: + for child in children: + child.AddParent(node) + if parents: + for parent in parents: + node.AddParent(parent) return node def ExpectProp(node, name, val): @@ -128,63 +94,14 @@ def PropertyTest(): errors += ExpectProp(right, 'Left', 'Top') errors += ExpectProp(right, 'Right', 'Right') - if not errors: InfoOut.Log('Passed PropertyTest') - return errors - - -def ExpectText(node, text, val): - found = node.Replace(text) - if found != val: - ErrOut.Log('Got replacement %s expecting %s' % (found, val)) - return 1 - return 0 - -# -# Verify text replacement -# -def ReplaceTest(): - errors = 0 - left = BuildNode('Left', ['Left=Left']) - right = BuildNode('Right', ['Right=Right']) - top = BuildNode('Top', ['Left=Top', 'Right=Top'], [left, right]) - - errors += ExpectText(top, '$Left$', 'Top') - errors += ExpectText(top, '$Right$', 'Top') - - errors += ExpectText(left, '$Left$', 'Left') - errors += ExpectText(left, '$Right$', 'Top') - - errors += ExpectText(right, '$Left$', 'Top') - errors += ExpectText(right, '$Right$', 'Right') - - if not errors: InfoOut.Log('Passed ReplaceTest') - return errors - - -def MultiParentTest(): - errors = 0 - - parent1 = BuildNode('parent1', ['PARENT1=parent1', 'TOPMOST=$TOP$']) - parent2 = BuildNode('parent2', ['PARENT1=parent2', 'PARENT2=parent2']) - child = BuildNode('child', ['CHILD=child'], parents=[parent1, parent2]) - BuildNode('top', ['TOP=top'], children=[parent1]) - - errors += ExpectText(child, '$CHILD$', 'child') - errors += ExpectText(child, '$PARENT1$', 'parent1') - errors += ExpectText(child, '$PARENT2$', 'parent2') - - # Verify recursive resolution - errors += ExpectText(child, '$TOPMOST$', 'top') - - if not errors: InfoOut.Log('Passed MultiParentTest') + if not errors: + InfoOut.Log('Passed PropertyTest') return errors def Main(): errors = 0 errors += PropertyTest() - errors += ReplaceTest() - errors += MultiParentTest() if errors: ErrOut.Log('IDLNode failed with %d errors.' % errors) diff --git a/ppapi/generators/idl_tests.py b/ppapi/generators/idl_tests.py index cfc9fe8bac..bf6d8a1570 100755 --- a/ppapi/generators/idl_tests.py +++ b/ppapi/generators/idl_tests.py @@ -30,6 +30,10 @@ def main(args): assert errors == 0 errors += TestIDL('idl_gen_pnacl.py', ['--wnone', '--test']) assert errors == 0 + errors += TestIDL('idl_namespace.py', []) + assert errors == 0 + errors += TestIDL('idl_node.py', []) + assert errors == 0 if errors: print '\nFailed tests.' diff --git a/ppapi/generators/test_lex.in b/ppapi/generators/test_lex.in deleted file mode 100644 index e0a000ad41..0000000000 --- a/ppapi/generators/test_lex.in +++ /dev/null @@ -1,65 +0,0 @@ -INT 1 INT 123 INT 12345 -SYMBOL A123 SYMBOL A_A - -COMMENT /*XXXX*/ -COMMENT //XXXX - -COMMENT /*MULTI LINE*/ - -[ [ -] ] -* * -. . -( ( -) ) -{ { -} } -[ [ -] ] -, , -; ; -: : -= = -+ + -- - -/ / -~ ~ -| | -& & -^ ^ -<< << ->> >> - -FLOAT 1.1 -FLOAT 1e1 -FLOAT -1.1 -FLOAT -1e1 -FLOAT 1e-1 -FLOAT -1e-1 -FLOAT 1.0e1 -FLOAT -1.0e-1 - -HEX 0x1 -HEX 0x0 -HEX 0x10 -HEX 0x112312 -HEX 0x1ABCD0 -HEX 0xA0B0C0 -HEX 0xabcdef -HEX 0x1ab2cd - -OCT 00 -OCT 01 -OCT 0123 - -INLINE #inline C -This is an inline block. - -Contains /* Comments */ -Contains // Comments -Contains /* Multi-line - Comment */ - -#endinl -SYMBOL blah - diff --git a/ppapi/generators/test_parser/dictionary.idl b/ppapi/generators/test_parser/dictionary.idl new file mode 100644 index 0000000000..1035cd1c35 --- /dev/null +++ b/ppapi/generators/test_parser/dictionary.idl @@ -0,0 +1,17 @@ +/* Copyright 2013 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. + */ + +dictionary MyDict { + /* OK Member(setString) */ + DOMString setString; + /* OK Member(unsetLong) */ + long unsetLong; +}; + +/* FAIL Unexpected "}" after symbol unsetLong. */ +dictionary MyDict { + DOMString setString; + long unsetLong +}; diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc index d67b991476..f892059ad7 100644 --- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc +++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc @@ -226,12 +226,8 @@ PnaclCoordinator* PnaclCoordinator::BitcodeToNative( pnacl_options, translate_notify_callback); coordinator->pnacl_init_time_ = NaClGetTimeOfDayMicroseconds(); - coordinator->off_the_record_ = - plugin->nacl_interface()->IsOffTheRecord(); - PLUGIN_PRINTF(("PnaclCoordinator::BitcodeToNative (manifest=%p, " - "off_the_record=%d)\n", - reinterpret_cast<const void*>(coordinator->manifest_.get()), - coordinator->off_the_record_)); + PLUGIN_PRINTF(("PnaclCoordinator::BitcodeToNative (manifest=%p, ", + reinterpret_cast<const void*>(coordinator->manifest_.get()))); // First start a network request for the pexe, to tickle the component // updater's On-Demand resource throttler, and to get Last-Modified/ETag @@ -255,7 +251,6 @@ PnaclCoordinator::PnaclCoordinator( pnacl_options_(pnacl_options), is_cache_hit_(PP_FALSE), error_already_reported_(false), - off_the_record_(false), pnacl_init_time_(0), pexe_size_(0), pexe_bytes_compiled_(0), diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h index 00d6beb196..e38cbc0786 100644 --- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h +++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h @@ -219,9 +219,6 @@ class PnaclCoordinator: public CallbackSource<FileStreamData> { // was already run/consumed. bool error_already_reported_; - // True if compilation is off_the_record. - bool off_the_record_; - // State for timing and size information for UMA stats. int64_t pnacl_init_time_; int64_t pexe_size_; // Count as we stream -- will converge to pexe size. diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c index 5edbe5c4a1..bb9b089c75 100644 --- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c +++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c @@ -7,6 +7,7 @@ #include "ppapi/generators/pnacl_shim.h" #include "ppapi/c/ppb.h" +#include "ppapi/c/dev/ppb_alarms_dev.h" #include "ppapi/c/dev/ppb_audio_input_dev.h" #include "ppapi/c/dev/ppb_buffer_dev.h" #include "ppapi/c/dev/ppb_crypto_dev.h" @@ -42,8 +43,6 @@ #include "ppapi/c/dev/ppp_video_decoder_dev.h" #include "ppapi/c/dev/ppp_widget_dev.h" #include "ppapi/c/dev/ppp_zoom_dev.h" -#include "ppapi/c/extensions/dev/ppb_ext_alarms_dev.h" -#include "ppapi/c/extensions/dev/ppb_ext_events_dev.h" #include "ppapi/c/extensions/dev/ppb_ext_socket_dev.h" #include "ppapi/c/ppb_audio.h" #include "ppapi/c/ppb_audio_config.h" @@ -175,6 +174,7 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VarArrayBuffer_1_0; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VarDictionary_1_0; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_WebSocket_1_0; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Messaging_1_0; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_2; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_3; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_4; @@ -195,7 +195,7 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoCapture_Dev_0_2; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoCapture_Dev_0_3; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoDecoder_Dev_0_16; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Selection_Dev_0_3; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_8; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_9; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Ext_CrxFileSystem_Private_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FileIO_Private_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_FileRefPrivate_0_1; @@ -233,10 +233,8 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UMA_Private_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoDestination_Private_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_VideoSource_Private_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_X509Certificate_Private_0_1; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_8; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_9; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Instance_Private_0_1; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Ext_Alarms_Dev_0_1; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Ext_Events_Dev_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Ext_Socket_Dev_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Ext_Socket_Dev_0_2; /* END Declarations for all Wrapper Infos. */ @@ -1623,6 +1621,40 @@ static void Pnacl_M14_PPP_Messaging_HandleMessage(PP_Instance instance, struct P /* Not generating wrapper methods for PPB_URLLoaderTrusted_0_3 */ +/* Begin wrapper methods for PPB_Alarms_Dev_0_1 */ + +static void Pnacl_M33_PPB_Alarms_Dev_Create(PP_Instance instance, struct PP_Var* name, const struct PP_Alarms_AlarmCreateInfo_Dev* alarm_info) { + const struct PPB_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1.real_iface; + iface->Create(instance, *name, alarm_info); +} + +static int32_t Pnacl_M33_PPB_Alarms_Dev_Get(PP_Instance instance, struct PP_Var* name, struct PP_Alarms_Alarm_Dev* alarm, struct PP_CompletionCallback* callback) { + const struct PPB_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1.real_iface; + return iface->Get(instance, *name, alarm, *callback); +} + +static int32_t Pnacl_M33_PPB_Alarms_Dev_GetAll(PP_Instance instance, struct PP_Alarms_Alarm_Array_Dev* alarms, struct PP_ArrayOutput* array_allocator, struct PP_CompletionCallback* callback) { + const struct PPB_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1.real_iface; + return iface->GetAll(instance, alarms, *array_allocator, *callback); +} + +static void Pnacl_M33_PPB_Alarms_Dev_Clear(PP_Instance instance, struct PP_Var* name) { + const struct PPB_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1.real_iface; + iface->Clear(instance, *name); +} + +static void Pnacl_M33_PPB_Alarms_Dev_ClearAll(PP_Instance instance) { + const struct PPB_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1.real_iface; + iface->ClearAll(instance); +} + +static uint32_t Pnacl_M33_PPB_Alarms_Dev_AddOnAlarmListener(PP_Instance instance, PP_Alarms_OnAlarm_Dev callback, void* user_data) { + const struct PPB_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1.real_iface; + return iface->AddOnAlarmListener(instance, callback, user_data); +} + +/* End wrapper methods for PPB_Alarms_Dev_0_1 */ + /* Begin wrapper methods for PPB_AudioInput_Dev_0_2 */ static PP_Resource Pnacl_M19_PPB_AudioInput_Dev_Create(PP_Instance instance) { @@ -2348,59 +2380,64 @@ static struct PP_Var Pnacl_M13_PPP_Selection_Dev_GetSelectedText(PP_Instance ins /* Not generating wrapper methods for PPP_Zoom_Dev_0_3 */ -/* Begin wrapper methods for PPB_ContentDecryptor_Private_0_8 */ +/* Begin wrapper methods for PPB_ContentDecryptor_Private_0_9 */ + +static void Pnacl_M33_PPB_ContentDecryptor_Private_SessionCreated(PP_Instance instance, uint32_t session_id, struct PP_Var* web_session_id) { + const struct PPB_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_9.real_iface; + iface->SessionCreated(instance, session_id, *web_session_id); +} -static void Pnacl_M32_PPB_ContentDecryptor_Private_KeyAdded(PP_Instance instance, uint32_t reference_id) { - const struct PPB_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_8.real_iface; - iface->KeyAdded(instance, reference_id); +static void Pnacl_M33_PPB_ContentDecryptor_Private_SessionMessage(PP_Instance instance, uint32_t session_id, struct PP_Var* message, struct PP_Var* destination_url) { + const struct PPB_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_9.real_iface; + iface->SessionMessage(instance, session_id, *message, *destination_url); } -static void Pnacl_M32_PPB_ContentDecryptor_Private_KeyMessage(PP_Instance instance, uint32_t reference_id, struct PP_Var* message, struct PP_Var* default_url) { - const struct PPB_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_8.real_iface; - iface->KeyMessage(instance, reference_id, *message, *default_url); +static void Pnacl_M33_PPB_ContentDecryptor_Private_SessionReady(PP_Instance instance, uint32_t session_id) { + const struct PPB_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_9.real_iface; + iface->SessionReady(instance, session_id); } -static void Pnacl_M32_PPB_ContentDecryptor_Private_KeyError(PP_Instance instance, uint32_t reference_id, int32_t media_error, int32_t system_code) { - const struct PPB_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_8.real_iface; - iface->KeyError(instance, reference_id, media_error, system_code); +static void Pnacl_M33_PPB_ContentDecryptor_Private_SessionClosed(PP_Instance instance, uint32_t session_id) { + const struct PPB_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_9.real_iface; + iface->SessionClosed(instance, session_id); } -static void Pnacl_M32_PPB_ContentDecryptor_Private_SetSessionId(PP_Instance instance, uint32_t reference_id, struct PP_Var* session_id) { - const struct PPB_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_8.real_iface; - iface->SetSessionId(instance, reference_id, *session_id); +static void Pnacl_M33_PPB_ContentDecryptor_Private_SessionError(PP_Instance instance, uint32_t session_id, int32_t media_error, int32_t system_code) { + const struct PPB_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_9.real_iface; + iface->SessionError(instance, session_id, media_error, system_code); } -static void Pnacl_M32_PPB_ContentDecryptor_Private_DeliverBlock(PP_Instance instance, PP_Resource decrypted_block, const struct PP_DecryptedBlockInfo* decrypted_block_info) { - const struct PPB_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_8.real_iface; +static void Pnacl_M33_PPB_ContentDecryptor_Private_DeliverBlock(PP_Instance instance, PP_Resource decrypted_block, const struct PP_DecryptedBlockInfo* decrypted_block_info) { + const struct PPB_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_9.real_iface; iface->DeliverBlock(instance, decrypted_block, decrypted_block_info); } -static void Pnacl_M32_PPB_ContentDecryptor_Private_DecoderInitializeDone(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id, PP_Bool success) { - const struct PPB_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_8.real_iface; +static void Pnacl_M33_PPB_ContentDecryptor_Private_DecoderInitializeDone(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id, PP_Bool success) { + const struct PPB_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_9.real_iface; iface->DecoderInitializeDone(instance, decoder_type, request_id, success); } -static void Pnacl_M32_PPB_ContentDecryptor_Private_DecoderDeinitializeDone(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { - const struct PPB_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_8.real_iface; +static void Pnacl_M33_PPB_ContentDecryptor_Private_DecoderDeinitializeDone(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { + const struct PPB_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_9.real_iface; iface->DecoderDeinitializeDone(instance, decoder_type, request_id); } -static void Pnacl_M32_PPB_ContentDecryptor_Private_DecoderResetDone(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { - const struct PPB_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_8.real_iface; +static void Pnacl_M33_PPB_ContentDecryptor_Private_DecoderResetDone(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { + const struct PPB_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_9.real_iface; iface->DecoderResetDone(instance, decoder_type, request_id); } -static void Pnacl_M32_PPB_ContentDecryptor_Private_DeliverFrame(PP_Instance instance, PP_Resource decrypted_frame, const struct PP_DecryptedFrameInfo* decrypted_frame_info) { - const struct PPB_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_8.real_iface; +static void Pnacl_M33_PPB_ContentDecryptor_Private_DeliverFrame(PP_Instance instance, PP_Resource decrypted_frame, const struct PP_DecryptedFrameInfo* decrypted_frame_info) { + const struct PPB_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_9.real_iface; iface->DeliverFrame(instance, decrypted_frame, decrypted_frame_info); } -static void Pnacl_M32_PPB_ContentDecryptor_Private_DeliverSamples(PP_Instance instance, PP_Resource audio_frames, const struct PP_DecryptedSampleInfo* decrypted_sample_info) { - const struct PPB_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_8.real_iface; +static void Pnacl_M33_PPB_ContentDecryptor_Private_DeliverSamples(PP_Instance instance, PP_Resource audio_frames, const struct PP_DecryptedSampleInfo* decrypted_sample_info) { + const struct PPB_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_9.real_iface; iface->DeliverSamples(instance, audio_frames, decrypted_sample_info); } -/* End wrapper methods for PPB_ContentDecryptor_Private_0_8 */ +/* End wrapper methods for PPB_ContentDecryptor_Private_0_9 */ /* Begin wrapper methods for PPB_Ext_CrxFileSystem_Private_0_1 */ @@ -2993,11 +3030,6 @@ static void Pnacl_M25_PPB_NaCl_Private_ReportTranslationFinished(PP_Instance ins iface->ReportTranslationFinished(instance, success); } -static PP_Bool Pnacl_M25_PPB_NaCl_Private_IsOffTheRecord(void) { - const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; - return iface->IsOffTheRecord(); -} - static PP_ExternalPluginResult Pnacl_M25_PPB_NaCl_Private_ReportNaClError(PP_Instance instance, PP_NaClError message_id) { const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; return iface->ReportNaClError(instance, message_id); @@ -3765,79 +3797,79 @@ static void Pnacl_M19_PPB_X509Certificate_Private_GetField(struct PP_Var* _struc /* End wrapper methods for PPB_X509Certificate_Private_0_1 */ -/* Begin wrapper methods for PPP_ContentDecryptor_Private_0_8 */ +/* Begin wrapper methods for PPP_ContentDecryptor_Private_0_9 */ -static void Pnacl_M32_PPP_ContentDecryptor_Private_Initialize(PP_Instance instance, struct PP_Var key_system) { - const struct PPP_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_8.real_iface; +static void Pnacl_M33_PPP_ContentDecryptor_Private_Initialize(PP_Instance instance, struct PP_Var key_system) { + const struct PPP_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_9.real_iface; void (*temp_fp)(PP_Instance instance, struct PP_Var* key_system) = ((void (*)(PP_Instance instance, struct PP_Var* key_system))iface->Initialize); temp_fp(instance, &key_system); } -static void Pnacl_M32_PPP_ContentDecryptor_Private_GenerateKeyRequest(PP_Instance instance, uint32_t reference_id, struct PP_Var type, struct PP_Var init_data) { - const struct PPP_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_8.real_iface; - void (*temp_fp)(PP_Instance instance, uint32_t reference_id, struct PP_Var* type, struct PP_Var* init_data) = - ((void (*)(PP_Instance instance, uint32_t reference_id, struct PP_Var* type, struct PP_Var* init_data))iface->GenerateKeyRequest); - temp_fp(instance, reference_id, &type, &init_data); +static void Pnacl_M33_PPP_ContentDecryptor_Private_CreateSession(PP_Instance instance, uint32_t session_id, struct PP_Var type, struct PP_Var init_data) { + const struct PPP_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_9.real_iface; + void (*temp_fp)(PP_Instance instance, uint32_t session_id, struct PP_Var* type, struct PP_Var* init_data) = + ((void (*)(PP_Instance instance, uint32_t session_id, struct PP_Var* type, struct PP_Var* init_data))iface->CreateSession); + temp_fp(instance, session_id, &type, &init_data); } -static void Pnacl_M32_PPP_ContentDecryptor_Private_AddKey(PP_Instance instance, uint32_t reference_id, struct PP_Var key, struct PP_Var init_data) { - const struct PPP_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_8.real_iface; - void (*temp_fp)(PP_Instance instance, uint32_t reference_id, struct PP_Var* key, struct PP_Var* init_data) = - ((void (*)(PP_Instance instance, uint32_t reference_id, struct PP_Var* key, struct PP_Var* init_data))iface->AddKey); - temp_fp(instance, reference_id, &key, &init_data); +static void Pnacl_M33_PPP_ContentDecryptor_Private_UpdateSession(PP_Instance instance, uint32_t session_id, struct PP_Var response) { + const struct PPP_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_9.real_iface; + void (*temp_fp)(PP_Instance instance, uint32_t session_id, struct PP_Var* response) = + ((void (*)(PP_Instance instance, uint32_t session_id, struct PP_Var* response))iface->UpdateSession); + temp_fp(instance, session_id, &response); } -static void Pnacl_M32_PPP_ContentDecryptor_Private_CancelKeyRequest(PP_Instance instance, uint32_t reference_id) { - const struct PPP_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_8.real_iface; - void (*temp_fp)(PP_Instance instance, uint32_t reference_id) = - ((void (*)(PP_Instance instance, uint32_t reference_id))iface->CancelKeyRequest); - temp_fp(instance, reference_id); +static void Pnacl_M33_PPP_ContentDecryptor_Private_ReleaseSession(PP_Instance instance, uint32_t session_id) { + const struct PPP_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_9.real_iface; + void (*temp_fp)(PP_Instance instance, uint32_t session_id) = + ((void (*)(PP_Instance instance, uint32_t session_id))iface->ReleaseSession); + temp_fp(instance, session_id); } -static void Pnacl_M32_PPP_ContentDecryptor_Private_Decrypt(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info) { - const struct PPP_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_8.real_iface; +static void Pnacl_M33_PPP_ContentDecryptor_Private_Decrypt(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info) { + const struct PPP_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_9.real_iface; void (*temp_fp)(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info) = ((void (*)(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info))iface->Decrypt); temp_fp(instance, encrypted_block, encrypted_block_info); } -static void Pnacl_M32_PPP_ContentDecryptor_Private_InitializeAudioDecoder(PP_Instance instance, const struct PP_AudioDecoderConfig* decoder_config, PP_Resource codec_extra_data) { - const struct PPP_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_8.real_iface; +static void Pnacl_M33_PPP_ContentDecryptor_Private_InitializeAudioDecoder(PP_Instance instance, const struct PP_AudioDecoderConfig* decoder_config, PP_Resource codec_extra_data) { + const struct PPP_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_9.real_iface; void (*temp_fp)(PP_Instance instance, const struct PP_AudioDecoderConfig* decoder_config, PP_Resource codec_extra_data) = ((void (*)(PP_Instance instance, const struct PP_AudioDecoderConfig* decoder_config, PP_Resource codec_extra_data))iface->InitializeAudioDecoder); temp_fp(instance, decoder_config, codec_extra_data); } -static void Pnacl_M32_PPP_ContentDecryptor_Private_InitializeVideoDecoder(PP_Instance instance, const struct PP_VideoDecoderConfig* decoder_config, PP_Resource codec_extra_data) { - const struct PPP_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_8.real_iface; +static void Pnacl_M33_PPP_ContentDecryptor_Private_InitializeVideoDecoder(PP_Instance instance, const struct PP_VideoDecoderConfig* decoder_config, PP_Resource codec_extra_data) { + const struct PPP_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_9.real_iface; void (*temp_fp)(PP_Instance instance, const struct PP_VideoDecoderConfig* decoder_config, PP_Resource codec_extra_data) = ((void (*)(PP_Instance instance, const struct PP_VideoDecoderConfig* decoder_config, PP_Resource codec_extra_data))iface->InitializeVideoDecoder); temp_fp(instance, decoder_config, codec_extra_data); } -static void Pnacl_M32_PPP_ContentDecryptor_Private_DeinitializeDecoder(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { - const struct PPP_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_8.real_iface; +static void Pnacl_M33_PPP_ContentDecryptor_Private_DeinitializeDecoder(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { + const struct PPP_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_9.real_iface; void (*temp_fp)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) = ((void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))iface->DeinitializeDecoder); temp_fp(instance, decoder_type, request_id); } -static void Pnacl_M32_PPP_ContentDecryptor_Private_ResetDecoder(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { - const struct PPP_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_8.real_iface; +static void Pnacl_M33_PPP_ContentDecryptor_Private_ResetDecoder(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { + const struct PPP_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_9.real_iface; void (*temp_fp)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) = ((void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))iface->ResetDecoder); temp_fp(instance, decoder_type, request_id); } -static void Pnacl_M32_PPP_ContentDecryptor_Private_DecryptAndDecode(PP_Instance instance, PP_DecryptorStreamType decoder_type, PP_Resource encrypted_buffer, const struct PP_EncryptedBlockInfo* encrypted_block_info) { - const struct PPP_ContentDecryptor_Private_0_8 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_8.real_iface; +static void Pnacl_M33_PPP_ContentDecryptor_Private_DecryptAndDecode(PP_Instance instance, PP_DecryptorStreamType decoder_type, PP_Resource encrypted_buffer, const struct PP_EncryptedBlockInfo* encrypted_block_info) { + const struct PPP_ContentDecryptor_Private_0_9 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_9.real_iface; void (*temp_fp)(PP_Instance instance, PP_DecryptorStreamType decoder_type, PP_Resource encrypted_buffer, const struct PP_EncryptedBlockInfo* encrypted_block_info) = ((void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, PP_Resource encrypted_buffer, const struct PP_EncryptedBlockInfo* encrypted_block_info))iface->DecryptAndDecode); temp_fp(instance, decoder_type, encrypted_buffer, encrypted_block_info); } -/* End wrapper methods for PPP_ContentDecryptor_Private_0_8 */ +/* End wrapper methods for PPP_ContentDecryptor_Private_0_9 */ /* Not generating wrapper methods for PPP_Flash_BrowserOperations_1_0 */ @@ -3858,49 +3890,6 @@ static struct PP_Var Pnacl_M18_PPP_Instance_Private_GetInstanceObject(PP_Instanc /* End wrapper methods for PPP_Instance_Private_0_1 */ -/* Begin wrapper methods for PPB_Ext_Alarms_Dev_0_1 */ - -static void Pnacl_M27_PPB_Ext_Alarms_Dev_Create(PP_Instance instance, struct PP_Var* name, PP_Ext_Alarms_AlarmCreateInfo_Dev alarm_info) { - const struct PPB_Ext_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Ext_Alarms_Dev_0_1.real_iface; - iface->Create(instance, *name, alarm_info); -} - -static int32_t Pnacl_M27_PPB_Ext_Alarms_Dev_Get(PP_Instance instance, struct PP_Var* name, PP_Ext_Alarms_Alarm_Dev* alarm, struct PP_CompletionCallback* callback) { - const struct PPB_Ext_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Ext_Alarms_Dev_0_1.real_iface; - return iface->Get(instance, *name, alarm, *callback); -} - -static int32_t Pnacl_M27_PPB_Ext_Alarms_Dev_GetAll(PP_Instance instance, PP_Ext_Alarms_Alarm_Dev_Array* alarms, struct PP_CompletionCallback* callback) { - const struct PPB_Ext_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Ext_Alarms_Dev_0_1.real_iface; - return iface->GetAll(instance, alarms, *callback); -} - -static void Pnacl_M27_PPB_Ext_Alarms_Dev_Clear(PP_Instance instance, struct PP_Var* name) { - const struct PPB_Ext_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Ext_Alarms_Dev_0_1.real_iface; - iface->Clear(instance, *name); -} - -static void Pnacl_M27_PPB_Ext_Alarms_Dev_ClearAll(PP_Instance instance) { - const struct PPB_Ext_Alarms_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Ext_Alarms_Dev_0_1.real_iface; - iface->ClearAll(instance); -} - -/* End wrapper methods for PPB_Ext_Alarms_Dev_0_1 */ - -/* Begin wrapper methods for PPB_Ext_Events_Dev_0_1 */ - -static uint32_t Pnacl_M27_PPB_Ext_Events_Dev_AddListener(PP_Instance instance, struct PP_Ext_EventListener* listener) { - const struct PPB_Ext_Events_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Ext_Events_Dev_0_1.real_iface; - return iface->AddListener(instance, *listener); -} - -static void Pnacl_M27_PPB_Ext_Events_Dev_RemoveListener(PP_Instance instance, uint32_t listener_id) { - const struct PPB_Ext_Events_Dev_0_1 *iface = Pnacl_WrapperInfo_PPB_Ext_Events_Dev_0_1.real_iface; - iface->RemoveListener(instance, listener_id); -} - -/* End wrapper methods for PPB_Ext_Events_Dev_0_1 */ - /* Begin wrapper methods for PPB_Ext_Socket_Dev_0_1 */ static int32_t Pnacl_M28_PPB_Ext_Socket_Dev_Create(PP_Instance instance, PP_Ext_Socket_SocketType_Dev type, PP_Ext_Socket_CreateOptions_Dev options, PP_Ext_Socket_CreateInfo_Dev* create_info, struct PP_CompletionCallback* callback) { @@ -4482,6 +4471,15 @@ struct PPP_Messaging_1_0 Pnacl_Wrappers_PPP_Messaging_1_0 = { /* Not generating wrapper interface for PPB_URLLoaderTrusted_0_3 */ +struct PPB_Alarms_Dev_0_1 Pnacl_Wrappers_PPB_Alarms_Dev_0_1 = { + .Create = (void (*)(PP_Instance instance, struct PP_Var name, const struct PP_Alarms_AlarmCreateInfo_Dev* alarm_info))&Pnacl_M33_PPB_Alarms_Dev_Create, + .Get = (int32_t (*)(PP_Instance instance, struct PP_Var name, struct PP_Alarms_Alarm_Dev* alarm, struct PP_CompletionCallback callback))&Pnacl_M33_PPB_Alarms_Dev_Get, + .GetAll = (int32_t (*)(PP_Instance instance, struct PP_Alarms_Alarm_Array_Dev* alarms, struct PP_ArrayOutput array_allocator, struct PP_CompletionCallback callback))&Pnacl_M33_PPB_Alarms_Dev_GetAll, + .Clear = (void (*)(PP_Instance instance, struct PP_Var name))&Pnacl_M33_PPB_Alarms_Dev_Clear, + .ClearAll = (void (*)(PP_Instance instance))&Pnacl_M33_PPB_Alarms_Dev_ClearAll, + .AddOnAlarmListener = (uint32_t (*)(PP_Instance instance, PP_Alarms_OnAlarm_Dev callback, void* user_data))&Pnacl_M33_PPB_Alarms_Dev_AddOnAlarmListener +}; + struct PPB_AudioInput_Dev_0_2 Pnacl_Wrappers_PPB_AudioInput_Dev_0_2 = { .Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M19_PPB_AudioInput_Dev_Create, .IsAudioInput = (PP_Bool (*)(PP_Resource resource))&Pnacl_M19_PPB_AudioInput_Dev_IsAudioInput, @@ -4715,17 +4713,18 @@ struct PPP_Selection_Dev_0_3 Pnacl_Wrappers_PPP_Selection_Dev_0_3 = { /* Not generating wrapper interface for PPP_Zoom_Dev_0_3 */ -struct PPB_ContentDecryptor_Private_0_8 Pnacl_Wrappers_PPB_ContentDecryptor_Private_0_8 = { - .KeyAdded = (void (*)(PP_Instance instance, uint32_t reference_id))&Pnacl_M32_PPB_ContentDecryptor_Private_KeyAdded, - .KeyMessage = (void (*)(PP_Instance instance, uint32_t reference_id, struct PP_Var message, struct PP_Var default_url))&Pnacl_M32_PPB_ContentDecryptor_Private_KeyMessage, - .KeyError = (void (*)(PP_Instance instance, uint32_t reference_id, int32_t media_error, int32_t system_code))&Pnacl_M32_PPB_ContentDecryptor_Private_KeyError, - .SetSessionId = (void (*)(PP_Instance instance, uint32_t reference_id, struct PP_Var session_id))&Pnacl_M32_PPB_ContentDecryptor_Private_SetSessionId, - .DeliverBlock = (void (*)(PP_Instance instance, PP_Resource decrypted_block, const struct PP_DecryptedBlockInfo* decrypted_block_info))&Pnacl_M32_PPB_ContentDecryptor_Private_DeliverBlock, - .DecoderInitializeDone = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id, PP_Bool success))&Pnacl_M32_PPB_ContentDecryptor_Private_DecoderInitializeDone, - .DecoderDeinitializeDone = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))&Pnacl_M32_PPB_ContentDecryptor_Private_DecoderDeinitializeDone, - .DecoderResetDone = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))&Pnacl_M32_PPB_ContentDecryptor_Private_DecoderResetDone, - .DeliverFrame = (void (*)(PP_Instance instance, PP_Resource decrypted_frame, const struct PP_DecryptedFrameInfo* decrypted_frame_info))&Pnacl_M32_PPB_ContentDecryptor_Private_DeliverFrame, - .DeliverSamples = (void (*)(PP_Instance instance, PP_Resource audio_frames, const struct PP_DecryptedSampleInfo* decrypted_sample_info))&Pnacl_M32_PPB_ContentDecryptor_Private_DeliverSamples +struct PPB_ContentDecryptor_Private_0_9 Pnacl_Wrappers_PPB_ContentDecryptor_Private_0_9 = { + .SessionCreated = (void (*)(PP_Instance instance, uint32_t session_id, struct PP_Var web_session_id))&Pnacl_M33_PPB_ContentDecryptor_Private_SessionCreated, + .SessionMessage = (void (*)(PP_Instance instance, uint32_t session_id, struct PP_Var message, struct PP_Var destination_url))&Pnacl_M33_PPB_ContentDecryptor_Private_SessionMessage, + .SessionReady = (void (*)(PP_Instance instance, uint32_t session_id))&Pnacl_M33_PPB_ContentDecryptor_Private_SessionReady, + .SessionClosed = (void (*)(PP_Instance instance, uint32_t session_id))&Pnacl_M33_PPB_ContentDecryptor_Private_SessionClosed, + .SessionError = (void (*)(PP_Instance instance, uint32_t session_id, int32_t media_error, int32_t system_code))&Pnacl_M33_PPB_ContentDecryptor_Private_SessionError, + .DeliverBlock = (void (*)(PP_Instance instance, PP_Resource decrypted_block, const struct PP_DecryptedBlockInfo* decrypted_block_info))&Pnacl_M33_PPB_ContentDecryptor_Private_DeliverBlock, + .DecoderInitializeDone = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id, PP_Bool success))&Pnacl_M33_PPB_ContentDecryptor_Private_DecoderInitializeDone, + .DecoderDeinitializeDone = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))&Pnacl_M33_PPB_ContentDecryptor_Private_DecoderDeinitializeDone, + .DecoderResetDone = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))&Pnacl_M33_PPB_ContentDecryptor_Private_DecoderResetDone, + .DeliverFrame = (void (*)(PP_Instance instance, PP_Resource decrypted_frame, const struct PP_DecryptedFrameInfo* decrypted_frame_info))&Pnacl_M33_PPB_ContentDecryptor_Private_DeliverFrame, + .DeliverSamples = (void (*)(PP_Instance instance, PP_Resource audio_frames, const struct PP_DecryptedSampleInfo* decrypted_sample_info))&Pnacl_M33_PPB_ContentDecryptor_Private_DeliverSamples }; struct PPB_Ext_CrxFileSystem_Private_0_1 Pnacl_Wrappers_PPB_Ext_CrxFileSystem_Private_0_1 = { @@ -4890,7 +4889,6 @@ struct PPB_NaCl_Private_1_0 Pnacl_Wrappers_PPB_NaCl_Private_1_0 = { .CreateTemporaryFile = (PP_FileHandle (*)(PP_Instance instance))&Pnacl_M25_PPB_NaCl_Private_CreateTemporaryFile, .GetNexeFd = (int32_t (*)(PP_Instance instance, const char* pexe_url, uint32_t abi_version, uint32_t opt_level, const char* last_modified, const char* etag, PP_Bool has_no_store_header, PP_Bool* is_hit, PP_FileHandle* nexe_handle, struct PP_CompletionCallback callback))&Pnacl_M25_PPB_NaCl_Private_GetNexeFd, .ReportTranslationFinished = (void (*)(PP_Instance instance, PP_Bool success))&Pnacl_M25_PPB_NaCl_Private_ReportTranslationFinished, - .IsOffTheRecord = (PP_Bool (*)(void))&Pnacl_M25_PPB_NaCl_Private_IsOffTheRecord, .ReportNaClError = (PP_ExternalPluginResult (*)(PP_Instance instance, PP_NaClError message_id))&Pnacl_M25_PPB_NaCl_Private_ReportNaClError, .OpenNaClExecutable = (PP_FileHandle (*)(PP_Instance instance, const char* file_url, uint64_t* file_token_lo, uint64_t* file_token_hi))&Pnacl_M25_PPB_NaCl_Private_OpenNaClExecutable, .DispatchEvent = (void (*)(PP_Instance instance, PP_NaClEventType event_type, struct PP_Var resource_url, PP_Bool length_is_computable, uint64_t loaded_bytes, uint64_t total_bytes))&Pnacl_M25_PPB_NaCl_Private_DispatchEvent, @@ -5090,17 +5088,17 @@ struct PPB_X509Certificate_Private_0_1 Pnacl_Wrappers_PPB_X509Certificate_Privat .GetField = (struct PP_Var (*)(PP_Resource resource, PP_X509Certificate_Private_Field field))&Pnacl_M19_PPB_X509Certificate_Private_GetField }; -struct PPP_ContentDecryptor_Private_0_8 Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_8 = { - .Initialize = &Pnacl_M32_PPP_ContentDecryptor_Private_Initialize, - .GenerateKeyRequest = &Pnacl_M32_PPP_ContentDecryptor_Private_GenerateKeyRequest, - .AddKey = &Pnacl_M32_PPP_ContentDecryptor_Private_AddKey, - .CancelKeyRequest = &Pnacl_M32_PPP_ContentDecryptor_Private_CancelKeyRequest, - .Decrypt = &Pnacl_M32_PPP_ContentDecryptor_Private_Decrypt, - .InitializeAudioDecoder = &Pnacl_M32_PPP_ContentDecryptor_Private_InitializeAudioDecoder, - .InitializeVideoDecoder = &Pnacl_M32_PPP_ContentDecryptor_Private_InitializeVideoDecoder, - .DeinitializeDecoder = &Pnacl_M32_PPP_ContentDecryptor_Private_DeinitializeDecoder, - .ResetDecoder = &Pnacl_M32_PPP_ContentDecryptor_Private_ResetDecoder, - .DecryptAndDecode = &Pnacl_M32_PPP_ContentDecryptor_Private_DecryptAndDecode +struct PPP_ContentDecryptor_Private_0_9 Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_9 = { + .Initialize = &Pnacl_M33_PPP_ContentDecryptor_Private_Initialize, + .CreateSession = &Pnacl_M33_PPP_ContentDecryptor_Private_CreateSession, + .UpdateSession = &Pnacl_M33_PPP_ContentDecryptor_Private_UpdateSession, + .ReleaseSession = &Pnacl_M33_PPP_ContentDecryptor_Private_ReleaseSession, + .Decrypt = &Pnacl_M33_PPP_ContentDecryptor_Private_Decrypt, + .InitializeAudioDecoder = &Pnacl_M33_PPP_ContentDecryptor_Private_InitializeAudioDecoder, + .InitializeVideoDecoder = &Pnacl_M33_PPP_ContentDecryptor_Private_InitializeVideoDecoder, + .DeinitializeDecoder = &Pnacl_M33_PPP_ContentDecryptor_Private_DeinitializeDecoder, + .ResetDecoder = &Pnacl_M33_PPP_ContentDecryptor_Private_ResetDecoder, + .DecryptAndDecode = &Pnacl_M33_PPP_ContentDecryptor_Private_DecryptAndDecode }; /* Not generating wrapper interface for PPP_Flash_BrowserOperations_1_0 */ @@ -5113,19 +5111,6 @@ struct PPP_Instance_Private_0_1 Pnacl_Wrappers_PPP_Instance_Private_0_1 = { .GetInstanceObject = &Pnacl_M18_PPP_Instance_Private_GetInstanceObject }; -struct PPB_Ext_Alarms_Dev_0_1 Pnacl_Wrappers_PPB_Ext_Alarms_Dev_0_1 = { - .Create = (void (*)(PP_Instance instance, struct PP_Var name, PP_Ext_Alarms_AlarmCreateInfo_Dev alarm_info))&Pnacl_M27_PPB_Ext_Alarms_Dev_Create, - .Get = (int32_t (*)(PP_Instance instance, struct PP_Var name, PP_Ext_Alarms_Alarm_Dev* alarm, struct PP_CompletionCallback callback))&Pnacl_M27_PPB_Ext_Alarms_Dev_Get, - .GetAll = (int32_t (*)(PP_Instance instance, PP_Ext_Alarms_Alarm_Dev_Array* alarms, struct PP_CompletionCallback callback))&Pnacl_M27_PPB_Ext_Alarms_Dev_GetAll, - .Clear = (void (*)(PP_Instance instance, struct PP_Var name))&Pnacl_M27_PPB_Ext_Alarms_Dev_Clear, - .ClearAll = (void (*)(PP_Instance instance))&Pnacl_M27_PPB_Ext_Alarms_Dev_ClearAll -}; - -struct PPB_Ext_Events_Dev_0_1 Pnacl_Wrappers_PPB_Ext_Events_Dev_0_1 = { - .AddListener = (uint32_t (*)(PP_Instance instance, struct PP_Ext_EventListener listener))&Pnacl_M27_PPB_Ext_Events_Dev_AddListener, - .RemoveListener = (void (*)(PP_Instance instance, uint32_t listener_id))&Pnacl_M27_PPB_Ext_Events_Dev_RemoveListener -}; - struct PPB_Ext_Socket_Dev_0_1 Pnacl_Wrappers_PPB_Ext_Socket_Dev_0_1 = { .Create = (int32_t (*)(PP_Instance instance, PP_Ext_Socket_SocketType_Dev type, PP_Ext_Socket_CreateOptions_Dev options, PP_Ext_Socket_CreateInfo_Dev* create_info, struct PP_CompletionCallback callback))&Pnacl_M28_PPB_Ext_Socket_Dev_Create, .Destroy = (void (*)(PP_Instance instance, struct PP_Var socket_id))&Pnacl_M28_PPB_Ext_Socket_Dev_Destroy, @@ -5395,6 +5380,12 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Messaging_1_0 = { .real_iface = NULL }; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1 = { + .iface_macro = PPB_ALARMS_DEV_INTERFACE_0_1, + .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_Alarms_Dev_0_1, + .real_iface = NULL +}; + static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_2 = { .iface_macro = PPB_AUDIO_INPUT_DEV_INTERFACE_0_2, .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_AudioInput_Dev_0_2, @@ -5515,9 +5506,9 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Selection_Dev_0_3 = { .real_iface = NULL }; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_8 = { - .iface_macro = PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_8, - .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_ContentDecryptor_Private_0_8, +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_9 = { + .iface_macro = PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_9, + .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_ContentDecryptor_Private_0_9, .real_iface = NULL }; @@ -5743,9 +5734,9 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_X509Certificate_Private_0 .real_iface = NULL }; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_8 = { - .iface_macro = PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_8, - .wrapped_iface = (void *) &Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_8, +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_9 = { + .iface_macro = PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_9, + .wrapped_iface = (void *) &Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_9, .real_iface = NULL }; @@ -5755,18 +5746,6 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Instance_Private_0_1 = { .real_iface = NULL }; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Ext_Alarms_Dev_0_1 = { - .iface_macro = PPB_EXT_ALARMS_DEV_INTERFACE_0_1, - .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_Ext_Alarms_Dev_0_1, - .real_iface = NULL -}; - -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Ext_Events_Dev_0_1 = { - .iface_macro = PPB_EXT_EVENTS_DEV_INTERFACE_0_1, - .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_Ext_Events_Dev_0_1, - .real_iface = NULL -}; - static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Ext_Socket_Dev_0_1 = { .iface_macro = PPB_EXT_SOCKET_DEV_INTERFACE_0_1, .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_Ext_Socket_Dev_0_1, @@ -5817,6 +5796,7 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = { &Pnacl_WrapperInfo_PPB_VarArrayBuffer_1_0, &Pnacl_WrapperInfo_PPB_VarDictionary_1_0, &Pnacl_WrapperInfo_PPB_WebSocket_1_0, + &Pnacl_WrapperInfo_PPB_Alarms_Dev_0_1, &Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_2, &Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_3, &Pnacl_WrapperInfo_PPB_AudioInput_Dev_0_4, @@ -5836,7 +5816,7 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = { &Pnacl_WrapperInfo_PPB_VideoCapture_Dev_0_2, &Pnacl_WrapperInfo_PPB_VideoCapture_Dev_0_3, &Pnacl_WrapperInfo_PPB_VideoDecoder_Dev_0_16, - &Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_8, + &Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_9, &Pnacl_WrapperInfo_PPB_Ext_CrxFileSystem_Private_0_1, &Pnacl_WrapperInfo_PPB_FileIO_Private_0_1, &Pnacl_WrapperInfo_PPB_FileRefPrivate_0_1, @@ -5874,8 +5854,6 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = { &Pnacl_WrapperInfo_PPB_VideoDestination_Private_0_1, &Pnacl_WrapperInfo_PPB_VideoSource_Private_0_1, &Pnacl_WrapperInfo_PPB_X509Certificate_Private_0_1, - &Pnacl_WrapperInfo_PPB_Ext_Alarms_Dev_0_1, - &Pnacl_WrapperInfo_PPB_Ext_Events_Dev_0_1, &Pnacl_WrapperInfo_PPB_Ext_Socket_Dev_0_1, &Pnacl_WrapperInfo_PPB_Ext_Socket_Dev_0_2, NULL @@ -5884,7 +5862,7 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = { static struct __PnaclWrapperInfo *s_ppp_wrappers[] = { &Pnacl_WrapperInfo_PPP_Messaging_1_0, &Pnacl_WrapperInfo_PPP_Selection_Dev_0_3, - &Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_8, + &Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_9, &Pnacl_WrapperInfo_PPP_Instance_Private_0_1, NULL }; diff --git a/ppapi/ppapi_shared.gypi b/ppapi/ppapi_shared.gypi index a4b8267d64..3cdec10e40 100644 --- a/ppapi/ppapi_shared.gypi +++ b/ppapi/ppapi_shared.gypi @@ -131,6 +131,7 @@ 'thunk/enter.cc', 'thunk/enter.h', 'thunk/extensions_common_api.h', + 'thunk/ppb_alarms_dev_thunk.cc', 'thunk/ppb_audio_api.h', 'thunk/ppb_audio_config_api.h', 'thunk/ppb_audio_config_thunk.cc', @@ -149,7 +150,6 @@ 'thunk/ppb_cursor_control_thunk.cc', 'thunk/ppb_device_ref_api.h', 'thunk/ppb_device_ref_dev_thunk.cc', - 'thunk/ppb_ext_alarms_thunk.cc', 'thunk/ppb_ext_crx_file_system_private_thunk.cc', 'thunk/ppb_ext_socket_thunk.cc', 'thunk/ppb_file_chooser_api.h', diff --git a/ppapi/ppapi_sources.gypi b/ppapi/ppapi_sources.gypi index abbedb8f6d..793cbfc246 100644 --- a/ppapi/ppapi_sources.gypi +++ b/ppapi/ppapi_sources.gypi @@ -69,7 +69,9 @@ # Dev interfaces. 'c/dev/pp_cursor_type_dev.h', + 'c/dev/pp_optional_structs_dev.h', 'c/dev/pp_video_dev.h', + 'c/dev/ppb_alarms_dev.h', 'c/dev/ppb_buffer_dev.h', 'c/dev/ppb_char_set_dev.h', 'c/dev/ppb_cursor_control_dev.h', @@ -143,8 +145,6 @@ 'c/trusted/ppp_broker.h', # Extensions dev interfaces. - 'c/extensions/dev/ppb_ext_alarms_dev.h', - 'c/extensions/dev/ppb_ext_events_dev.h', 'c/extensions/dev/ppb_ext_socket_dev.h', ], 'cpp_source_files': [ @@ -360,18 +360,12 @@ # Extensions interfaces. 'cpp/extensions/dict_field.h', - 'cpp/extensions/event_base.cc', - 'cpp/extensions/event_base.h', 'cpp/extensions/ext_output_traits.h', 'cpp/extensions/from_var_converter.h', 'cpp/extensions/optional.h', 'cpp/extensions/to_var_converter.h', # Extensions dev interfaces. - 'cpp/extensions/dev/alarms_dev.cc', - 'cpp/extensions/dev/alarms_dev.h', - 'cpp/extensions/dev/events_dev.cc', - 'cpp/extensions/dev/events_dev.h', 'cpp/extensions/dev/socket_dev.cc', 'cpp/extensions/dev/socket_dev.h', diff --git a/ppapi/proxy/connection.h b/ppapi/proxy/connection.h index 13cbbc6fcf..cc8255cd7a 100644 --- a/ppapi/proxy/connection.h +++ b/ppapi/proxy/connection.h @@ -40,7 +40,7 @@ struct Connection { bool in_process; // We need to use a routing ID when a plugin is in-process, and messages are // sent back from the browser to the renderer. This is so that messages are - // routed to the proper RenderViewImpl. + // routed to the proper RenderFrameImpl. int browser_sender_routing_id; }; diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc index f609855242..588d3545cd 100644 --- a/ppapi/proxy/interface_list.cc +++ b/ppapi/proxy/interface_list.cc @@ -6,6 +6,7 @@ #include "base/lazy_instance.h" #include "base/memory/singleton.h" +#include "ppapi/c/dev/ppb_alarms_dev.h" #include "ppapi/c/dev/ppb_audio_input_dev.h" #include "ppapi/c/dev/ppb_buffer_dev.h" #include "ppapi/c/dev/ppb_char_set_dev.h" @@ -29,7 +30,6 @@ #include "ppapi/c/dev/ppb_var_resource_dev.h" #include "ppapi/c/dev/ppb_video_capture_dev.h" #include "ppapi/c/dev/ppb_view_dev.h" -#include "ppapi/c/extensions/dev/ppb_ext_alarms_dev.h" #include "ppapi/c/extensions/dev/ppb_ext_socket_dev.h" #include "ppapi/c/ppb_audio_config.h" #include "ppapi/c/ppb_audio.h" @@ -248,8 +248,14 @@ InterfaceList::InterfaceList() { // PPB (browser) interfaces. // Do not add more stuff here, they should be added to interface_list*.h // TODO(brettw) remove these. - AddPPB(PPB_Instance_Proxy::GetInfoPrivate(), PERMISSION_PRIVATE); - AddPPB(PPB_Var_Deprecated_Proxy::GetInfo(), PERMISSION_DEV); + AddProxy(API_ID_PPB_INSTANCE_PRIVATE, &ProxyFactory<PPB_Instance_Proxy>); + AddPPB(PPB_INSTANCE_PRIVATE_INTERFACE_0_1, API_ID_PPB_INSTANCE_PRIVATE, + thunk::GetPPB_Instance_Private_0_1_Thunk(), + PERMISSION_PRIVATE); + + AddProxy(API_ID_PPB_VAR_DEPRECATED, &ProxyFactory<PPB_Var_Deprecated_Proxy>); + AddPPB(PPB_VAR_DEPRECATED_INTERFACE, API_ID_PPB_VAR_DEPRECATED, + PPB_Var_Deprecated_Proxy::GetProxyInterface(), PERMISSION_DEV); // TODO(tomfinegan): Figure out where to put these once we refactor things // to load the PPP interface struct from the PPB interface. @@ -259,7 +265,9 @@ InterfaceList::InterfaceList() { API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, PPP_ContentDecryptor_Private_Proxy::GetProxyInterface()); #endif - AddPPB(PPB_Testing_Proxy::GetInfo(), PERMISSION_TESTING); + AddProxy(API_ID_PPB_TESTING, &ProxyFactory<PPB_Testing_Proxy>); + AddPPB(PPB_TESTING_PRIVATE_INTERFACE, API_ID_PPB_TESTING, + PPB_Testing_Proxy::GetProxyInterface(), PERMISSION_TESTING); // PPP (plugin) interfaces. // TODO(brettw) move these to interface_list*.h @@ -377,11 +385,6 @@ void InterfaceList::AddPPP(const char* name, name_to_plugin_info_[name] = InterfaceInfo(id, iface, PERMISSION_NONE); } -void InterfaceList::AddPPB(const InterfaceProxy::Info* info, Permission perm) { - AddProxy(info->id, info->create_proxy); - AddPPB(info->name, info->id, info->interface_ptr, perm); -} - void InterfaceList::AddPPP(const InterfaceProxy::Info* info) { AddProxy(info->id, info->create_proxy); AddPPP(info->name, info->id, info->interface_ptr); diff --git a/ppapi/proxy/interface_list.h b/ppapi/proxy/interface_list.h index 9ef91dcc1f..bb9ccad315 100644 --- a/ppapi/proxy/interface_list.h +++ b/ppapi/proxy/interface_list.h @@ -85,7 +85,6 @@ class InterfaceList { // Old-style add functions. These should be removed when the rest of the // proxies are converted over to using the new system. - void AddPPB(const InterfaceProxy::Info* info, Permission perm); void AddPPP(const InterfaceProxy::Info* info); PpapiPermissions permissions_; diff --git a/ppapi/proxy/plugin_dispatcher.cc b/ppapi/proxy/plugin_dispatcher.cc index d6d0d90976..4dc3a45048 100644 --- a/ppapi/proxy/plugin_dispatcher.cc +++ b/ppapi/proxy/plugin_dispatcher.cc @@ -35,7 +35,6 @@ #include "ppapi/shared_impl/resource.h" #if defined(OS_POSIX) && !defined(OS_NACL) -#include "base/posix/eintr_wrapper.h" #include "ipc/ipc_channel_posix.h" #endif diff --git a/ppapi/proxy/plugin_resource.cc b/ppapi/proxy/plugin_resource.cc index c450f3c29a..3f4b61258b 100644 --- a/ppapi/proxy/plugin_resource.cc +++ b/ppapi/proxy/plugin_resource.cc @@ -115,7 +115,7 @@ bool PluginResource::SendResourceCall( const IPC::Message& nested_msg) { // For in-process plugins, we need to send the routing ID with the request. // The browser then uses that routing ID when sending the reply so it will be - // routed back to the correct RenderViewImpl. + // routed back to the correct RenderFrameImpl. if (dest == BROWSER && connection_.in_process) { return GetSender(dest)->Send(new PpapiHostMsg_InProcessResourceCall( connection_.browser_sender_routing_id, diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.cc b/ppapi/proxy/ppapi_command_buffer_proxy.cc index 063cafb336..a6da210795 100644 --- a/ppapi/proxy/ppapi_command_buffer_proxy.cc +++ b/ppapi/proxy/ppapi_command_buffer_proxy.cc @@ -139,6 +139,10 @@ void PpapiCommandBufferProxy::DestroyTransferBuffer(int32 id) { ppapi::API_ID_PPB_GRAPHICS_3D, resource_, id)); } +void PpapiCommandBufferProxy::Echo(const base::Closure& callback) { + NOTREACHED(); +} + gpu::Buffer PpapiCommandBufferProxy::GetTransferBuffer(int32 id) { if (last_state_.error != gpu::error::kNoError) return gpu::Buffer(); @@ -213,13 +217,19 @@ void PpapiCommandBufferProxy::SignalQuery(uint32 query, NOTREACHED(); } +void PpapiCommandBufferProxy::SetSurfaceVisible(bool visible) { + NOTREACHED(); +} + void PpapiCommandBufferProxy::SendManagedMemoryStats( const gpu::ManagedMemoryStats& stats) { NOTREACHED(); } -bool PpapiCommandBufferProxy::SupportsGpuMemoryBuffer() { - return false; +gpu::Capabilities PpapiCommandBufferProxy::GetCapabilities() { + // TODO(boliu): Need to implement this to use cc in Pepper. Tracked in + // crbug.com/325391. + return gpu::Capabilities(); } gfx::GpuMemoryBuffer* PpapiCommandBufferProxy::CreateGpuMemoryBuffer( diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.h b/ppapi/proxy/ppapi_command_buffer_proxy.h index bca5190421..16809bdfea 100644 --- a/ppapi/proxy/ppapi_command_buffer_proxy.h +++ b/ppapi/proxy/ppapi_command_buffer_proxy.h @@ -21,9 +21,8 @@ namespace proxy { class ProxyChannel; -class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy - : public gpu::CommandBuffer, - public gpu::GpuControl { +class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy : public gpu::CommandBuffer, + public gpu::GpuControl { public: PpapiCommandBufferProxy(const HostResource& resource, ProxyChannel* channel); @@ -47,7 +46,7 @@ class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy OVERRIDE; // gpu::GpuControl implementation: - virtual bool SupportsGpuMemoryBuffer() OVERRIDE; + virtual gpu::Capabilities GetCapabilities() OVERRIDE; virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( size_t width, size_t height, @@ -61,8 +60,10 @@ class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy const base::Closure& callback) OVERRIDE; virtual void SignalQuery(uint32 query, const base::Closure& callback) OVERRIDE; + virtual void SetSurfaceVisible(bool visible) OVERRIDE; virtual void SendManagedMemoryStats(const gpu::ManagedMemoryStats& stats) OVERRIDE; + virtual void Echo(const base::Closure& callback) OVERRIDE; private: bool Send(IPC::Message* msg); diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index 8118bddb75..6352e65c2d 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -648,19 +648,18 @@ IPC_MESSAGE_ROUTED3( IPC_MESSAGE_ROUTED2(PpapiMsg_PPPContentDecryptor_Initialize, PP_Instance /* instance */, ppapi::proxy::SerializedVar /* key_system, String */) -IPC_MESSAGE_ROUTED4(PpapiMsg_PPPContentDecryptor_GenerateKeyRequest, +IPC_MESSAGE_ROUTED4(PpapiMsg_PPPContentDecryptor_CreateSession, PP_Instance /* instance */, - uint32_t /* reference_id */, + uint32_t /* session_id */, ppapi::proxy::SerializedVar /* type, String */, ppapi::proxy::SerializedVar /* init_data, ArrayBuffer */) -IPC_MESSAGE_ROUTED4(PpapiMsg_PPPContentDecryptor_AddKey, +IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_UpdateSession, PP_Instance /* instance */, - uint32_t /* reference_id */, - ppapi::proxy::SerializedVar /* key, ArrayBuffer */, - ppapi::proxy::SerializedVar /* init_data, ArrayBuffer */) -IPC_MESSAGE_ROUTED2(PpapiMsg_PPPContentDecryptor_CancelKeyRequest, + uint32_t /* session_id */, + ppapi::proxy::SerializedVar /* response, ArrayBuffer */) +IPC_MESSAGE_ROUTED2(PpapiMsg_PPPContentDecryptor_ReleaseSession, PP_Instance /* instance */, - uint32_t /* reference_id */) + uint32_t /* session_id */) IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_Decrypt, PP_Instance /* instance */, ppapi::proxy::PPPDecryptor_Buffer /* buffer */, @@ -983,23 +982,26 @@ IPC_SYNC_MESSAGE_ROUTED2_2( ppapi::proxy::SerializedHandle /* result_shm_handle */) // PPB_ContentDecryptor_Dev messages handled in PPB_Instance_Proxy. -IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBInstance_KeyAdded, +IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_SessionCreated, PP_Instance /* instance */, - uint32_t /* reference_id */) -IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBInstance_KeyMessage, + uint32_t /* session_id */, + ppapi::proxy::SerializedVar /* web_session_id, String */) +IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBInstance_SessionMessage, PP_Instance /* instance */, - uint32_t /* reference_id */, + uint32_t /* session_id */, ppapi::proxy::SerializedVar /* message, ArrayBuffer */, - ppapi::proxy::SerializedVar /* default_url, String */) -IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBInstance_KeyError, + ppapi::proxy::SerializedVar /* destination_url, String */) +IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBInstance_SessionReady, + PP_Instance /* instance */, + uint32_t /* session_id */) +IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBInstance_SessionClosed, PP_Instance /* instance */, - uint32_t /* reference_id */, + uint32_t /* session_id */) +IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBInstance_SessionError, + PP_Instance /* instance */, + uint32_t /* session_id */, int32_t /* media_error */, int32_t /* system_code */) -IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_SetSessionId, - PP_Instance /* instance */, - uint32_t /* reference_id */, - ppapi::proxy::SerializedVar /* session_id, String */) IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_DeliverBlock, PP_Instance /* instance */, PP_Resource /* decrypted_block, PPB_Buffer_Dev */, diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc index 40cd4706d3..5d0e7ed3eb 100644 --- a/ppapi/proxy/ppb_instance_proxy.cc +++ b/ppapi/proxy/ppb_instance_proxy.cc @@ -175,14 +175,16 @@ bool PPB_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) { OnHostMsgGetPluginInstanceURL) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetPluginReferrerURL, OnHostMsgGetPluginReferrerURL) - IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyAdded, - OnHostMsgKeyAdded) - IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyMessage, - OnHostMsgKeyMessage) - IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyError, - OnHostMsgKeyError) - IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetSessionId, - OnHostMsgSetSessionId) + IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionCreated, + OnHostMsgSessionCreated) + IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionMessage, + OnHostMsgSessionMessage) + IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionReady, + OnHostMsgSessionReady) + IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionClosed, + OnHostMsgSessionClosed) + IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionError, + OnHostMsgSessionError) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverBlock, OnHostMsgDeliverBlock) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderInitializeDone, @@ -540,49 +542,46 @@ PP_Var PPB_Instance_Proxy::GetPluginReferrerURL( components); } -void PPB_Instance_Proxy::KeyAdded(PP_Instance instance, uint32_t reference_id) { - dispatcher()->Send( - new PpapiHostMsg_PPBInstance_KeyAdded( - API_ID_PPB_INSTANCE, - instance, - reference_id)); +void PPB_Instance_Proxy::SessionCreated(PP_Instance instance, + uint32_t session_id, + PP_Var web_session_id) { + dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionCreated( + API_ID_PPB_INSTANCE, + instance, + session_id, + SerializedVarSendInput(dispatcher(), web_session_id))); } -void PPB_Instance_Proxy::KeyMessage(PP_Instance instance, - uint32_t reference_id, - PP_Var message, - PP_Var default_url) { - dispatcher()->Send( - new PpapiHostMsg_PPBInstance_KeyMessage( - API_ID_PPB_INSTANCE, - instance, - reference_id, - SerializedVarSendInput(dispatcher(), message), - SerializedVarSendInput(dispatcher(), default_url))); +void PPB_Instance_Proxy::SessionMessage(PP_Instance instance, + uint32_t session_id, + PP_Var message, + PP_Var destination_url) { + dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionMessage( + API_ID_PPB_INSTANCE, + instance, + session_id, + SerializedVarSendInput(dispatcher(), message), + SerializedVarSendInput(dispatcher(), destination_url))); } -void PPB_Instance_Proxy::KeyError(PP_Instance instance, - uint32_t reference_id, - int32_t media_error, - int32_t system_code) { - dispatcher()->Send( - new PpapiHostMsg_PPBInstance_KeyError( - API_ID_PPB_INSTANCE, - instance, - reference_id, - media_error, - system_code)); +void PPB_Instance_Proxy::SessionReady(PP_Instance instance, + uint32_t session_id) { + dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionReady( + API_ID_PPB_INSTANCE, instance, session_id)); } -void PPB_Instance_Proxy::SetSessionId(PP_Instance instance, - uint32_t reference_id, - PP_Var session_id) { - dispatcher()->Send( - new PpapiHostMsg_PPBInstance_SetSessionId( - API_ID_PPB_INSTANCE, - instance, - reference_id, - SerializedVarSendInput(dispatcher(), session_id))); +void PPB_Instance_Proxy::SessionClosed(PP_Instance instance, + uint32_t session_id) { + dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionClosed( + API_ID_PPB_INSTANCE, instance, session_id)); +} + +void PPB_Instance_Proxy::SessionError(PP_Instance instance, + uint32_t session_id, + int32_t media_error, + int32_t system_code) { + dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionError( + API_ID_PPB_INSTANCE, instance, session_id, media_error, system_code)); } void PPB_Instance_Proxy::DeliverBlock(PP_Instance instance, @@ -1049,60 +1048,65 @@ void PPB_Instance_Proxy::OnHostMsgGetPluginReferrerURL( } } -void PPB_Instance_Proxy::OnHostMsgKeyAdded( +void PPB_Instance_Proxy::OnHostMsgSessionCreated( PP_Instance instance, - uint32_t reference_id) { + uint32_t session_id, + SerializedVarReceiveInput web_session_id) { if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) return; EnterInstanceNoLock enter(instance); if (enter.succeeded()) { - enter.functions()->KeyAdded(instance, reference_id); + enter.functions()->SessionCreated( + instance, session_id, web_session_id.Get(dispatcher())); } } -void PPB_Instance_Proxy::OnHostMsgKeyMessage( +void PPB_Instance_Proxy::OnHostMsgSessionMessage( PP_Instance instance, - uint32_t reference_id, + uint32_t session_id, SerializedVarReceiveInput message, - SerializedVarReceiveInput default_url) { + SerializedVarReceiveInput destination_url) { if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) return; EnterInstanceNoLock enter(instance); if (enter.succeeded()) { - enter.functions()->KeyMessage(instance, - reference_id, - message.Get(dispatcher()), - default_url.Get(dispatcher())); + enter.functions()->SessionMessage(instance, + session_id, + message.Get(dispatcher()), + destination_url.Get(dispatcher())); } } -void PPB_Instance_Proxy::OnHostMsgKeyError( - PP_Instance instance, - uint32_t reference_id, - int32_t media_error, - int32_t system_error) { +void PPB_Instance_Proxy::OnHostMsgSessionReady(PP_Instance instance, + uint32_t session_id) { if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) return; EnterInstanceNoLock enter(instance); if (enter.succeeded()) { - enter.functions()->KeyError(instance, - reference_id, - media_error, - system_error); + enter.functions()->SessionReady(instance, session_id); } } -void PPB_Instance_Proxy::OnHostMsgSetSessionId( - PP_Instance instance, - uint32_t reference_id, - SerializedVarReceiveInput session_id) { +void PPB_Instance_Proxy::OnHostMsgSessionClosed(PP_Instance instance, + uint32_t session_id) { + if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) + return; + EnterInstanceNoLock enter(instance); + if (enter.succeeded()) { + enter.functions()->SessionClosed(instance, session_id); + } +} + +void PPB_Instance_Proxy::OnHostMsgSessionError(PP_Instance instance, + uint32_t session_id, + int32_t media_error, + int32_t system_error) { if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) return; EnterInstanceNoLock enter(instance); if (enter.succeeded()) { - enter.functions()->SetSessionId(instance, - reference_id, - session_id.Get(dispatcher())); + enter.functions()->SessionError( + instance, session_id, media_error, system_error); } } diff --git a/ppapi/proxy/ppb_instance_proxy.h b/ppapi/proxy/ppb_instance_proxy.h index 4a892e54f4..12e56b938e 100644 --- a/ppapi/proxy/ppb_instance_proxy.h +++ b/ppapi/proxy/ppb_instance_proxy.h @@ -117,19 +117,20 @@ class PPB_Instance_Proxy : public InterfaceProxy, virtual PP_Var GetPluginReferrerURL( PP_Instance instance, PP_URLComponents_Dev* components) OVERRIDE; - virtual void KeyAdded(PP_Instance instance, - uint32_t reference_id) OVERRIDE; - virtual void KeyMessage(PP_Instance instance, - uint32_t reference_id, - PP_Var message, - PP_Var default_url) OVERRIDE; - virtual void KeyError(PP_Instance instance, - uint32_t reference_id, - int32_t media_error, - int32_t system_code) OVERRIDE; - virtual void SetSessionId(PP_Instance instance, - uint32_t reference_id, - PP_Var session_id) OVERRIDE; + virtual void SessionCreated(PP_Instance instance, + uint32_t session_id, + PP_Var web_session_id) OVERRIDE; + virtual void SessionMessage(PP_Instance instance, + uint32_t session_id, + PP_Var message, + PP_Var destination_url) OVERRIDE; + virtual void SessionReady(PP_Instance instance, uint32_t session_id) OVERRIDE; + virtual void SessionClosed(PP_Instance instance, + uint32_t session_id) OVERRIDE; + virtual void SessionError(PP_Instance instance, + uint32_t session_id, + int32_t media_error, + int32_t system_code) OVERRIDE; virtual void DeliverBlock(PP_Instance instance, PP_Resource decrypted_block, const PP_DecryptedBlockInfo* block_info) OVERRIDE; @@ -220,19 +221,22 @@ class PPB_Instance_Proxy : public InterfaceProxy, SerializedVarReturnValue result); void OnHostMsgGetPluginReferrerURL(PP_Instance instance, SerializedVarReturnValue result); - virtual void OnHostMsgKeyAdded(PP_Instance instance, - uint32_t reference_id); - virtual void OnHostMsgKeyMessage(PP_Instance instance, - uint32_t reference_id, - SerializedVarReceiveInput message, - SerializedVarReceiveInput default_url); - virtual void OnHostMsgKeyError(PP_Instance instance, - uint32_t reference_id, - int32_t media_error, - int32_t system_code); - virtual void OnHostMsgSetSessionId(PP_Instance instance, - uint32_t reference_id, - SerializedVarReceiveInput session_id); + virtual void OnHostMsgSessionCreated( + PP_Instance instance, + uint32_t session_id, + SerializedVarReceiveInput web_session_id); + virtual void OnHostMsgSessionMessage( + PP_Instance instance, + uint32_t session_id, + SerializedVarReceiveInput message, + SerializedVarReceiveInput destination_url); + virtual void OnHostMsgSessionReady(PP_Instance instance, uint32_t session_id); + virtual void OnHostMsgSessionClosed(PP_Instance instance, + uint32_t session_id); + virtual void OnHostMsgSessionError(PP_Instance instance, + uint32_t session_id, + int32_t media_error, + int32_t system_code); virtual void OnHostMsgDecoderInitializeDone( PP_Instance instance, PP_DecryptorStreamType decoder_type, diff --git a/ppapi/proxy/ppb_testing_proxy.cc b/ppapi/proxy/ppb_testing_proxy.cc index e4602e8d66..0b29795f12 100644 --- a/ppapi/proxy/ppb_testing_proxy.cc +++ b/ppapi/proxy/ppb_testing_proxy.cc @@ -139,10 +139,6 @@ const PPB_Testing_Private testing_interface = { &SetMinimumArrayBufferSizeForShmem }; -InterfaceProxy* CreateTestingProxy(Dispatcher* dispatcher) { - return new PPB_Testing_Proxy(dispatcher); -} - } // namespace PPB_Testing_Proxy::PPB_Testing_Proxy(Dispatcher* dispatcher) @@ -158,15 +154,8 @@ PPB_Testing_Proxy::~PPB_Testing_Proxy() { } // static -const InterfaceProxy::Info* PPB_Testing_Proxy::GetInfo() { - static const Info info = { - &testing_interface, - PPB_TESTING_PRIVATE_INTERFACE, - API_ID_PPB_TESTING, - false, - &CreateTestingProxy, - }; - return &info; +const PPB_Testing_Private* PPB_Testing_Proxy::GetProxyInterface() { + return &testing_interface; } bool PPB_Testing_Proxy::OnMessageReceived(const IPC::Message& msg) { diff --git a/ppapi/proxy/ppb_testing_proxy.h b/ppapi/proxy/ppb_testing_proxy.h index bee539a020..bcdb53b4d7 100644 --- a/ppapi/proxy/ppb_testing_proxy.h +++ b/ppapi/proxy/ppb_testing_proxy.h @@ -25,7 +25,7 @@ class PPB_Testing_Proxy : public InterfaceProxy { PPB_Testing_Proxy(Dispatcher* dispatcher); virtual ~PPB_Testing_Proxy(); - static const Info* GetInfo(); + static const PPB_Testing_Private* GetProxyInterface(); // InterfaceProxy implementation. virtual bool OnMessageReceived(const IPC::Message& msg); diff --git a/ppapi/proxy/ppb_var_deprecated_proxy.cc b/ppapi/proxy/ppb_var_deprecated_proxy.cc index 212a839a4e..c29e15281b 100644 --- a/ppapi/proxy/ppb_var_deprecated_proxy.cc +++ b/ppapi/proxy/ppb_var_deprecated_proxy.cc @@ -276,10 +276,6 @@ PP_Var CreateObject(PP_Instance instance, return ret_var; } -InterfaceProxy* CreateVarDeprecatedProxy(Dispatcher* dispatcher) { - return new PPB_Var_Deprecated_Proxy(dispatcher ); -} - } // namespace PPB_Var_Deprecated_Proxy::PPB_Var_Deprecated_Proxy( @@ -297,7 +293,7 @@ PPB_Var_Deprecated_Proxy::~PPB_Var_Deprecated_Proxy() { } // static -const InterfaceProxy::Info* PPB_Var_Deprecated_Proxy::GetInfo() { +const PPB_Var_Deprecated* PPB_Var_Deprecated_Proxy::GetProxyInterface() { static const PPB_Var_Deprecated var_deprecated_interface = { ppapi::PPB_Var_Shared::GetVarInterface1_0()->AddRef, ppapi::PPB_Var_Shared::GetVarInterface1_0()->Release, @@ -314,15 +310,7 @@ const InterfaceProxy::Info* PPB_Var_Deprecated_Proxy::GetInfo() { &IsInstanceOf, &CreateObject }; - - static const Info info = { - &var_deprecated_interface, - PPB_VAR_DEPRECATED_INTERFACE, - API_ID_PPB_VAR_DEPRECATED, - false, - &CreateVarDeprecatedProxy, - }; - return &info; + return &var_deprecated_interface; } bool PPB_Var_Deprecated_Proxy::OnMessageReceived(const IPC::Message& msg) { diff --git a/ppapi/proxy/ppb_var_deprecated_proxy.h b/ppapi/proxy/ppb_var_deprecated_proxy.h index 195c29afe3..db62fc2af1 100644 --- a/ppapi/proxy/ppb_var_deprecated_proxy.h +++ b/ppapi/proxy/ppb_var_deprecated_proxy.h @@ -28,7 +28,7 @@ class PPB_Var_Deprecated_Proxy : public InterfaceProxy { explicit PPB_Var_Deprecated_Proxy(Dispatcher* dispatcher); virtual ~PPB_Var_Deprecated_Proxy(); - static const Info* GetInfo(); + static const PPB_Var_Deprecated* GetProxyInterface(); // InterfaceProxy implementation. virtual bool OnMessageReceived(const IPC::Message& msg); diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc index 12ee04e9fe..167e4764d3 100644 --- a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc +++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc @@ -124,56 +124,47 @@ void Initialize(PP_Instance instance, SerializedVarSendInput(dispatcher, key_system))); } -void GenerateKeyRequest(PP_Instance instance, - uint32_t reference_id, - PP_Var type, - PP_Var init_data) { +void CreateSession(PP_Instance instance, + uint32_t session_id, + PP_Var type, + PP_Var init_data) { HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); if (!dispatcher) { NOTREACHED(); return; } - dispatcher->Send( - new PpapiMsg_PPPContentDecryptor_GenerateKeyRequest( - API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, - instance, - reference_id, - SerializedVarSendInput(dispatcher, type), - SerializedVarSendInput(dispatcher, init_data))); + dispatcher->Send(new PpapiMsg_PPPContentDecryptor_CreateSession( + API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, + instance, + session_id, + SerializedVarSendInput(dispatcher, type), + SerializedVarSendInput(dispatcher, init_data))); } -void AddKey(PP_Instance instance, - uint32_t reference_id, - PP_Var key, - PP_Var init_data) { +void UpdateSession(PP_Instance instance, uint32_t session_id, PP_Var response) { HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); if (!dispatcher) { NOTREACHED(); return; } - dispatcher->Send( - new PpapiMsg_PPPContentDecryptor_AddKey( - API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, - instance, - reference_id, - SerializedVarSendInput(dispatcher, key), - SerializedVarSendInput(dispatcher, init_data))); + dispatcher->Send(new PpapiMsg_PPPContentDecryptor_UpdateSession( + API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, + instance, + session_id, + SerializedVarSendInput(dispatcher, response))); } -void CancelKeyRequest(PP_Instance instance, uint32_t reference_id) { +void ReleaseSession(PP_Instance instance, uint32_t session_id) { HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); if (!dispatcher) { NOTREACHED(); return; } - dispatcher->Send( - new PpapiMsg_PPPContentDecryptor_CancelKeyRequest( - API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, - instance, - reference_id)); + dispatcher->Send(new PpapiMsg_PPPContentDecryptor_ReleaseSession( + API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, instance, session_id)); } void Decrypt(PP_Instance instance, @@ -365,9 +356,9 @@ void DecryptAndDecode(PP_Instance instance, static const PPP_ContentDecryptor_Private content_decryptor_interface = { &Initialize, - &GenerateKeyRequest, - &AddKey, - &CancelKeyRequest, + &CreateSession, + &UpdateSession, + &ReleaseSession, &Decrypt, &InitializeAudioDecoder, &InitializeVideoDecoder, @@ -408,12 +399,12 @@ bool PPP_ContentDecryptor_Private_Proxy::OnMessageReceived( IPC_BEGIN_MESSAGE_MAP(PPP_ContentDecryptor_Private_Proxy, msg) IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_Initialize, OnMsgInitialize) - IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_GenerateKeyRequest, - OnMsgGenerateKeyRequest) - IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_AddKey, - OnMsgAddKey) - IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_CancelKeyRequest, - OnMsgCancelKeyRequest) + IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_CreateSession, + OnMsgCreateSession) + IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_UpdateSession, + OnMsgUpdateSession) + IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_ReleaseSession, + OnMsgReleaseSession) IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_Decrypt, OnMsgDecrypt) IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_InitializeAudioDecoder, @@ -443,41 +434,39 @@ void PPP_ContentDecryptor_Private_Proxy::OnMsgInitialize( } } -void PPP_ContentDecryptor_Private_Proxy::OnMsgGenerateKeyRequest( +void PPP_ContentDecryptor_Private_Proxy::OnMsgCreateSession( PP_Instance instance, - uint32_t reference_id, + uint32_t session_id, SerializedVarReceiveInput type, SerializedVarReceiveInput init_data) { if (ppp_decryptor_impl_) { - CallWhileUnlocked(ppp_decryptor_impl_->GenerateKeyRequest, + CallWhileUnlocked(ppp_decryptor_impl_->CreateSession, instance, - reference_id, + session_id, ExtractReceivedVarAndAddRef(dispatcher(), &type), ExtractReceivedVarAndAddRef(dispatcher(), &init_data)); } } -void PPP_ContentDecryptor_Private_Proxy::OnMsgAddKey( +void PPP_ContentDecryptor_Private_Proxy::OnMsgUpdateSession( PP_Instance instance, - uint32_t reference_id, - SerializedVarReceiveInput key, - SerializedVarReceiveInput init_data) { + uint32_t session_id, + SerializedVarReceiveInput response) { if (ppp_decryptor_impl_) { - CallWhileUnlocked(ppp_decryptor_impl_->AddKey, + CallWhileUnlocked(ppp_decryptor_impl_->UpdateSession, instance, - reference_id, - ExtractReceivedVarAndAddRef(dispatcher(), &key), - ExtractReceivedVarAndAddRef(dispatcher(), &init_data)); + session_id, + ExtractReceivedVarAndAddRef(dispatcher(), &response)); } } -void PPP_ContentDecryptor_Private_Proxy::OnMsgCancelKeyRequest( +void PPP_ContentDecryptor_Private_Proxy::OnMsgReleaseSession( PP_Instance instance, - uint32_t reference_id) { + uint32_t session_id) { if (ppp_decryptor_impl_) { - CallWhileUnlocked(ppp_decryptor_impl_->CancelKeyRequest, + CallWhileUnlocked(ppp_decryptor_impl_->ReleaseSession, instance, - reference_id); + session_id); } } diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.h b/ppapi/proxy/ppp_content_decryptor_private_proxy.h index b4472f537f..dfbcf4f5d4 100644 --- a/ppapi/proxy/ppp_content_decryptor_private_proxy.h +++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.h @@ -32,16 +32,14 @@ class PPP_ContentDecryptor_Private_Proxy : public InterfaceProxy { // Message handlers. void OnMsgInitialize(PP_Instance instance, SerializedVarReceiveInput key_system); - void OnMsgGenerateKeyRequest(PP_Instance instance, - uint32_t reference_id, - SerializedVarReceiveInput type, - SerializedVarReceiveInput init_data); - void OnMsgAddKey(PP_Instance instance, - uint32_t reference_id, - SerializedVarReceiveInput key, - SerializedVarReceiveInput init_data); - void OnMsgCancelKeyRequest(PP_Instance instance, - uint32_t reference_id); + void OnMsgCreateSession(PP_Instance instance, + uint32_t session_id, + SerializedVarReceiveInput type, + SerializedVarReceiveInput init_data); + void OnMsgUpdateSession(PP_Instance instance, + uint32_t session_id, + SerializedVarReceiveInput response); + void OnMsgReleaseSession(PP_Instance instance, uint32_t session_id); void OnMsgDecrypt(PP_Instance instance, const PPPDecryptor_Buffer& encrypted_buffer, const std::string& serialized_encrypted_block_info); diff --git a/ppapi/shared_impl/api_id.h b/ppapi/shared_impl/api_id.h index c482a029a3..104a078a07 100644 --- a/ppapi/shared_impl/api_id.h +++ b/ppapi/shared_impl/api_id.h @@ -31,7 +31,6 @@ enum ApiID { API_ID_PPB_FONT, API_ID_PPB_GRAPHICS_2D, API_ID_PPB_GRAPHICS_3D, - API_ID_PPB_HOSTRESOLVER_PRIVATE, API_ID_PPB_IMAGE_DATA, API_ID_PPB_INSTANCE, API_ID_PPB_INSTANCE_PRIVATE, diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.cc b/ppapi/shared_impl/ppb_graphics_3d_shared.cc index 0f39663d6e..be8ee76431 100644 --- a/ppapi/shared_impl/ppb_graphics_3d_shared.cc +++ b/ppapi/shared_impl/ppb_graphics_3d_shared.cc @@ -118,12 +118,16 @@ bool PPB_Graphics3D_Shared::CreateGLES2Impl( const int32 kMaxTransferBufferSize = 16 * 1024 * 1024; transfer_buffer_.reset(new gpu::TransferBuffer(gles2_helper_.get())); + const bool bind_creates_resources = true; + const bool free_everything_when_invisible = false; + // Create the object exposing the OpenGL API. gles2_impl_.reset(new gpu::gles2::GLES2Implementation( gles2_helper_.get(), share_gles2 ? share_gles2->share_group() : NULL, transfer_buffer_.get(), - true, + bind_creates_resources, + free_everything_when_invisible, GetGpuControl())); if (!gles2_impl_->Initialize( diff --git a/ppapi/tests/all_c_includes.h b/ppapi/tests/all_c_includes.h index e89f4d1308..52a42fb145 100644 --- a/ppapi/tests/all_c_includes.h +++ b/ppapi/tests/all_c_includes.h @@ -10,7 +10,9 @@ #include "ppapi/c/dev/deprecated_bool.h" #include "ppapi/c/dev/pp_cursor_type_dev.h" +#include "ppapi/c/dev/pp_optional_structs_dev.h" #include "ppapi/c/dev/pp_video_dev.h" +#include "ppapi/c/dev/ppb_alarms_dev.h" #include "ppapi/c/dev/ppb_buffer_dev.h" #include "ppapi/c/dev/ppb_char_set_dev.h" #include "ppapi/c/dev/ppb_crypto_dev.h" @@ -43,8 +45,6 @@ #include "ppapi/c/dev/ppp_video_decoder_dev.h" #include "ppapi/c/dev/ppp_widget_dev.h" #include "ppapi/c/dev/ppp_zoom_dev.h" -#include "ppapi/c/extensions/dev/ppb_ext_alarms_dev.h" -#include "ppapi/c/extensions/dev/ppb_ext_events_dev.h" #include "ppapi/c/extensions/dev/ppb_ext_socket_dev.h" #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_completion_callback.h" diff --git a/ppapi/tests/all_cpp_includes.h b/ppapi/tests/all_cpp_includes.h index 3e57c29dc7..a72e29e8a2 100644 --- a/ppapi/tests/all_cpp_includes.h +++ b/ppapi/tests/all_cpp_includes.h @@ -33,7 +33,6 @@ #include "ppapi/cpp/dev/widget_dev.h" #include "ppapi/cpp/dev/zoom_dev.h" #include "ppapi/cpp/directory_entry.h" -#include "ppapi/cpp/extensions/dev/alarms_dev.h" #include "ppapi/cpp/extensions/dev/socket_dev.h" #include "ppapi/cpp/file_io.h" #include "ppapi/cpp/file_ref.h" diff --git a/ppapi/tests/test_broker.cc b/ppapi/tests/test_broker.cc index 0537b953a2..db2fa3ffbb 100644 --- a/ppapi/tests/test_broker.cc +++ b/ppapi/tests/test_broker.cc @@ -58,13 +58,26 @@ PlatformFile IntToPlatformFile(int32_t handle) { } #if defined(OS_POSIX) + #define HANDLE_EINTR(x) ({ \ - typeof(x) __eintr_result__; \ + typeof(x) eintr_wrapper_result; \ do { \ - __eintr_result__ = x; \ - } while (__eintr_result__ == -1 && errno == EINTR); \ - __eintr_result__;\ + eintr_wrapper_result = (x); \ + } while (eintr_wrapper_result == -1 && errno == EINTR); \ + eintr_wrapper_result; \ }) + +#define IGNORE_EINTR(x) ({ \ + typeof(x) eintr_wrapper_result; \ + do { \ + eintr_wrapper_result = (x); \ + if (eintr_wrapper_result == -1 && errno == EINTR) { \ + eintr_wrapper_result = 0; \ + } \ + } while (0); \ + eintr_wrapper_result; \ +}) + #endif bool ReadMessage(PlatformFile file, size_t message_len, char* message) { @@ -121,7 +134,7 @@ bool ClosePlatformFile(PlatformFile file) { #if defined(OS_WIN) return !!::CloseHandle(file); #elif defined(OS_POSIX) - return !HANDLE_EINTR(::close(file)); + return !IGNORE_EINTR(::close(file)); #endif } @@ -147,7 +160,7 @@ bool VerifyIsUnsandboxed() { if (-1 == fd) return false; - if (HANDLE_EINTR(::close(fd))) { + if (IGNORE_EINTR(::close(fd))) { ::remove(file_name); return false; } diff --git a/ppapi/thunk/interfaces_ppb_private.h b/ppapi/thunk/interfaces_ppb_private.h index 900254543b..11d5e52670 100644 --- a/ppapi/thunk/interfaces_ppb_private.h +++ b/ppapi/thunk/interfaces_ppb_private.h @@ -25,8 +25,8 @@ PROXIED_IFACE(PPB_Broker, PPB_BROKER_TRUSTED_INTERFACE_0_3, PROXIED_IFACE(PPB_Instance, PPB_BROWSERFONT_TRUSTED_INTERFACE_1_0, PPB_BrowserFont_Trusted_1_0) PROXIED_IFACE(PPB_Instance, - PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_8, - PPB_ContentDecryptor_Private_0_8) + PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_9, + PPB_ContentDecryptor_Private_0_9) PROXIED_IFACE(PPB_Instance, PPB_CHARSET_TRUSTED_INTERFACE_1_0, PPB_CharSet_Trusted_1_0) PROXIED_IFACE(NoAPIName, PPB_FILECHOOSER_TRUSTED_INTERFACE_0_5, diff --git a/ppapi/thunk/interfaces_ppb_public_dev.h b/ppapi/thunk/interfaces_ppb_public_dev.h index 1ad85bcac3..2c894e409d 100644 --- a/ppapi/thunk/interfaces_ppb_public_dev.h +++ b/ppapi/thunk/interfaces_ppb_public_dev.h @@ -10,10 +10,9 @@ // Map the old dev console interface to the stable one (which is the same) to // keep Flash, etc. working. PROXIED_IFACE(PPB_Instance, "PPB_Console(Dev);0.1", PPB_Console_1_0) +PROXIED_IFACE(NoAPIName, PPB_ALARMS_DEV_INTERFACE_0_1, PPB_Alarms_Dev_0_1) PROXIED_IFACE(NoAPIName, PPB_CURSOR_CONTROL_DEV_INTERFACE_0_4, PPB_CursorControl_Dev_0_4) -PROXIED_IFACE(NoAPIName, PPB_EXT_ALARMS_DEV_INTERFACE_0_1, - PPB_Ext_Alarms_Dev_0_1) PROXIED_IFACE(NoAPIName, PPB_EXT_SOCKET_DEV_INTERFACE_0_1, PPB_Ext_Socket_Dev_0_1) PROXIED_IFACE(NoAPIName, PPB_EXT_SOCKET_DEV_INTERFACE_0_2, diff --git a/ppapi/thunk/ppb_alarms_dev_thunk.cc b/ppapi/thunk/ppb_alarms_dev_thunk.cc new file mode 100644 index 0000000000..2d2ae14b89 --- /dev/null +++ b/ppapi/thunk/ppb_alarms_dev_thunk.cc @@ -0,0 +1,82 @@ +// Copyright 2013 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. + +#include "base/logging.h" +#include "ppapi/c/dev/ppb_alarms_dev.h" +#include "ppapi/shared_impl/tracked_callback.h" +#include "ppapi/thunk/enter.h" +#include "ppapi/thunk/extensions_common_api.h" +#include "ppapi/thunk/thunk.h" + +namespace ppapi { +namespace thunk { + +namespace { + +// TODO(yzshen): crbug.com/327197 Implement the thunk. + +void Create(PP_Instance instance, + PP_Var name, + const PP_Alarms_AlarmCreateInfo_Dev* alarm_info) { + NOTIMPLEMENTED(); +} + +int32_t Get(PP_Instance instance, + PP_Var name, + PP_Alarms_Alarm_Dev* alarm, + PP_CompletionCallback callback) { + EnterInstanceAPI<ExtensionsCommon_API> enter(instance, callback); + if (enter.failed()) + return enter.retval(); + + NOTIMPLEMENTED(); + + return enter.SetResult(PP_ERROR_FAILED); +} + +int32_t GetAll(PP_Instance instance, + PP_Alarms_Alarm_Array_Dev* alarms, + PP_ArrayOutput array_allocator, + PP_CompletionCallback callback) { + EnterInstanceAPI<ExtensionsCommon_API> enter(instance, callback); + if (enter.failed()) + return enter.retval(); + + NOTIMPLEMENTED(); + + return enter.SetResult(PP_ERROR_FAILED); +} + +void Clear(PP_Instance instance, PP_Var name) { + NOTIMPLEMENTED(); +} + +void ClearAll(PP_Instance instance) { + NOTIMPLEMENTED(); +} + +uint32_t AddOnAlarmListener(PP_Instance instance, + PP_Alarms_OnAlarm_Dev callback, + void* user_data) { + NOTIMPLEMENTED(); + return 0; +} + +const PPB_Alarms_Dev_0_1 g_ppb_alarms_dev_0_1_thunk = { + &Create, + &Get, + &GetAll, + &Clear, + &ClearAll, + &AddOnAlarmListener +}; + +} // namespace + +const PPB_Alarms_Dev_0_1* GetPPB_Alarms_Dev_0_1_Thunk() { + return &g_ppb_alarms_dev_0_1_thunk; +} + +} // namespace thunk +} // namespace ppapi diff --git a/ppapi/thunk/ppb_content_decryptor_private_thunk.cc b/ppapi/thunk/ppb_content_decryptor_private_thunk.cc index 201d526dd2..e434f4f722 100644 --- a/ppapi/thunk/ppb_content_decryptor_private_thunk.cc +++ b/ppapi/thunk/ppb_content_decryptor_private_thunk.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. // From private/ppb_content_decryptor_private.idl, -// modified Thu Oct 17 15:03:48 2013. +// modified Fri Dec 6 12:16:22 2013. #include "ppapi/c/pp_errors.h" #include "ppapi/c/private/ppb_content_decryptor_private.h" @@ -18,44 +18,58 @@ namespace thunk { namespace { -void KeyAdded(PP_Instance instance, uint32_t reference_id) { - VLOG(4) << "PPB_ContentDecryptor_Private::KeyAdded()"; +void SessionCreated(PP_Instance instance, + uint32_t session_id, + struct PP_Var web_session_id) { + VLOG(4) << "PPB_ContentDecryptor_Private::SessionCreated()"; EnterInstance enter(instance); if (enter.failed()) return; - enter.functions()->KeyAdded(instance, reference_id); + enter.functions()->SessionCreated(instance, session_id, web_session_id); } -void KeyMessage(PP_Instance instance, - uint32_t reference_id, - struct PP_Var message, - struct PP_Var default_url) { - VLOG(4) << "PPB_ContentDecryptor_Private::KeyMessage()"; +void SessionMessage(PP_Instance instance, + uint32_t session_id, + struct PP_Var message, + struct PP_Var destination_url) { + VLOG(4) << "PPB_ContentDecryptor_Private::SessionMessage()"; EnterInstance enter(instance); if (enter.failed()) return; - enter.functions()->KeyMessage(instance, reference_id, message, default_url); + enter.functions()->SessionMessage(instance, + session_id, + message, + destination_url); } -void KeyError(PP_Instance instance, - uint32_t reference_id, - int32_t media_error, - int32_t system_code) { - VLOG(4) << "PPB_ContentDecryptor_Private::KeyError()"; +void SessionReady(PP_Instance instance, uint32_t session_id) { + VLOG(4) << "PPB_ContentDecryptor_Private::SessionReady()"; EnterInstance enter(instance); if (enter.failed()) return; - enter.functions()->KeyError(instance, reference_id, media_error, system_code); + enter.functions()->SessionReady(instance, session_id); } -void SetSessionId(PP_Instance instance, - uint32_t reference_id, - struct PP_Var session_id) { - VLOG(4) << "PPB_ContentDecryptor_Private::SetSessionId()"; +void SessionClosed(PP_Instance instance, uint32_t session_id) { + VLOG(4) << "PPB_ContentDecryptor_Private::SessionClosed()"; EnterInstance enter(instance); if (enter.failed()) return; - enter.functions()->SetSessionId(instance, reference_id, session_id); + enter.functions()->SessionClosed(instance, session_id); +} + +void SessionError(PP_Instance instance, + uint32_t session_id, + int32_t media_error, + int32_t system_code) { + VLOG(4) << "PPB_ContentDecryptor_Private::SessionError()"; + EnterInstance enter(instance); + if (enter.failed()) + return; + enter.functions()->SessionError(instance, + session_id, + media_error, + system_code); } void DeliverBlock(PP_Instance instance, @@ -131,12 +145,13 @@ void DeliverSamples( decrypted_sample_info); } -const PPB_ContentDecryptor_Private_0_8 - g_ppb_contentdecryptor_private_thunk_0_8 = { - &KeyAdded, - &KeyMessage, - &KeyError, - &SetSessionId, +const PPB_ContentDecryptor_Private_0_9 + g_ppb_contentdecryptor_private_thunk_0_9 = { + &SessionCreated, + &SessionMessage, + &SessionReady, + &SessionClosed, + &SessionError, &DeliverBlock, &DecoderInitializeDone, &DecoderDeinitializeDone, @@ -147,9 +162,9 @@ const PPB_ContentDecryptor_Private_0_8 } // namespace -const PPB_ContentDecryptor_Private_0_8* - GetPPB_ContentDecryptor_Private_0_8_Thunk() { - return &g_ppb_contentdecryptor_private_thunk_0_8; +const PPB_ContentDecryptor_Private_0_9* + GetPPB_ContentDecryptor_Private_0_9_Thunk() { + return &g_ppb_contentdecryptor_private_thunk_0_9; } } // namespace thunk diff --git a/ppapi/thunk/ppb_ext_alarms_thunk.cc b/ppapi/thunk/ppb_ext_alarms_thunk.cc deleted file mode 100644 index 2fc88d08f5..0000000000 --- a/ppapi/thunk/ppb_ext_alarms_thunk.cc +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) 2013 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. - -#include <vector> - -#include "ppapi/c/extensions/dev/ppb_ext_alarms_dev.h" -#include "ppapi/shared_impl/tracked_callback.h" -#include "ppapi/thunk/enter.h" -#include "ppapi/thunk/extensions_common_api.h" -#include "ppapi/thunk/thunk.h" - -namespace ppapi { -namespace thunk { - -namespace { - -void Create(PP_Instance instance, - PP_Var name, - PP_Ext_Alarms_AlarmCreateInfo_Dev alarm_info) { - EnterInstanceAPI<ExtensionsCommon_API> enter(instance); - if (enter.failed()) - return; - - std::vector<PP_Var> args; - args.push_back(name); - args.push_back(alarm_info); - enter.functions()->PostRenderer("alarms.create", args); -} - -int32_t Get(PP_Instance instance, - PP_Var name, - PP_Ext_Alarms_Alarm_Dev* alarm, - PP_CompletionCallback callback) { - EnterInstanceAPI<ExtensionsCommon_API> enter(instance, callback); - if (enter.failed()) - return enter.retval(); - - std::vector<PP_Var> input_args; - std::vector<PP_Var*> output_args; - input_args.push_back(name); - output_args.push_back(alarm); - return enter.SetResult(enter.functions()->CallRenderer( - "alarms.get", input_args, output_args, enter.callback())); -} - -int32_t GetAll(PP_Instance instance, - PP_Ext_Alarms_Alarm_Dev_Array* alarms, - PP_CompletionCallback callback) { - EnterInstanceAPI<ExtensionsCommon_API> enter(instance, callback); - if (enter.failed()) - return enter.retval(); - - std::vector<PP_Var> input_args; - std::vector<PP_Var*> output_args; - output_args.push_back(alarms); - return enter.SetResult(enter.functions()->CallRenderer( - "alarms.getAll", input_args, output_args, enter.callback())); -} - -void Clear(PP_Instance instance, PP_Var name) { - EnterInstanceAPI<ExtensionsCommon_API> enter(instance); - if (enter.failed()) - return; - - std::vector<PP_Var> args; - args.push_back(name); - enter.functions()->PostRenderer("alarms.clear", args); -} - -void ClearAll(PP_Instance instance) { - EnterInstanceAPI<ExtensionsCommon_API> enter(instance); - if (enter.failed()) - return; - - std::vector<PP_Var> args; - enter.functions()->PostRenderer("alarms.clearAll", args); -} - -const PPB_Ext_Alarms_Dev_0_1 g_ppb_ext_alarms_dev_0_1_thunk = { - &Create, - &Get, - &GetAll, - &Clear, - &ClearAll -}; - -} // namespace - -const PPB_Ext_Alarms_Dev_0_1* GetPPB_Ext_Alarms_Dev_0_1_Thunk() { - return &g_ppb_ext_alarms_dev_0_1_thunk; -} - -} // namespace thunk -} // namespace ppapi diff --git a/ppapi/thunk/ppb_instance_api.h b/ppapi/thunk/ppb_instance_api.h index 60e4f073d1..bac3f97292 100644 --- a/ppapi/thunk/ppb_instance_api.h +++ b/ppapi/thunk/ppb_instance_api.h @@ -142,19 +142,19 @@ class PPB_Instance_API { PP_URLComponents_Dev* components) = 0; #if !defined(OS_NACL) // Content Decryptor. - virtual void KeyAdded(PP_Instance instance, - uint32 reference_id) = 0; - virtual void KeyMessage(PP_Instance instance, - uint32 reference_id, - PP_Var message, - PP_Var default_url) = 0; - virtual void KeyError(PP_Instance instance, - uint32 reference_id, - int32_t media_error, - int32_t system_error) = 0; - virtual void SetSessionId(PP_Instance instance, - uint32 reference_id, - PP_Var session_id) = 0; + virtual void SessionCreated(PP_Instance instance, + uint32 session_id, + PP_Var web_session_id) = 0; + virtual void SessionMessage(PP_Instance instance, + uint32 session_id, + PP_Var message, + PP_Var destination_url) = 0; + virtual void SessionReady(PP_Instance instance, uint32 session_id) = 0; + virtual void SessionClosed(PP_Instance instance, uint32 session_id) = 0; + virtual void SessionError(PP_Instance instance, + uint32 session_id, + int32_t media_error, + int32_t system_error) = 0; virtual void DeliverBlock(PP_Instance instance, PP_Resource decrypted_block, const PP_DecryptedBlockInfo* block_info) = 0; |