diff options
author | Torne (Richard Coles) <torne@google.com> | 2013-11-28 11:55:43 +0000 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2013-11-28 11:55:43 +0000 |
commit | f2477e01787aa58f445919b809d89e252beef54f (patch) | |
tree | 2db962b4af39f0db3a5f83b314373d0530c484b8 /ppapi | |
parent | 7daea1dd5ff7e419322de831b642d81af3247912 (diff) | |
download | chromium_org-f2477e01787aa58f445919b809d89e252beef54f.tar.gz |
Merge from Chromium at DEPS revision 237746
This commit was generated by merge_to_master.py.
Change-Id: I8997af4cddfeb09a7c26f7e8e672c712cab461ea
Diffstat (limited to 'ppapi')
139 files changed, 1938 insertions, 1373 deletions
diff --git a/ppapi/README.chromium b/ppapi/README.chromium deleted file mode 100644 index 5d0b4244e2..0000000000 --- a/ppapi/README.chromium +++ /dev/null @@ -1,4 +0,0 @@ -Name: PPAPI -URL: http://code.google.com/p/ppapi -License: BSD and MIT -Security Critical: yes diff --git a/ppapi/api/OWNERS b/ppapi/api/OWNERS deleted file mode 100644 index f7c2b72326..0000000000 --- a/ppapi/api/OWNERS +++ /dev/null @@ -1,3 +0,0 @@ -noelallen@chromium.org -binji@chromium.org -nfullagar@chromium.org diff --git a/ppapi/api/dev/ppb_file_io_dev.idl b/ppapi/api/dev/ppb_file_io_dev.idl index f46a4a8693..82a6452111 100644 --- a/ppapi/api/dev/ppb_file_io_dev.idl +++ b/ppapi/api/dev/ppb_file_io_dev.idl @@ -10,8 +10,6 @@ * permissions. */ -[generate_thunk] - label Chrome { M31 = 0.1 }; diff --git a/ppapi/api/dev/ppb_graphics_2d_dev.idl b/ppapi/api/dev/ppb_graphics_2d_dev.idl index 33b5f59318..28a844416a 100644 --- a/ppapi/api/dev/ppb_graphics_2d_dev.idl +++ b/ppapi/api/dev/ppb_graphics_2d_dev.idl @@ -8,7 +8,28 @@ [generate_thunk] label Chrome { - M22 = 0.1 + M22 = 0.1, + M32 = 0.2 +}; + +/** + * These options affect how the existing graphics context is displayed when a + * plugin is resized. + */ +[assert_size(4)] +enum PP_Graphics2D_Dev_ResizeMode { + /** + * In this mode, the context does not change size or offset. If the backing + * store is the same size as the plugin element, this will result in the + * pixels on the right side of the plugin element being unavailable, revealing + * the contents underneath it. + */ + PP_GRAPHICS2D_DEV_RESIZEMODE_DEFAULT, + /** + * In this mode, the context and its offset are scaled relative to how much + * the plugin element has been resized. + */ + PP_GRAPHICS2D_DEV_RESIZEMODE_STRETCH }; /* PPB_Graphics2D_Dev interface */ @@ -24,7 +45,7 @@ interface PPB_Graphics2D_Dev { * SetScale with 0.5. One would then treat each pixel in the context as a * single device pixel. * - * @param[in] resource A <code>Graphics2D</code> context resource. + * @param[in] resource A <code>Graphics2D</code> context resource. * @param[in] scale The scale to apply when painting. * * @return Returns <code>PP_TRUE</code> on success or <code>PP_FALSE</code> if @@ -45,5 +66,31 @@ interface PPB_Graphics2D_Dev { */ float_t GetScale( [in] PP_Resource resource); -}; + + /*** + * Sets the offset into the plugin element at which the graphics context is + * painted. This allows a portion of the plugin element to be painted to. + * The new offset will only be applied after Flush() has been called. + * + * @param[in] resource A <code>Graphics2D</code> context resource. + * @param[in] offset The offset at which the context should be painted. + */ + [version=0.2] + void SetOffset( + [in] PP_Resource resource, + [in] PP_Point offset); + + /*** + * Sets the resize mode for the graphics context. When a plugin element is + * resized in the DOM, it takes time for the plugin to update the graphics + * context in the renderer. These options affect how the existing context is + * displayed until the backing store is updated by the plugin. + * + * @param[in] resource A <code>Graphics2D</code> context resource. + * @param[in] resize_mode The resize mode to change this context to. + */ + void SetResizeMode( + [in] PP_Resource resource, + [in] PP_Graphics2D_Dev_ResizeMode resize_mode); +}; diff --git a/ppapi/api/dev/ppb_url_util_dev.idl b/ppapi/api/dev/ppb_url_util_dev.idl index 6cd0e75674..f3eb66f90f 100644 --- a/ppapi/api/dev/ppb_url_util_dev.idl +++ b/ppapi/api/dev/ppb_url_util_dev.idl @@ -7,8 +7,6 @@ * This file defines the <code>PPB_URLUtil_Dev</code> interface. */ -[generate_thunk] - label Chrome { M17 = 0.6, M31 = 0.7 diff --git a/ppapi/api/private/finish_writing_these/ppb_pdf.idl b/ppapi/api/private/finish_writing_these/ppb_pdf.idl index 3038d92b30..d586f09c38 100644 --- a/ppapi/api/private/finish_writing_these/ppb_pdf.idl +++ b/ppapi/api/private/finish_writing_these/ppb_pdf.idl @@ -146,4 +146,8 @@ interface PPB_PDF_0_1 { PP_Var ModalPromptForPassword( [in] PP_Instance instance, [in] PP_Var message); + + /* Returns PP_TRUE if the plugin is out of process. */ + PP_Bool IsOutOfProcess( + [in] PP_Instance instance); }; diff --git a/ppapi/api/private/ppb_content_decryptor_private.idl b/ppapi/api/private/ppb_content_decryptor_private.idl index fbf46636e9..8577de2d0f 100644 --- a/ppapi/api/private/ppb_content_decryptor_private.idl +++ b/ppapi/api/private/ppb_content_decryptor_private.idl @@ -12,7 +12,6 @@ [generate_thunk] label Chrome { - M31 = 0.7, M32 = 0.8 }; @@ -37,16 +36,12 @@ interface PPB_ContentDecryptor_Private { * The CDM must call <code>KeyAdded()</code> when the sequence is completed, * and, in response, the browser must notify the web application. * - * @param[in] key_system A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the name of the key system. - * - * @param[in] session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the session ID. + * @param[in] reference_id A reference for the session for which a key + * was added. */ void KeyAdded( [in] PP_Instance instance, - [in] PP_Var key_system, - [in] PP_Var session_id); + [in] uint32_t reference_id); /** * A message or request has been generated for key_system in the CDM, and @@ -62,11 +57,8 @@ interface PPB_ContentDecryptor_Private { * <code>AddKey()</code> and <code>KeyMessage()</code> calls required to * prepare for decryption. * - * @param[in] key_system A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the name of the key system. - * - * @param[in] session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the session ID. + * @param[in] reference_id A reference for 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. @@ -76,8 +68,7 @@ interface PPB_ContentDecryptor_Private { */ void KeyMessage( [in] PP_Instance instance, - [in] PP_Var key_system, - [in] PP_Var session_id, + [in] uint32_t reference_id, [in] PP_Var message, [in] PP_Var default_url); @@ -85,11 +76,8 @@ interface PPB_ContentDecryptor_Private { * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, * or within the plugin implementing the interface. * - * @param[in] key_system A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the name of the key system. - * - * @param[in] session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the session ID. + * @param[in] reference_id A reference for the session for which the error + * is intended. * * @param[in] media_error A MediaKeyError. * @@ -97,12 +85,26 @@ interface PPB_ContentDecryptor_Private { */ void KeyError( [in] PP_Instance instance, - [in] PP_Var key_system, - [in] PP_Var session_id, + [in] uint32_t reference_id, [in] int32_t media_error, [in] int32_t system_code); /** + * A session ID has been generated by the CDM for a session. + * + * @param[in] reference_id A reference for the session for which the session + * id is intended. + * + * @param[in] session_id A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the session ID. + * + */ + void SetSessionId( + [in] PP_Instance instance, + [in] uint32_t reference_id, + [in] PP_Var session_id); + + /** * Called after the <code>Decrypt()</code> method on the * <code>PPP_ContentDecryptor_Private</code> interface completes to * deliver decrypted_block to the browser for decoding and rendering. diff --git a/ppapi/api/private/ppb_ext_crx_file_system_private.idl b/ppapi/api/private/ppb_ext_crx_file_system_private.idl index 045864199d..5c46de7262 100644 --- a/ppapi/api/private/ppb_ext_crx_file_system_private.idl +++ b/ppapi/api/private/ppb_ext_crx_file_system_private.idl @@ -3,8 +3,6 @@ * found in the LICENSE file. */ -[generate_thunk,thunk_include="ppapi/thunk/ppb_ext_crx_file_system_private_api.h"] - /** * This file contains the <code>PPB_Ext_CrxFileSystem_Private</code> interface. */ @@ -27,7 +25,6 @@ interface PPB_Ext_CrxFileSystem_Private { * * @return An int32_t containing an error code from <code>pp_errors.h</code>. */ - [singleton,api=PPB_Ext_CrxFileSystem_Private_API] int32_t Open([in] PP_Instance instance, [out] PP_Resource file_system, [in] PP_CompletionCallback callback); diff --git a/ppapi/api/private/ppb_flash_drm.idl b/ppapi/api/private/ppb_flash_drm.idl index 3131972406..c6f6efff5a 100644 --- a/ppapi/api/private/ppb_flash_drm.idl +++ b/ppapi/api/private/ppb_flash_drm.idl @@ -10,7 +10,8 @@ [generate_thunk] label Chrome { - M29 = 1.0 + M29 = 1.0, + M33 = 1.1 }; /** @@ -48,5 +49,15 @@ interface PPB_Flash_DRM { int32_t GetVoucherFile([in] PP_Resource drm, [out] PP_Resource file_ref, [in] PP_CompletionCallback callback); + + /** + * Asynchronously returns a value indicating whether the monitor on which the + * plugin instance is displayed is external. |callback| will be called upon + * completion. + */ + [version=1.1] + int32_t MonitorIsExternal([in] PP_Resource drm, + [out] PP_Bool is_external, + [in] PP_CompletionCallback callback); }; diff --git a/ppapi/api/private/ppb_isolated_file_system_private.idl b/ppapi/api/private/ppb_isolated_file_system_private.idl new file mode 100644 index 0000000000..c42d520123 --- /dev/null +++ b/ppapi/api/private/ppb_isolated_file_system_private.idl @@ -0,0 +1,54 @@ +/* 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. + */ + +[generate_thunk,thunk_include="ppapi/thunk/ppb_isolated_file_system_private_api.h"] + +/** + * This file contains the <code>PPB_IsolatedFileSystem_Private</code> interface. + */ +label Chrome { + M33 = 0.2 +}; + + +/** + * The <code>PP_IsolatedFileSystemType_Private</code> values indicate the type + * of isolated file systems. + */ +[assert_size(4)] +enum PP_IsolatedFileSystemType_Private { + /** Type for invalid file systems */ + PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID = 0, + /** Type for CRX file systems */ + PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX = 1, + /** Type for PluginPrivate file systems */ + PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE = 2 +}; + +/* <code>PPB_IsolatedFileSystem_Private</code> interface */ +interface PPB_IsolatedFileSystem_Private { + /** + * Open() opens a file system corresponding the given file system type. + * + * When opening the CRX file system, this should be called from an extension + * context, otherwise it will fail. + * + * @param[in] instance A <code>PP_Instance</code> identifying the instance + * with the file system. + * @param[in] type A file system type as defined by + * <code>PP_IsolatedFileSystemType_Private</code> enum. + * @param[out] file_system An output <code>PP_Resource</code> corresponding + * to a PPB_FileSystem. + * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon + * completion of Open. + * + * @return An int32_t containing an error code from <code>pp_errors.h</code>. + */ + [singleton,api=PPB_IsolatedFileSystem_Private_API] + int32_t Open([in] PP_Instance instance, + [in] PP_IsolatedFileSystemType_Private type, + [out] PP_Resource file_system, + [in] PP_CompletionCallback callback); +}; diff --git a/ppapi/api/private/ppb_nacl_private.idl b/ppapi/api/private/ppb_nacl_private.idl index 7a52372fdd..2d85044ac7 100644 --- a/ppapi/api/private/ppb_nacl_private.idl +++ b/ppapi/api/private/ppb_nacl_private.idl @@ -24,6 +24,17 @@ enum PP_NaClError { PP_NACL_MANIFEST_MISSING_ARCH = 0 }; +/** Event types that NaCl may use when reporting load progress or errors. */ +enum PP_NaClEventType { + PP_NACL_EVENT_LOADSTART, + PP_NACL_EVENT_PROGRESS, + PP_NACL_EVENT_ERROR, + PP_NACL_EVENT_ABORT, + PP_NACL_EVENT_LOAD, + PP_NACL_EVENT_LOADEND, + PP_NACL_EVENT_CRASH +}; + /* PPB_NaCl_Private */ interface PPB_NaCl_Private { /* Launches NaCl's sel_ldr process. Returns PP_EXTERNAL_PLUGIN_OK on success @@ -151,4 +162,22 @@ interface PPB_NaCl_Private { [in] str_t file_url, [out] uint64_t file_token_lo, [out] uint64_t file_token_hi); + + + /* Dispatch a progress event on the DOM element where the given instance is + * embedded. + */ + void DispatchEvent([in] PP_Instance instance, + [in] PP_NaClEventType event_type, + [in] PP_Var resource_url, + [in] PP_Bool length_is_computable, + [in] uint64_t loaded_bytes, + [in] uint64_t total_bytes); + + /* Sets a read-only property on the <embed> DOM element that corresponds to + * the given instance. + */ + void SetReadOnlyProperty([in] PP_Instance instance, + [in] PP_Var key, + [in] PP_Var value); }; diff --git a/ppapi/api/dev/ppb_testing_dev.idl b/ppapi/api/private/ppb_testing_private.idl index c114db00e2..98ddfc84bb 100644 --- a/ppapi/api/dev/ppb_testing_dev.idl +++ b/ppapi/api/private/ppb_testing_private.idl @@ -1,4 +1,4 @@ -/* Copyright (c) 2012 The Chromium Authors. All rights reserved. +/* 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. */ @@ -10,14 +10,10 @@ */ label Chrome { - M14 = 0.7, - M15 = 0.8, - M17 = 0.9, - M18 = 0.91, - M28 = 0.92 + M33 = 1.0 }; -interface PPB_Testing_Dev { +interface PPB_Testing_Private { /** * Reads the bitmap data out of the backing store for the given * DeviceContext2D and into the given image. If the data was successfully @@ -102,7 +98,6 @@ interface PPB_Testing_Dev { * slightly alter the mouse position, due to coordinate transforms it * performs. */ - [version=0.8] void SimulateInputEvent([in] PP_Instance instance, [in] PP_Resource input_event); @@ -113,7 +108,6 @@ interface PPB_Testing_Dev { * and fill in the components structure. This pointer may be NULL * to specify that no component information is necessary. */ - [version=0.9] PP_Var GetDocumentURL([in] PP_Instance instance, [out] PP_URLComponents_Dev components); @@ -125,7 +119,6 @@ interface PPB_Testing_Dev { * subset of |array_size| vars is written to |live_vars|. The reference count * of the returned PP_Vars will *not* be affected by this call. */ - [version=0.91] uint32_t GetLiveVars([size_as=array_size] PP_Var[] live_vars, [in] uint32_t array_size); @@ -136,7 +129,6 @@ interface PPB_Testing_Dev { * (in order to have fast tests). Passing a value of 0 resets the threshold * to its default. The threshold is in bytes. */ - [version=0.92] void SetMinimumArrayBufferSizeForShmem([in] PP_Instance instance, [in] uint32_t threshold); }; diff --git a/ppapi/api/private/ppp_content_decryptor_private.idl b/ppapi/api/private/ppp_content_decryptor_private.idl index 5eba37a8c2..0136ff07f8 100644 --- a/ppapi/api/private/ppp_content_decryptor_private.idl +++ b/ppapi/api/private/ppp_content_decryptor_private.idl @@ -9,7 +9,7 @@ * Decryption Modules, not normal plugins. */ label Chrome { - M31 = 0.7 + M32 = 0.8 }; /** @@ -25,15 +25,10 @@ interface PPP_ContentDecryptor_Private { * * @param[in] key_system A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the name of the key system. - * - * @param[in] can_challenge_platform A <code>PP_Bool</code> that - * indicates if the underlying host platform can be challenged; - * i.e., verified as a trusted platform. */ void Initialize( [in] PP_Instance instance, - [in] PP_Var key_system, - [in] PP_Bool can_challenge_platform); + [in] PP_Var key_system); /** * Generates a key request. key_system specifies the key or licensing system @@ -45,6 +40,9 @@ interface PPP_ContentDecryptor_Private { * browser by the CDM via <code>KeyMessage()</code> on the * <code>PPB_ContentDecryptor_Private</code> interface. * + * @param[in] reference_id A reference for the session for which the key + * should be generated. + * * @param[in] type A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the MIME type for init_data. * @@ -54,6 +52,7 @@ interface PPP_ContentDecryptor_Private { */ void GenerateKeyRequest( [in] PP_Instance instance, + [in] uint32_t reference_id, [in] PP_Var type, [in] PP_Var init_data); @@ -68,8 +67,8 @@ interface PPP_ContentDecryptor_Private { * <code>PPB_ContentDecryptor_Private</code> interface, and the browser * must notify the web application. * - * @param[in] session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the session ID. + * @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, @@ -81,19 +80,19 @@ interface PPP_ContentDecryptor_Private { */ void AddKey( [in] PP_Instance instance, - [in] PP_Var session_id, + [in] uint32_t reference_id, [in] PP_Var key, [in] PP_Var init_data); /** * Cancels a pending key request for the specified session ID. * - * @param[in] session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the session ID. + * @param[in] reference_id A reference for the session for which the key + * request should be cancelled. */ void CancelKeyRequest( [in] PP_Instance instance, - [in] PP_Var session_id); + [in] uint32_t reference_id); /** * Decrypts the block and returns the unencrypted block via diff --git a/ppapi/c/dev/ppb_graphics_2d_dev.h b/ppapi/c/dev/ppb_graphics_2d_dev.h index a4661215a1..245ae588ff 100644 --- a/ppapi/c/dev/ppb_graphics_2d_dev.h +++ b/ppapi/c/dev/ppb_graphics_2d_dev.h @@ -3,18 +3,20 @@ * found in the LICENSE file. */ -/* From dev/ppb_graphics_2d_dev.idl modified Tue Jun 19 14:11:08 2012. */ +/* From dev/ppb_graphics_2d_dev.idl modified Tue Nov 12 11:22:26 2013. */ #ifndef PPAPI_C_DEV_PPB_GRAPHICS_2D_DEV_H_ #define PPAPI_C_DEV_PPB_GRAPHICS_2D_DEV_H_ #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_macros.h" +#include "ppapi/c/pp_point.h" #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_stdint.h" #define PPB_GRAPHICS2D_DEV_INTERFACE_0_1 "PPB_Graphics2D(Dev);0.1" -#define PPB_GRAPHICS2D_DEV_INTERFACE PPB_GRAPHICS2D_DEV_INTERFACE_0_1 +#define PPB_GRAPHICS2D_DEV_INTERFACE_0_2 "PPB_Graphics2D(Dev);0.2" +#define PPB_GRAPHICS2D_DEV_INTERFACE PPB_GRAPHICS2D_DEV_INTERFACE_0_2 /** * @file @@ -22,11 +24,38 @@ /** + * @addtogroup Enums + * @{ + */ +/** + * These options affect how the existing graphics context is displayed when a + * plugin is resized. + */ +typedef enum { + /** + * In this mode, the context does not change size or offset. If the backing + * store is the same size as the plugin element, this will result in the + * pixels on the right side of the plugin element being unavailable, revealing + * the contents underneath it. + */ + PP_GRAPHICS2D_DEV_RESIZEMODE_DEFAULT, + /** + * In this mode, the context and its offset are scaled relative to how much + * the plugin element has been resized. + */ + PP_GRAPHICS2D_DEV_RESIZEMODE_STRETCH +} PP_Graphics2D_Dev_ResizeMode; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Graphics2D_Dev_ResizeMode, 4); +/** + * @} + */ + +/** * @addtogroup Interfaces * @{ */ /* PPB_Graphics2D_Dev interface */ -struct PPB_Graphics2D_Dev_0_1 { +struct PPB_Graphics2D_Dev_0_2 { /** * SetScale() sets the scale factor that will be applied when painting the * graphics context onto the output device. Typically, if rendering at device @@ -55,9 +84,36 @@ struct PPB_Graphics2D_Dev_0_1 { * is not a valid <code>Graphics2D</code> context, this will return 0.0. */ float (*GetScale)(PP_Resource resource); + /*** + * Sets the offset into the plugin element at which the graphics context is + * painted. This allows a portion of the plugin element to be painted to. + * The new offset will only be applied after Flush() has been called. + * + * @param[in] resource A <code>Graphics2D</code> context resource. + * @param[in] offset The offset at which the context should be painted. + */ + void (*SetOffset)(PP_Resource resource, const struct PP_Point* offset); + /*** + * Sets the resize mode for the graphics context. When a plugin element is + * resized in the DOM, it takes time for the plugin to update the graphics + * context in the renderer. These options affect how the existing context is + * displayed until the backing store is updated by the plugin. + * + * @param[in] resource A <code>Graphics2D</code> context resource. + * @param[in] resize_mode The resize mode to change this context to. + */ + void (*SetResizeMode)(PP_Resource resource, + PP_Graphics2D_Dev_ResizeMode resize_mode); }; -typedef struct PPB_Graphics2D_Dev_0_1 PPB_Graphics2D_Dev; +typedef struct PPB_Graphics2D_Dev_0_2 PPB_Graphics2D_Dev; + +struct PPB_Graphics2D_Dev_0_1 { + PP_Bool (*SetScale)(PP_Resource resource, float scale); + float (*GetScale)(PP_Resource resource); + void (*SetResizeMode)(PP_Resource resource, + PP_Graphics2D_Dev_ResizeMode resize_mode); +}; /** * @} */ diff --git a/ppapi/c/pp_macros.h b/ppapi/c/pp_macros.h index 73d14f0d3f..e143b2290e 100644 --- a/ppapi/c/pp_macros.h +++ b/ppapi/c/pp_macros.h @@ -3,13 +3,13 @@ * found in the LICENSE file. */ -/* From pp_macros.idl modified Tue Oct 8 17:55:09 2013. */ +/* From pp_macros.idl modified Wed Mar 6 13:04:56 2013. */ #ifndef PPAPI_C_PP_MACROS_H_ #define PPAPI_C_PP_MACROS_H_ -#define PPAPI_RELEASE 32 +#define PPAPI_RELEASE 33 /** * @file diff --git a/ppapi/c/private/ppb_content_decryptor_private.h b/ppapi/c/private/ppb_content_decryptor_private.h index 5e3d1aa4df..72bd457e53 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 Thu Oct 10 14:49:51 2013. + * modified Mon Oct 21 17:11:33 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_7 \ - "PPB_ContentDecryptor_Private;0.7" +#define PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_8 \ + "PPB_ContentDecryptor_Private;0.8" #define PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ - PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_7 + PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_8 /** * @file @@ -42,7 +42,7 @@ * browser side support for the Content Decryption Module (CDM) for v0.1 of the * proposed Encrypted Media Extensions: http://goo.gl/rbdnR */ -struct PPB_ContentDecryptor_Private_0_7 { +struct PPB_ContentDecryptor_Private_0_8 { /** * 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. @@ -56,15 +56,10 @@ struct PPB_ContentDecryptor_Private_0_7 { * The CDM must call <code>KeyAdded()</code> when the sequence is completed, * and, in response, the browser must notify the web application. * - * @param[in] key_system A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the name of the key system. - * - * @param[in] session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the session ID. + * @param[in] reference_id A reference for the session for which a key + * was added. */ - void (*KeyAdded)(PP_Instance instance, - struct PP_Var key_system, - struct PP_Var session_id); + void (*KeyAdded)(PP_Instance instance, uint32_t reference_id); /** * A message or request has been generated for key_system in the CDM, and * must be sent to the web application. @@ -79,11 +74,8 @@ struct PPB_ContentDecryptor_Private_0_7 { * <code>AddKey()</code> and <code>KeyMessage()</code> calls required to * prepare for decryption. * - * @param[in] key_system A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the name of the key system. - * - * @param[in] session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the session ID. + * @param[in] reference_id A reference for 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. @@ -92,30 +84,38 @@ struct PPB_ContentDecryptor_Private_0_7 { * <code>PP_VARTYPE_STRING</code> containing the default URL for the message. */ void (*KeyMessage)(PP_Instance instance, - struct PP_Var key_system, - struct PP_Var session_id, + uint32_t reference_id, struct PP_Var message, struct PP_Var default_url); /** * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, * or within the plugin implementing the interface. * - * @param[in] key_system A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the name of the key system. - * - * @param[in] session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the session ID. + * @param[in] reference_id A reference for the session for which the error + * is intended. * * @param[in] media_error A MediaKeyError. * * @param[in] system_error A system error code. */ void (*KeyError)(PP_Instance instance, - struct PP_Var key_system, - struct PP_Var session_id, + uint32_t reference_id, int32_t media_error, int32_t system_code); /** + * A session ID has been generated by the CDM for a session. + * + * @param[in] reference_id A reference for the session for which the session + * id is intended. + * + * @param[in] session_id A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the session ID. + * + */ + void (*SetSessionId)(PP_Instance instance, + uint32_t reference_id, + struct PP_Var session_id); + /** * Called after the <code>Decrypt()</code> method on the * <code>PPP_ContentDecryptor_Private</code> interface completes to * deliver decrypted_block to the browser for decoding and rendering. @@ -244,7 +244,7 @@ struct PPB_ContentDecryptor_Private_0_7 { const struct PP_DecryptedSampleInfo* decrypted_sample_info); }; -typedef struct PPB_ContentDecryptor_Private_0_7 PPB_ContentDecryptor_Private; +typedef struct PPB_ContentDecryptor_Private_0_8 PPB_ContentDecryptor_Private; /** * @} */ diff --git a/ppapi/c/private/ppb_ext_crx_file_system_private.h b/ppapi/c/private/ppb_ext_crx_file_system_private.h index 114a016faa..be774115b8 100644 --- a/ppapi/c/private/ppb_ext_crx_file_system_private.h +++ b/ppapi/c/private/ppb_ext_crx_file_system_private.h @@ -4,7 +4,7 @@ */ /* From private/ppb_ext_crx_file_system_private.idl, - * modified Fri May 3 09:55:27 2013. + * modified Fri Nov 1 12:23:59 2013. */ #ifndef PPAPI_C_PRIVATE_PPB_EXT_CRX_FILE_SYSTEM_PRIVATE_H_ @@ -23,6 +23,7 @@ /** * @file + * This file contains the <code>PPB_Ext_CrxFileSystem_Private</code> interface. */ diff --git a/ppapi/c/private/ppb_flash_drm.h b/ppapi/c/private/ppb_flash_drm.h index 85033a4085..88d0f765b5 100644 --- a/ppapi/c/private/ppb_flash_drm.h +++ b/ppapi/c/private/ppb_flash_drm.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From private/ppb_flash_drm.idl modified Sat Jun 8 16:45:26 2013. */ +/* From private/ppb_flash_drm.idl modified Mon Nov 11 14:49:53 2013. */ #ifndef PPAPI_C_PRIVATE_PPB_FLASH_DRM_H_ #define PPAPI_C_PRIVATE_PPB_FLASH_DRM_H_ @@ -17,7 +17,8 @@ #include "ppapi/c/pp_var.h" #define PPB_FLASH_DRM_INTERFACE_1_0 "PPB_Flash_DRM;1.0" -#define PPB_FLASH_DRM_INTERFACE PPB_FLASH_DRM_INTERFACE_1_0 +#define PPB_FLASH_DRM_INTERFACE_1_1 "PPB_Flash_DRM;1.1" +#define PPB_FLASH_DRM_INTERFACE PPB_FLASH_DRM_INTERFACE_1_1 /** * @file @@ -32,7 +33,7 @@ /** * A resource for performing Flash DRM-related operations. */ -struct PPB_Flash_DRM_1_0 { +struct PPB_Flash_DRM_1_1 { /** * Creates a PPB_Flash_DRM resource for performing DRM-related operations in * Flash. @@ -60,9 +61,28 @@ struct PPB_Flash_DRM_1_0 { int32_t (*GetVoucherFile)(PP_Resource drm, PP_Resource* file_ref, struct PP_CompletionCallback callback); + /** + * Asynchronously returns a value indicating whether the monitor on which the + * plugin instance is displayed is external. |callback| will be called upon + * completion. + */ + int32_t (*MonitorIsExternal)(PP_Resource drm, + PP_Bool* is_external, + struct PP_CompletionCallback callback); }; -typedef struct PPB_Flash_DRM_1_0 PPB_Flash_DRM; +typedef struct PPB_Flash_DRM_1_1 PPB_Flash_DRM; + +struct PPB_Flash_DRM_1_0 { + PP_Resource (*Create)(PP_Instance instance); + int32_t (*GetDeviceID)(PP_Resource drm, + struct PP_Var* id, + struct PP_CompletionCallback callback); + PP_Bool (*GetHmonitor)(PP_Resource drm, int64_t* hmonitor); + int32_t (*GetVoucherFile)(PP_Resource drm, + PP_Resource* file_ref, + struct PP_CompletionCallback callback); +}; /** * @} */ diff --git a/ppapi/c/private/ppb_isolated_file_system_private.h b/ppapi/c/private/ppb_isolated_file_system_private.h new file mode 100644 index 0000000000..410108b8cb --- /dev/null +++ b/ppapi/c/private/ppb_isolated_file_system_private.h @@ -0,0 +1,86 @@ +/* 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 private/ppb_isolated_file_system_private.idl, + * modified Fri Nov 8 02:21:15 2013. + */ + +#ifndef PPAPI_C_PRIVATE_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_H_ +#define PPAPI_C_PRIVATE_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_H_ + +#include "ppapi/c/pp_completion_callback.h" +#include "ppapi/c/pp_instance.h" +#include "ppapi/c/pp_macros.h" +#include "ppapi/c/pp_resource.h" +#include "ppapi/c/pp_stdint.h" + +#define PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE_0_2 \ + "PPB_IsolatedFileSystem_Private;0.2" +#define PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE \ + PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE_0_2 + +/** + * @file + */ + + +/** + * @addtogroup Enums + * @{ + */ +/** + * The <code>PP_IsolatedFileSystemType_Private</code> values indicate the type + * of isolated file systems. + */ +typedef enum { + /** Type for invalid file systems */ + PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID = 0, + /** Type for CRX file systems */ + PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX = 1, + /** Type for PluginPrivate file systems */ + PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE = 2 +} PP_IsolatedFileSystemType_Private; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_IsolatedFileSystemType_Private, 4); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/* <code>PPB_IsolatedFileSystem_Private</code> interface */ +struct PPB_IsolatedFileSystem_Private_0_2 { + /** + * Open() opens a file system corresponding the given file system type. + * + * When opening the CRX file system, this should be called from an extension + * context, otherwise it will fail. + * + * @param[in] instance A <code>PP_Instance</code> identifying the instance + * with the file system. + * @param[in] type A file system type as defined by + * <code>PP_IsolatedFileSystemType_Private</code> enum. + * @param[out] file_system An output <code>PP_Resource</code> corresponding + * to a PPB_FileSystem. + * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon + * completion of Open. + * + * @return An int32_t containing an error code from <code>pp_errors.h</code>. + */ + int32_t (*Open)(PP_Instance instance, + PP_IsolatedFileSystemType_Private type, + PP_Resource* file_system, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_IsolatedFileSystem_Private_0_2 + PPB_IsolatedFileSystem_Private; +/** + * @} + */ + +#endif /* PPAPI_C_PRIVATE_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_H_ */ + diff --git a/ppapi/c/private/ppb_nacl_private.h b/ppapi/c/private/ppb_nacl_private.h index 3b677405d9..7ba7583e08 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 Oct 31 15:10:06 2013. */ +/* From private/ppb_nacl_private.idl modified Thu Nov 14 08:29:25 2013. */ #ifndef PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ #define PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ @@ -40,6 +40,17 @@ typedef enum { */ PP_NACL_MANIFEST_MISSING_ARCH = 0 } PP_NaClError; + +/** Event types that NaCl may use when reporting load progress or errors. */ +typedef enum { + PP_NACL_EVENT_LOADSTART, + PP_NACL_EVENT_PROGRESS, + PP_NACL_EVENT_ERROR, + PP_NACL_EVENT_ABORT, + PP_NACL_EVENT_LOAD, + PP_NACL_EVENT_LOADEND, + PP_NACL_EVENT_CRASH +} PP_NaClEventType; /** * @} */ @@ -163,6 +174,21 @@ struct PPB_NaCl_Private_1_0 { const char* file_url, uint64_t* file_token_lo, uint64_t* file_token_hi); + /* Dispatch a progress event on the DOM element where the given instance is + * embedded. + */ + void (*DispatchEvent)(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); + /* Sets a read-only property on the <embed> DOM element that corresponds to + * the given instance. + */ + void (*SetReadOnlyProperty)(PP_Instance instance, + struct PP_Var key, + struct PP_Var value); }; typedef struct PPB_NaCl_Private_1_0 PPB_NaCl_Private; diff --git a/ppapi/c/private/ppb_pdf.h b/ppapi/c/private/ppb_pdf.h index fdc5748640..9053802b89 100644 --- a/ppapi/c/private/ppb_pdf.h +++ b/ppapi/c/private/ppb_pdf.h @@ -160,6 +160,9 @@ struct PPB_PDF { // Invoke password dialog for plugin. struct PP_Var (*ModalPromptForPassword)(PP_Instance instance, struct PP_Var message); + + // Returns PP_TRUE if the plugin is out of process. + PP_Bool(*IsOutOfProcess)(PP_Instance instance); }; #endif // PPAPI_C_PRIVATE_PPB_PDF_H_ diff --git a/ppapi/c/dev/ppb_testing_dev.h b/ppapi/c/private/ppb_testing_private.h index e5078e2fd3..889807dfc9 100644 --- a/ppapi/c/dev/ppb_testing_dev.h +++ b/ppapi/c/private/ppb_testing_private.h @@ -1,12 +1,12 @@ -/* Copyright (c) 2012 The Chromium Authors. All rights reserved. +/* 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_testing_dev.idl modified Thu Apr 18 13:22:09 2013. */ +/* From private/ppb_testing_private.idl modified Mon Nov 18 14:42:33 2013. */ -#ifndef PPAPI_C_DEV_PPB_TESTING_DEV_H_ -#define PPAPI_C_DEV_PPB_TESTING_DEV_H_ +#ifndef PPAPI_C_PRIVATE_PPB_TESTING_PRIVATE_H_ +#define PPAPI_C_PRIVATE_PPB_TESTING_PRIVATE_H_ #include "ppapi/c/dev/ppb_url_util_dev.h" #include "ppapi/c/pp_bool.h" @@ -17,12 +17,8 @@ #include "ppapi/c/pp_stdint.h" #include "ppapi/c/pp_var.h" -#define PPB_TESTING_DEV_INTERFACE_0_7 "PPB_Testing(Dev);0.7" -#define PPB_TESTING_DEV_INTERFACE_0_8 "PPB_Testing(Dev);0.8" -#define PPB_TESTING_DEV_INTERFACE_0_9 "PPB_Testing(Dev);0.9" -#define PPB_TESTING_DEV_INTERFACE_0_91 "PPB_Testing(Dev);0.91" -#define PPB_TESTING_DEV_INTERFACE_0_92 "PPB_Testing(Dev);0.92" -#define PPB_TESTING_DEV_INTERFACE PPB_TESTING_DEV_INTERFACE_0_92 +#define PPB_TESTING_PRIVATE_INTERFACE_1_0 "PPB_Testing_Private;1.0" +#define PPB_TESTING_PRIVATE_INTERFACE PPB_TESTING_PRIVATE_INTERFACE_1_0 /** * @file @@ -36,7 +32,7 @@ * @addtogroup Interfaces * @{ */ -struct PPB_Testing_Dev_0_92 { +struct PPB_Testing_Private_1_0 { /** * Reads the bitmap data out of the backing store for the given * DeviceContext2D and into the given image. If the data was successfully @@ -146,58 +142,10 @@ struct PPB_Testing_Dev_0_92 { uint32_t threshold); }; -typedef struct PPB_Testing_Dev_0_92 PPB_Testing_Dev; - -struct PPB_Testing_Dev_0_7 { - PP_Bool (*ReadImageData)(PP_Resource device_context_2d, - PP_Resource image, - const struct PP_Point* top_left); - void (*RunMessageLoop)(PP_Instance instance); - void (*QuitMessageLoop)(PP_Instance instance); - uint32_t (*GetLiveObjectsForInstance)(PP_Instance instance); - PP_Bool (*IsOutOfProcess)(void); -}; - -struct PPB_Testing_Dev_0_8 { - PP_Bool (*ReadImageData)(PP_Resource device_context_2d, - PP_Resource image, - const struct PP_Point* top_left); - void (*RunMessageLoop)(PP_Instance instance); - void (*QuitMessageLoop)(PP_Instance instance); - uint32_t (*GetLiveObjectsForInstance)(PP_Instance instance); - PP_Bool (*IsOutOfProcess)(void); - void (*SimulateInputEvent)(PP_Instance instance, PP_Resource input_event); -}; - -struct PPB_Testing_Dev_0_9 { - PP_Bool (*ReadImageData)(PP_Resource device_context_2d, - PP_Resource image, - const struct PP_Point* top_left); - void (*RunMessageLoop)(PP_Instance instance); - void (*QuitMessageLoop)(PP_Instance instance); - uint32_t (*GetLiveObjectsForInstance)(PP_Instance instance); - PP_Bool (*IsOutOfProcess)(void); - void (*SimulateInputEvent)(PP_Instance instance, PP_Resource input_event); - struct PP_Var (*GetDocumentURL)(PP_Instance instance, - struct PP_URLComponents_Dev* components); -}; - -struct PPB_Testing_Dev_0_91 { - PP_Bool (*ReadImageData)(PP_Resource device_context_2d, - PP_Resource image, - const struct PP_Point* top_left); - void (*RunMessageLoop)(PP_Instance instance); - void (*QuitMessageLoop)(PP_Instance instance); - uint32_t (*GetLiveObjectsForInstance)(PP_Instance instance); - PP_Bool (*IsOutOfProcess)(void); - void (*SimulateInputEvent)(PP_Instance instance, PP_Resource input_event); - struct PP_Var (*GetDocumentURL)(PP_Instance instance, - struct PP_URLComponents_Dev* components); - uint32_t (*GetLiveVars)(struct PP_Var live_vars[], uint32_t array_size); -}; +typedef struct PPB_Testing_Private_1_0 PPB_Testing_Private; /** * @} */ -#endif /* PPAPI_C_DEV_PPB_TESTING_DEV_H_ */ +#endif /* PPAPI_C_PRIVATE_PPB_TESTING_PRIVATE_H_ */ diff --git a/ppapi/c/private/ppp_content_decryptor_private.h b/ppapi/c/private/ppp_content_decryptor_private.h index 69763df251..97ecf0dc63 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 Wed Sep 18 16:14:30 2013. + * modified Fri Oct 18 18:11:09 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_7 \ - "PPP_ContentDecryptor_Private;0.7" +#define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_8 \ + "PPP_ContentDecryptor_Private;0.8" #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ - PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_7 + PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_8 /** * @file @@ -42,20 +42,14 @@ * Decryption Module (CDM) for v0.1 of the proposed Encrypted Media Extensions: * http://goo.gl/rbdnR */ -struct PPP_ContentDecryptor_Private_0_7 { +struct PPP_ContentDecryptor_Private_0_8 { /** * Initialize for the specified key system. * * @param[in] key_system A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the name of the key system. - * - * @param[in] can_challenge_platform A <code>PP_Bool</code> that - * indicates if the underlying host platform can be challenged; - * i.e., verified as a trusted platform. */ - void (*Initialize)(PP_Instance instance, - struct PP_Var key_system, - PP_Bool can_challenge_platform); + 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 @@ -66,6 +60,9 @@ struct PPP_ContentDecryptor_Private_0_7 { * browser by the CDM via <code>KeyMessage()</code> on the * <code>PPB_ContentDecryptor_Private</code> interface. * + * @param[in] reference_id A reference for the session for which the key + * should be generated. + * * @param[in] type A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the MIME type for init_data. * @@ -74,6 +71,7 @@ struct PPP_ContentDecryptor_Private_0_7 { * initialization data. */ void (*GenerateKeyRequest)(PP_Instance instance, + uint32_t reference_id, struct PP_Var type, struct PP_Var init_data); /** @@ -87,8 +85,8 @@ struct PPP_ContentDecryptor_Private_0_7 { * <code>PPB_ContentDecryptor_Private</code> interface, and the browser * must notify the web application. * - * @param[in] session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the session ID. + * @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, @@ -99,16 +97,16 @@ struct PPP_ContentDecryptor_Private_0_7 { * initialization data. */ void (*AddKey)(PP_Instance instance, - struct PP_Var session_id, + uint32_t reference_id, struct PP_Var key, struct PP_Var init_data); /** * Cancels a pending key request for the specified session ID. * - * @param[in] session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the session ID. + * @param[in] reference_id A reference for the session for which the key + * request should be cancelled. */ - void (*CancelKeyRequest)(PP_Instance instance, struct PP_Var session_id); + void (*CancelKeyRequest)(PP_Instance instance, uint32_t reference_id); /** * Decrypts the block and returns the unencrypted block via * <code>DeliverBlock()</code> on the @@ -235,7 +233,7 @@ struct PPP_ContentDecryptor_Private_0_7 { const struct PP_EncryptedBlockInfo* encrypted_block_info); }; -typedef struct PPP_ContentDecryptor_Private_0_7 PPP_ContentDecryptor_Private; +typedef struct PPP_ContentDecryptor_Private_0_8 PPP_ContentDecryptor_Private; /** * @} */ diff --git a/ppapi/cpp/dev/graphics_2d_dev.cc b/ppapi/cpp/dev/graphics_2d_dev.cc index e141bb6b70..3fd000cc2d 100644 --- a/ppapi/cpp/dev/graphics_2d_dev.cc +++ b/ppapi/cpp/dev/graphics_2d_dev.cc @@ -4,35 +4,61 @@ #include "ppapi/cpp/dev/graphics_2d_dev.h" -#include "ppapi/c/dev/ppb_graphics_2d_dev.h" #include "ppapi/cpp/module_impl.h" +#include "ppapi/cpp/point.h" namespace pp { namespace { -template <> const char* interface_name<PPB_Graphics2D_Dev>() { - return PPB_GRAPHICS2D_DEV_INTERFACE; +template <> const char* interface_name<PPB_Graphics2D_Dev_0_1>() { + return PPB_GRAPHICS2D_DEV_INTERFACE_0_1; +} + +template <> const char* interface_name<PPB_Graphics2D_Dev_0_2>() { + return PPB_GRAPHICS2D_DEV_INTERFACE_0_2; } } // namespace // static bool Graphics2D_Dev::SupportsScale() { - return has_interface<PPB_Graphics2D_Dev>(); + return has_interface<PPB_Graphics2D_Dev_0_1>() || + has_interface<PPB_Graphics2D_Dev_0_2>(); } bool Graphics2D_Dev::SetScale(float scale) { - if (!has_interface<PPB_Graphics2D_Dev>()) - return false; - return PP_ToBool(get_interface<PPB_Graphics2D_Dev>()->SetScale(pp_resource(), - scale)); + if (has_interface<PPB_Graphics2D_Dev_0_2>()) { + return PP_ToBool(get_interface<PPB_Graphics2D_Dev_0_2>()->SetScale( + pp_resource(), scale)); + } + if (has_interface<PPB_Graphics2D_Dev_0_1>()) { + return PP_ToBool(get_interface<PPB_Graphics2D_Dev_0_1>()->SetScale( + pp_resource(), scale)); + } + return false; } float Graphics2D_Dev::GetScale() { - if (!has_interface<PPB_Graphics2D_Dev>()) - return 1.0f; - return get_interface<PPB_Graphics2D_Dev>()->GetScale(pp_resource()); + if (has_interface<PPB_Graphics2D_Dev_0_2>()) + return get_interface<PPB_Graphics2D_Dev_0_2>()->GetScale(pp_resource()); + if (has_interface<PPB_Graphics2D_Dev_0_1>()) + return get_interface<PPB_Graphics2D_Dev_0_1>()->GetScale(pp_resource()); + return 1.0f; +} + +void Graphics2D_Dev::SetOffset(const pp::Point& offset) { + if (!has_interface<PPB_Graphics2D_Dev_0_2>()) + return; + get_interface<PPB_Graphics2D_Dev_0_2>()->SetOffset(pp_resource(), + &offset.pp_point()); +} + +void Graphics2D_Dev::SetResizeMode(PP_Graphics2D_Dev_ResizeMode resize_mode) { + if (!has_interface<PPB_Graphics2D_Dev_0_2>()) + return; + get_interface<PPB_Graphics2D_Dev_0_2>()->SetResizeMode(pp_resource(), + resize_mode); } } // namespace pp diff --git a/ppapi/cpp/dev/graphics_2d_dev.h b/ppapi/cpp/dev/graphics_2d_dev.h index 3dc8c7190a..52c2e666d9 100644 --- a/ppapi/cpp/dev/graphics_2d_dev.h +++ b/ppapi/cpp/dev/graphics_2d_dev.h @@ -7,8 +7,12 @@ #include "ppapi/cpp/graphics_2d.h" +#include "ppapi/c/dev/ppb_graphics_2d_dev.h" + namespace pp { +class Point; + // Graphics2DDev is a version of Graphics2D that exposes under-development APIs // for HiDPI class Graphics2D_Dev : public Graphics2D { @@ -48,6 +52,23 @@ class Graphics2D_Dev : public Graphics2D { /// @return Returns the scale factor for the graphics context. If the resource /// is invalid, 0.0 will be returned. float GetScale(); + + /// Set the offset into the plugin element at which the graphics context is + /// painted. This allows a portion of the plugin element to be painted to. + /// The new offset will only be applied after Flush() has been called. + /// + /// @param[in] resource A <code>Graphics2D</code> context resource. + /// @param[in] offset The offset at which the context should be painted. + void SetOffset(const pp::Point& offset); + + /// Sets the resize mode for the graphics context. When a plugin element is + /// resized in the DOM, it takes time for the plugin to update the graphics + /// context in the renderer. These options affect how the existing context is + /// displayed until the backing store is updated by the plugin. + /// + ///@param[in] resource A <code>Graphics2D</code> context resource. + ///@param[in] resize_mode The resize mode to change this context to. + void SetResizeMode(PP_Graphics2D_Dev_ResizeMode resize_mode); }; } // namespace pp diff --git a/ppapi/cpp/dev/url_util_dev.cc b/ppapi/cpp/dev/url_util_dev.cc index 5029a4576c..b0eece6e21 100644 --- a/ppapi/cpp/dev/url_util_dev.cc +++ b/ppapi/cpp/dev/url_util_dev.cc @@ -5,88 +5,191 @@ #include "ppapi/cpp/dev/url_util_dev.h" #include "ppapi/cpp/instance_handle.h" -#include "ppapi/cpp/module.h" +#include "ppapi/cpp/module_impl.h" namespace pp { +namespace { + +template <> const char* interface_name<PPB_URLUtil_Dev_0_6>() { + return PPB_URLUTIL_DEV_INTERFACE_0_6; +} + +template <> const char* interface_name<PPB_URLUtil_Dev_0_7>() { + return PPB_URLUTIL_DEV_INTERFACE_0_7; +} + +} // namespace + // static const URLUtil_Dev* URLUtil_Dev::Get() { - static bool tried_to_init = false; static URLUtil_Dev util; + static bool tried_to_init = false; + static bool interface_available = false; if (!tried_to_init) { tried_to_init = true; - util.interface_ = static_cast<const PPB_URLUtil_Dev*>( - Module::Get()->GetBrowserInterface(PPB_URLUTIL_DEV_INTERFACE)); + if (has_interface<PPB_URLUtil_Dev_0_7>() || + has_interface<PPB_URLUtil_Dev_0_6>()) + interface_available = true; } - if (!util.interface_) + if (!interface_available) return NULL; return &util; } Var URLUtil_Dev::Canonicalize(const Var& url, PP_URLComponents_Dev* components) const { - return Var(PASS_REF, interface_->Canonicalize(url.pp_var(), components)); + if (has_interface<PPB_URLUtil_Dev_0_7>()) { + return Var(PASS_REF, + get_interface<PPB_URLUtil_Dev_0_7>()->Canonicalize(url.pp_var(), + components)); + } + if (has_interface<PPB_URLUtil_Dev_0_6>()) { + return Var(PASS_REF, + get_interface<PPB_URLUtil_Dev_0_6>()->Canonicalize(url.pp_var(), + components)); + } + return Var(); } Var URLUtil_Dev::ResolveRelativeToURL(const Var& base_url, const Var& relative_string, PP_URLComponents_Dev* components) const { - return Var(PASS_REF, - interface_->ResolveRelativeToURL(base_url.pp_var(), - relative_string.pp_var(), - components)); + if (has_interface<PPB_URLUtil_Dev_0_7>()) { + return Var(PASS_REF, + get_interface<PPB_URLUtil_Dev_0_7>()->ResolveRelativeToURL( + base_url.pp_var(), + relative_string.pp_var(), + components)); + } + if (has_interface<PPB_URLUtil_Dev_0_6>()) { + return Var(PASS_REF, + get_interface<PPB_URLUtil_Dev_0_6>()->ResolveRelativeToURL( + base_url.pp_var(), + relative_string.pp_var(), + components)); + } + return Var(); } Var URLUtil_Dev::ResolveRelativeToDocument( const InstanceHandle& instance, const Var& relative_string, PP_URLComponents_Dev* components) const { - return Var(PASS_REF, - interface_->ResolveRelativeToDocument(instance.pp_instance(), - relative_string.pp_var(), - components)); + if (has_interface<PPB_URLUtil_Dev_0_7>()) { + return Var(PASS_REF, + get_interface<PPB_URLUtil_Dev_0_7>()->ResolveRelativeToDocument( + instance.pp_instance(), + relative_string.pp_var(), + components)); + } + if (has_interface<PPB_URLUtil_Dev_0_6>()) { + return Var(PASS_REF, + get_interface<PPB_URLUtil_Dev_0_6>()->ResolveRelativeToDocument( + instance.pp_instance(), + relative_string.pp_var(), + components)); + } + return Var(); } bool URLUtil_Dev::IsSameSecurityOrigin(const Var& url_a, const Var& url_b) const { - return PP_ToBool(interface_->IsSameSecurityOrigin(url_a.pp_var(), - url_b.pp_var())); + if (has_interface<PPB_URLUtil_Dev_0_7>()) { + return PP_ToBool( + get_interface<PPB_URLUtil_Dev_0_7>()->IsSameSecurityOrigin( + url_a.pp_var(), + url_b.pp_var())); + } + if (has_interface<PPB_URLUtil_Dev_0_6>()) { + return PP_ToBool( + get_interface<PPB_URLUtil_Dev_0_6>()->IsSameSecurityOrigin( + url_a.pp_var(), + url_b.pp_var())); + } + return false; } bool URLUtil_Dev::DocumentCanRequest(const InstanceHandle& instance, const Var& url) const { - return PP_ToBool(interface_->DocumentCanRequest(instance.pp_instance(), - url.pp_var())); + if (has_interface<PPB_URLUtil_Dev_0_7>()) { + return PP_ToBool( + get_interface<PPB_URLUtil_Dev_0_7>()->DocumentCanRequest( + instance.pp_instance(), + url.pp_var())); + } + if (has_interface<PPB_URLUtil_Dev_0_6>()) { + return PP_ToBool( + get_interface<PPB_URLUtil_Dev_0_6>()->DocumentCanRequest( + instance.pp_instance(), + url.pp_var())); + } + return false; } bool URLUtil_Dev::DocumentCanAccessDocument( const InstanceHandle& active, const InstanceHandle& target) const { - return PP_ToBool( - interface_->DocumentCanAccessDocument(active.pp_instance(), - target.pp_instance())); + if (has_interface<PPB_URLUtil_Dev_0_7>()) { + return PP_ToBool( + get_interface<PPB_URLUtil_Dev_0_7>()->DocumentCanAccessDocument( + active.pp_instance(), + target.pp_instance())); + } + if (has_interface<PPB_URLUtil_Dev_0_6>()) { + return PP_ToBool( + get_interface<PPB_URLUtil_Dev_0_6>()->DocumentCanAccessDocument( + active.pp_instance(), + target.pp_instance())); + } + return false; } Var URLUtil_Dev::GetDocumentURL(const InstanceHandle& instance, PP_URLComponents_Dev* components) const { - return Var(PASS_REF, - interface_->GetDocumentURL(instance.pp_instance(), components)); + if (has_interface<PPB_URLUtil_Dev_0_7>()) { + return Var(PASS_REF, + get_interface<PPB_URLUtil_Dev_0_7>()->GetDocumentURL( + instance.pp_instance(), + components)); + } + if (has_interface<PPB_URLUtil_Dev_0_6>()) { + return Var(PASS_REF, + get_interface<PPB_URLUtil_Dev_0_6>()->GetDocumentURL( + instance.pp_instance(), + components)); + } + return Var(); } Var URLUtil_Dev::GetPluginInstanceURL(const InstanceHandle& instance, PP_URLComponents_Dev* components) const { - return Var(PASS_REF, - interface_->GetPluginInstanceURL(instance.pp_instance(), - components)); + if (has_interface<PPB_URLUtil_Dev_0_7>()) { + return Var(PASS_REF, + get_interface<PPB_URLUtil_Dev_0_7>()->GetPluginInstanceURL( + instance.pp_instance(), + components)); + } + if (has_interface<PPB_URLUtil_Dev_0_6>()) { + return Var(PASS_REF, + get_interface<PPB_URLUtil_Dev_0_6>()->GetPluginInstanceURL( + instance.pp_instance(), + components)); + } + return Var(); } Var URLUtil_Dev::GetPluginReferrerURL(const InstanceHandle& instance, PP_URLComponents_Dev* components) const { - return Var(PASS_REF, - interface_->GetPluginReferrerURL(instance.pp_instance(), - components)); + if (has_interface<PPB_URLUtil_Dev_0_7>()) { + return Var(PASS_REF, + get_interface<PPB_URLUtil_Dev_0_7>()->GetPluginReferrerURL( + instance.pp_instance(), + components)); + } + return Var(); } } // namespace pp diff --git a/ppapi/cpp/dev/url_util_dev.h b/ppapi/cpp/dev/url_util_dev.h index 9399752514..db63e7a3a0 100644 --- a/ppapi/cpp/dev/url_util_dev.h +++ b/ppapi/cpp/dev/url_util_dev.h @@ -16,10 +16,9 @@ class InstanceHandle; class URLUtil_Dev { public: // This class is just a collection of random functions that aren't - // particularly attached to anything. So this getter returns a cached - // instance of this interface. This may return NULL if the browser doesn't - // support the URLUtil interface. Since this is a singleton, don't delete the - // pointer. + // particularly attached to anything. This may return NULL if the + // browser doesn't support the URLUtil interface. Since this is a + // singleton, don't delete the pointer. static const URLUtil_Dev* Get(); Var Canonicalize(const Var& url, @@ -45,13 +44,11 @@ class URLUtil_Dev { PP_URLComponents_Dev* components = NULL) const; private: - URLUtil_Dev() : interface_(NULL) {} + URLUtil_Dev() {} // Copy and assignment are disallowed. URLUtil_Dev(const URLUtil_Dev& other); URLUtil_Dev& operator=(const URLUtil_Dev& other); - - const PPB_URLUtil_Dev* interface_; }; } // namespace pp diff --git a/ppapi/cpp/private/content_decryptor_private.cc b/ppapi/cpp/private/content_decryptor_private.cc index 8c7dcd2850..905b115d49 100644 --- a/ppapi/cpp/private/content_decryptor_private.cc +++ b/ppapi/cpp/private/content_decryptor_private.cc @@ -24,8 +24,7 @@ static const char kPPPContentDecryptorInterface[] = PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE; void Initialize(PP_Instance instance, - PP_Var key_system_arg, - PP_Bool can_challenge_platform) { + PP_Var key_system_arg) { void* object = Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); if (!object) @@ -36,11 +35,11 @@ void Initialize(PP_Instance instance, return; static_cast<ContentDecryptor_Private*>(object)->Initialize( - key_system_var.AsString(), - PP_ToBool(can_challenge_platform)); + key_system_var.AsString()); } void GenerateKeyRequest(PP_Instance instance, + uint32_t reference_id, PP_Var type_arg, PP_Var init_data_arg) { void* object = @@ -58,12 +57,13 @@ void GenerateKeyRequest(PP_Instance instance, pp::VarArrayBuffer init_data_array_buffer(init_data_var); static_cast<ContentDecryptor_Private*>(object)->GenerateKeyRequest( + reference_id, type_var.AsString(), init_data_array_buffer); } void AddKey(PP_Instance instance, - PP_Var session_id_arg, + uint32_t reference_id, PP_Var key_arg, PP_Var init_data_arg) { void* object = @@ -71,10 +71,6 @@ void AddKey(PP_Instance instance, if (!object) return; - pp::Var session_id_var(pp::PASS_REF, session_id_arg); - if (!session_id_var.is_string()) - return; - pp::Var key_var(pp::PASS_REF, key_arg); if (!key_var.is_array_buffer()) return; @@ -85,25 +81,20 @@ void AddKey(PP_Instance instance, return; pp::VarArrayBuffer init_data(init_data_var); - static_cast<ContentDecryptor_Private*>(object)->AddKey( - session_id_var.AsString(), + reference_id, key, init_data); } -void CancelKeyRequest(PP_Instance instance, PP_Var session_id_arg) { +void CancelKeyRequest(PP_Instance instance, uint32_t reference_id) { void* object = Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); if (!object) return; - pp::Var session_id_var(pp::PASS_REF, session_id_arg); - if (!session_id_var.is_string()) - return; - static_cast<ContentDecryptor_Private*>(object)->CancelKeyRequest( - session_id_var.AsString()); + reference_id); } @@ -226,51 +217,50 @@ ContentDecryptor_Private::~ContentDecryptor_Private() { this); } -void ContentDecryptor_Private::KeyAdded(const std::string& key_system, - const std::string& session_id) { +void ContentDecryptor_Private::KeyAdded(uint32_t reference_id) { if (has_interface<PPB_ContentDecryptor_Private>()) { - pp::Var key_system_var(key_system); - pp::Var session_id_var(session_id); get_interface<PPB_ContentDecryptor_Private>()->KeyAdded( associated_instance_.pp_instance(), - key_system_var.pp_var(), - session_id_var.pp_var()); + reference_id); } } -void ContentDecryptor_Private::KeyMessage(const std::string& key_system, - const std::string& session_id, +void ContentDecryptor_Private::KeyMessage(uint32_t reference_id, pp::VarArrayBuffer message, const std::string& default_url) { if (has_interface<PPB_ContentDecryptor_Private>()) { - pp::Var key_system_var(key_system); - pp::Var session_id_var(session_id); pp::Var default_url_var(default_url); get_interface<PPB_ContentDecryptor_Private>()->KeyMessage( associated_instance_.pp_instance(), - key_system_var.pp_var(), - session_id_var.pp_var(), + reference_id, message.pp_var(), default_url_var.pp_var()); } } -void ContentDecryptor_Private::KeyError(const std::string& key_system, - const std::string& session_id, +void ContentDecryptor_Private::KeyError(uint32_t reference_id, int32_t media_error, int32_t system_code) { if (has_interface<PPB_ContentDecryptor_Private>()) { - pp::Var key_system_var(key_system); - pp::Var session_id_var(session_id); get_interface<PPB_ContentDecryptor_Private>()->KeyError( associated_instance_.pp_instance(), - key_system_var.pp_var(), - session_id_var.pp_var(), + reference_id, media_error, system_code); } } +void ContentDecryptor_Private::SetSessionId(uint32_t reference_id, + const std::string& session_id) { + if (has_interface<PPB_ContentDecryptor_Private>()) { + pp::Var session_id_var(session_id); + get_interface<PPB_ContentDecryptor_Private>()->SetSessionId( + associated_instance_.pp_instance(), + reference_id, + session_id_var.pp_var()); + } +} + void ContentDecryptor_Private::DeliverBlock( pp::Buffer_Dev decrypted_block, const PP_DecryptedBlockInfo& decrypted_block_info) { diff --git a/ppapi/cpp/private/content_decryptor_private.h b/ppapi/cpp/private/content_decryptor_private.h index ff985691e1..e8a93dc38e 100644 --- a/ppapi/cpp/private/content_decryptor_private.h +++ b/ppapi/cpp/private/content_decryptor_private.h @@ -31,14 +31,14 @@ class ContentDecryptor_Private { // TODO(tomfinegan): This could be optimized to pass pp::Var instead of // strings. The change would allow the CDM wrapper to reuse vars when // replying to the browser. - virtual void Initialize(const std::string& key_system, - bool can_challenge_platform) = 0; - virtual void GenerateKeyRequest(const std::string& type, + 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(const std::string& session_id, + virtual void AddKey(uint32_t reference_id, pp::VarArrayBuffer key, pp::VarArrayBuffer init_data) = 0; - virtual void CancelKeyRequest(const std::string& session_id) = 0; + virtual void CancelKeyRequest(uint32_t reference_id) = 0; virtual void Decrypt(pp::Buffer_Dev encrypted_buffer, const PP_EncryptedBlockInfo& encrypted_block_info) = 0; virtual void InitializeAudioDecoder( @@ -59,16 +59,14 @@ class ContentDecryptor_Private { // PPB_ContentDecryptor_Private methods for passing data from the decryptor // to the browser. - void KeyAdded(const std::string& key_system, - const std::string& session_id); - void KeyMessage(const std::string& key_system, - const std::string& session_id, + void KeyAdded(uint32_t reference_id); + void KeyMessage(uint32_t reference_id, pp::VarArrayBuffer message, const std::string& default_url); - void KeyError(const std::string& key_system, - const std::string& session_id, + 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); // 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/cpp/private/flash_drm.cc b/ppapi/cpp/private/flash_drm.cc index f576fb26d0..c425c9f5b4 100644 --- a/ppapi/cpp/private/flash_drm.cc +++ b/ppapi/cpp/private/flash_drm.cc @@ -17,6 +17,10 @@ template <> const char* interface_name<PPB_Flash_DRM_1_0>() { return PPB_FLASH_DRM_INTERFACE_1_0; } +template <> const char* interface_name<PPB_Flash_DRM_1_1>() { + return PPB_FLASH_DRM_INTERFACE_1_1; +} + template <> const char* interface_name<PPB_Flash_DeviceID_1_0>() { return PPB_FLASH_DEVICEID_INTERFACE_1_0; } @@ -29,7 +33,10 @@ DRM::DRM() { } DRM::DRM(const InstanceHandle& instance) : Resource() { - if (has_interface<PPB_Flash_DRM_1_0>()) { + if (has_interface<PPB_Flash_DRM_1_1>()) { + PassRefFromConstructor(get_interface<PPB_Flash_DRM_1_1>()->Create( + instance.pp_instance())); + } else if (has_interface<PPB_Flash_DRM_1_0>()) { PassRefFromConstructor(get_interface<PPB_Flash_DRM_1_0>()->Create( instance.pp_instance())); } else if (has_interface<PPB_Flash_DeviceID_1_0>()) { @@ -39,6 +46,12 @@ DRM::DRM(const InstanceHandle& instance) : Resource() { } int32_t DRM::GetDeviceID(const CompletionCallbackWithOutput<Var>& callback) { + if (has_interface<PPB_Flash_DRM_1_1>()) { + return get_interface<PPB_Flash_DRM_1_1>()->GetDeviceID( + pp_resource(), + callback.output(), + callback.pp_completion_callback()); + } if (has_interface<PPB_Flash_DRM_1_0>()) { return get_interface<PPB_Flash_DRM_1_0>()->GetDeviceID( pp_resource(), @@ -55,6 +68,11 @@ int32_t DRM::GetDeviceID(const CompletionCallbackWithOutput<Var>& callback) { } bool DRM::GetHmonitor(int64_t* hmonitor) { + if (has_interface<PPB_Flash_DRM_1_1>()) { + return PP_ToBool(get_interface<PPB_Flash_DRM_1_1>()->GetHmonitor( + pp_resource(), + hmonitor)); + } if (has_interface<PPB_Flash_DRM_1_0>()) { return PP_ToBool(get_interface<PPB_Flash_DRM_1_0>()->GetHmonitor( pp_resource(), @@ -65,6 +83,12 @@ bool DRM::GetHmonitor(int64_t* hmonitor) { int32_t DRM::GetVoucherFile( const CompletionCallbackWithOutput<FileRef>& callback) { + if (has_interface<PPB_Flash_DRM_1_1>()) { + return get_interface<PPB_Flash_DRM_1_1>()->GetVoucherFile( + pp_resource(), + callback.output(), + callback.pp_completion_callback()); + } if (has_interface<PPB_Flash_DRM_1_0>()) { return get_interface<PPB_Flash_DRM_1_0>()->GetVoucherFile( pp_resource(), @@ -74,5 +98,16 @@ int32_t DRM::GetVoucherFile( return PP_ERROR_NOINTERFACE; } +int32_t DRM::MonitorIsExternal( + const CompletionCallbackWithOutput<PP_Bool>& callback) { + if (has_interface<PPB_Flash_DRM_1_1>()) { + return get_interface<PPB_Flash_DRM_1_1>()->MonitorIsExternal( + pp_resource(), + callback.output(), + callback.pp_completion_callback()); + } + return PP_ERROR_NOINTERFACE; +} + } // namespace flash } // namespace pp diff --git a/ppapi/cpp/private/flash_drm.h b/ppapi/cpp/private/flash_drm.h index 45ecde8b9a..2edddac1d5 100644 --- a/ppapi/cpp/private/flash_drm.h +++ b/ppapi/cpp/private/flash_drm.h @@ -27,6 +27,10 @@ class DRM : public Resource { bool GetHmonitor(int64_t* hmonitor); // Returns the voucher file as a FileRef or an invalid resource on failure. int32_t GetVoucherFile(const CompletionCallbackWithOutput<FileRef>& callback); + // On success, returns a value indicating if the monitor associated with the + // current plugin instance is external. + int32_t MonitorIsExternal( + const CompletionCallbackWithOutput<PP_Bool>& callback); }; } // namespace flash diff --git a/ppapi/cpp/private/isolated_file_system_private.cc b/ppapi/cpp/private/isolated_file_system_private.cc new file mode 100644 index 0000000000..f0a20ca60f --- /dev/null +++ b/ppapi/cpp/private/isolated_file_system_private.cc @@ -0,0 +1,40 @@ +// 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 "ppapi/cpp/private/isolated_file_system_private.h" + +#include "ppapi/cpp/module_impl.h" + +namespace pp { + +namespace { + +template <> const char* interface_name<PPB_IsolatedFileSystem_Private_0_2>() { + return PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE_0_2; +} + +} // namespace + +IsolatedFileSystemPrivate::IsolatedFileSystemPrivate() + : instance_(0), type_(PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID) { +} + +IsolatedFileSystemPrivate::IsolatedFileSystemPrivate( + const InstanceHandle& instance, + PP_IsolatedFileSystemType_Private type) + : instance_(instance.pp_instance()), type_(type) { +} + +IsolatedFileSystemPrivate::~IsolatedFileSystemPrivate() { +} + +int32_t IsolatedFileSystemPrivate::Open( + const CompletionCallbackWithOutput<pp::FileSystem>& cc) { + if (!has_interface<PPB_IsolatedFileSystem_Private_0_2>()) + return cc.MayForce(PP_ERROR_NOINTERFACE); + return get_interface<PPB_IsolatedFileSystem_Private_0_2>()-> + Open(instance_, type_, cc.output(), cc.pp_completion_callback()); +} + +} // namespace pp diff --git a/ppapi/cpp/private/isolated_file_system_private.h b/ppapi/cpp/private/isolated_file_system_private.h new file mode 100644 index 0000000000..88213d6cf1 --- /dev/null +++ b/ppapi/cpp/private/isolated_file_system_private.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. + +#ifndef PPAPI_CPP_PRIVATE_ISOLATED_FILE_SYSTEM_PRIVATE_H_ +#define PPAPI_CPP_PRIVATE_ISOLATED_FILE_SYSTEM_PRIVATE_H_ + +#include "ppapi/c/pp_instance.h" +#include "ppapi/c/private/ppb_isolated_file_system_private.h" +#include "ppapi/cpp/completion_callback.h" +#include "ppapi/cpp/file_system.h" +#include "ppapi/cpp/instance_handle.h" + +namespace pp { + +class CompletionCallback; + +class IsolatedFileSystemPrivate { + public: + IsolatedFileSystemPrivate(); + IsolatedFileSystemPrivate(const InstanceHandle& instance, + PP_IsolatedFileSystemType_Private type); + virtual ~IsolatedFileSystemPrivate(); + + int32_t Open(const CompletionCallbackWithOutput<pp::FileSystem>& cc); + + private: + PP_Instance instance_; + PP_IsolatedFileSystemType_Private type_; +}; + +} // namespace pp + +#endif // PPAPI_CPP_PRIVATE_ISOLATED_FILE_SYSTEM_PRIVATE_H_ diff --git a/ppapi/cpp/private/pdf.cc b/ppapi/cpp/private/pdf.cc index 9d6bd89825..77fb0b2943 100644 --- a/ppapi/cpp/private/pdf.cc +++ b/ppapi/cpp/private/pdf.cc @@ -184,6 +184,7 @@ ImageData PDF::GetResourceImageForScale(const InstanceHandle& instance, return ImageData(); } +// static Var PDF::ModalPromptForPassword(const InstanceHandle& instance, Var message) { if (has_interface<PPB_PDF>()) { @@ -194,4 +195,14 @@ Var PDF::ModalPromptForPassword(const InstanceHandle& instance, } return Var(); } + +// static +bool PDF::IsOutOfProcess(const InstanceHandle& instance) { + if (has_interface<PPB_PDF>()) { + return PP_ToBool(get_interface<PPB_PDF>()->IsOutOfProcess( + instance.pp_instance())); + } + return false; +} + } // namespace pp diff --git a/ppapi/cpp/private/pdf.h b/ppapi/cpp/private/pdf.h index 1e89dd0c7e..4634430b1d 100644 --- a/ppapi/cpp/private/pdf.h +++ b/ppapi/cpp/private/pdf.h @@ -64,6 +64,7 @@ class PDF { float scale); static Var ModalPromptForPassword(const InstanceHandle& instance, Var message); + static bool IsOutOfProcess(const InstanceHandle& instance); }; } // namespace pp diff --git a/ppapi/examples/crxfs/crxfs.cc b/ppapi/examples/crxfs/crxfs.cc index 5e4b422cd3..86a212b982 100644 --- a/ppapi/examples/crxfs/crxfs.cc +++ b/ppapi/examples/crxfs/crxfs.cc @@ -9,7 +9,7 @@ #include "ppapi/cpp/file_ref.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" -#include "ppapi/cpp/private/ext_crx_file_system_private.h" +#include "ppapi/cpp/private/isolated_file_system_private.h" #include "ppapi/utility/completion_callback_factory.h" // When compiling natively on Windows, PostMessage can be #define-d to @@ -48,7 +48,7 @@ class MyInstance : public pp::Instance { pp::CompletionCallbackFactory<MyInstance> factory_; pp::InstanceHandle handle_; - pp::ExtCrxFileSystemPrivate crxfs_; + pp::IsolatedFileSystemPrivate crxfs_; pp::FileRef file_ref_; pp::FileIO file_io_; std::string filename_; @@ -70,7 +70,8 @@ void MyInstance::OpenCrxFsAndReadFile(const std::string& filename) { pp::CompletionCallbackWithOutput<pp::FileSystem> callback = factory_.NewCallbackWithOutput(&MyInstance::CrxFileSystemCallback); - crxfs_ = pp::ExtCrxFileSystemPrivate(this); + crxfs_ = pp::IsolatedFileSystemPrivate( + this, PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX); int32_t rv = crxfs_.Open(callback); if (rv != PP_OK_COMPLETIONPENDING) ReportResponse("ExtCrxFileSystemPrivate::Open", rv); diff --git a/ppapi/examples/url_loader/url_loader.html b/ppapi/examples/url_loader/url_loader.html index 39f4494973..808b369479 100644 --- a/ppapi/examples/url_loader/url_loader.html +++ b/ppapi/examples/url_loader/url_loader.html @@ -39,7 +39,7 @@ <script> function HandleMessage(message_event) { - document.getElementById("log_result").innerHTML = message_event.data; + document.getElementById("log_result").textContent = message_event.data; } // Attach a listener for the message event. This must happen after the plugin diff --git a/ppapi/generators/idl_ast.py b/ppapi/generators/idl_ast.py index 3c2b32dccd..ce5dc38b39 100644 --- a/ppapi/generators/idl_ast.py +++ b/ppapi/generators/idl_ast.py @@ -27,16 +27,6 @@ BuiltIn = set(['int8_t', 'int16_t', 'int32_t', 'int64_t', 'uint8_t', # The mapping is applied to the File nodes within the AST. # class IDLLabelResolver(IDLVisitor): - def Arrive(self, node, ignore): - # If we are entering a File, clear the visitor local mapping - if node.IsA('File'): - self.release_map = None - self.filenode = node - # For any non AST node, the filenode is the last known file - if not node.IsA('AST'): - node.filenode = self.filenode - return ignore - def Depart(self, node, ignore, childdata): # Build list of Release=Version if node.IsA('LabelItem'): @@ -46,8 +36,7 @@ class IDLLabelResolver(IDLVisitor): # name of the label matches the generation label. if node.IsA('Label') and node.GetName() == GetOption('label'): try: - self.release_map = IDLReleaseMap(childdata) - node.parent.release_map = self.release_map + node.parent.release_map = IDLReleaseMap(childdata) except Exception as err: node.Error('Unable to build release map: %s' % str(err)) diff --git a/ppapi/generators/idl_parser.py b/ppapi/generators/idl_parser.py index 40751e3f26..6f0ea12436 100755 --- a/ppapi/generators/idl_parser.py +++ b/ppapi/generators/idl_parser.py @@ -35,7 +35,6 @@ from idl_lexer import IDLLexer from idl_node import IDLAttribute, IDLFile, IDLNode from idl_option import GetOption, Option, ParseOptions from idl_lint import Lint -from idl_visitor import IDLVisitor from ply import lex from ply import yacc @@ -732,10 +731,10 @@ class IDLParser(IDLLexer): if self.parse_debug: DumpReduction('attribute', p) def p_member_function(self, p): - """member_function : modifiers static SYMBOL SYMBOL param_list""" + """member_function : modifiers static SYMBOL arrays SYMBOL param_list""" typeref = self.BuildAttribute('TYPEREF', p[3]) - children = ListFromConcat(p[1], p[2], typeref, p[5]) - p[0] = self.BuildNamed('Member', p, 4, children) + children = ListFromConcat(p[1], p[2], typeref, p[4], p[6]) + p[0] = self.BuildNamed('Member', p, 5, children) if self.parse_debug: DumpReduction('function', p) def p_static(self, p): diff --git a/ppapi/generators/idl_visitor.py b/ppapi/generators/idl_visitor.py index 1ea1c9cf25..7945f613dc 100644 --- a/ppapi/generators/idl_visitor.py +++ b/ppapi/generators/idl_visitor.py @@ -19,30 +19,22 @@ class IDLVisitor(object): def __init__(self): - self.depth = 0 + pass # Return TRUE if the node should be visited def VisitFilter(self, node, data): return True - # Return TRUE if data should be added to the childdata list - def AgrigateFilter(self, data): - return data is not None - def Visit(self, node, data): - self.depth += 1 if not self.VisitFilter(node, data): return None childdata = [] newdata = self.Arrive(node, data) for child in node.GetChildren(): ret = self.Visit(child, newdata) - if self.AgrigateFilter(ret): + if ret is not None: childdata.append(ret) - out = self.Depart(node, newdata, childdata) - - self.depth -= 1 - return out + return self.Depart(node, newdata, childdata) def Arrive(self, node, data): __pychecker__ = 'unusednames=node' @@ -51,31 +43,3 @@ class IDLVisitor(object): def Depart(self, node, data, childdata): __pychecker__ = 'unusednames=node,childdata' return data - - -# -# IDLVersionVisitor -# -# The IDLVersionVisitor will only visit nodes with intervals that include the -# version. It will also optionally filter based on a class list -# -class IDLVersionVisitor(object): - def __init__(self, version, classList): - self.version = version - self.classes = classes - - def Filter(self, node, data): - if self.classList and node.cls not in self.classList: return False - if not node.IsVersion(self.version): return False - return True - -class IDLRangeVisitor(object): - def __init__(self, vmin, vmax, classList): - self.vmin = vmin - self.vmax = vmax - self.classList = classList - - def Filter(self, node, data): - if self.classList and node.cls not in self.classList: return False - if not node.IsVersion(self.version): return False - return True diff --git a/ppapi/generators/test_parser/interface.idl b/ppapi/generators/test_parser/interface.idl index 6b52402db8..712027a88d 100644 --- a/ppapi/generators/test_parser/interface.idl +++ b/ppapi/generators/test_parser/interface.idl @@ -27,6 +27,9 @@ interface Interface1 { [out] PP_Size size, /* OK Param(is_always_opaque) */ [out] PP_Bool is_always_opaque); + + /* OK Member(ReturnArray) */ + PP_Resource[] ReturnArray(); }; diff --git a/ppapi/host/resource_message_filter.cc b/ppapi/host/resource_message_filter.cc index ff56cac8c4..1757ad50bb 100644 --- a/ppapi/host/resource_message_filter.cc +++ b/ppapi/host/resource_message_filter.cc @@ -16,14 +16,35 @@ namespace ppapi { namespace host { +namespace internal { + +// static +void ResourceMessageFilterDeleteTraits::Destruct( + const ResourceMessageFilter* filter) { + if (!filter->deletion_message_loop_proxy_->BelongsToCurrentThread()) { + // During shutdown the object may not be deleted, but it should be okay to + // leak in that case. + filter->deletion_message_loop_proxy_->DeleteSoon(FROM_HERE, filter); + } else { + delete filter; + } +} + +} // namespace internal + ResourceMessageFilter::ResourceMessageFilter() - : reply_thread_message_loop_proxy_( + : deletion_message_loop_proxy_( base::MessageLoop::current()->message_loop_proxy()), - resource_host_(NULL) {} + reply_thread_message_loop_proxy_( + base::MessageLoop::current()->message_loop_proxy()), + resource_host_(NULL) { +} ResourceMessageFilter::ResourceMessageFilter( scoped_refptr<base::MessageLoopProxy> reply_thread_message_loop_proxy) - : reply_thread_message_loop_proxy_(reply_thread_message_loop_proxy), + : deletion_message_loop_proxy_( + base::MessageLoop::current()->message_loop_proxy()), + reply_thread_message_loop_proxy_(reply_thread_message_loop_proxy), resource_host_(NULL) { } diff --git a/ppapi/host/resource_message_filter.h b/ppapi/host/resource_message_filter.h index ef00cf7ae2..b72a7df7db 100644 --- a/ppapi/host/resource_message_filter.h +++ b/ppapi/host/resource_message_filter.h @@ -24,6 +24,15 @@ namespace ppapi { namespace host { class ResourceHost; +class ResourceMessageFilter; + +namespace internal { + +struct PPAPI_HOST_EXPORT ResourceMessageFilterDeleteTraits { + static void Destruct(const ResourceMessageFilter* filter); +}; + +} // namespace internal // This is the base class of resource message filters that can handle resource // messages on another thread. ResourceHosts can handle most messages @@ -65,13 +74,15 @@ class ResourceHost; // AddFilter(make_scoped_refptr(new MyMessageFilter)); class PPAPI_HOST_EXPORT ResourceMessageFilter : public ResourceMessageHandler, - public base::RefCountedThreadSafe<ResourceMessageFilter> { + public base::RefCountedThreadSafe< + ResourceMessageFilter, internal::ResourceMessageFilterDeleteTraits> { public: // This object must be constructed on the same thread that a reply message // should be sent, i.e. the IO thread when constructed in the browser process // or the main thread when constructed in the renderer process. Since // ResourceMessageFilters are usually constructed in the constructor of the // owning ResourceHost, this will almost always be the case anyway. + // The object will be deleted on the creation thread. ResourceMessageFilter(); // Test constructor. Allows you to specify the message loop which will be used // to dispatch replies on. @@ -93,7 +104,6 @@ class PPAPI_HOST_EXPORT ResourceMessageFilter const IPC::Message& msg) OVERRIDE; protected: - friend class base::RefCountedThreadSafe<ResourceMessageFilter>; virtual ~ResourceMessageFilter(); // If you want the message to be handled on another thread, return a non-null @@ -102,10 +112,17 @@ class PPAPI_HOST_EXPORT ResourceMessageFilter const IPC::Message& message); private: + friend class base::DeleteHelper<ResourceMessageFilter>; + friend class base::RefCountedThreadSafe< + ResourceMessageFilter, internal::ResourceMessageFilterDeleteTraits>; + friend struct internal::ResourceMessageFilterDeleteTraits; + // This method is posted to the target thread and runs the message handler. void DispatchMessage(const IPC::Message& msg, HostMessageContext context); + scoped_refptr<base::MessageLoopProxy> deletion_message_loop_proxy_; + // Message loop to send resource message replies on. This will be the message // loop proxy of the IO thread for the browser process or the main thread for // the renderer process. diff --git a/ppapi/host/resource_message_filter_unittest.cc b/ppapi/host/resource_message_filter_unittest.cc index 78fc23cf6b..e26d164c2f 100644 --- a/ppapi/host/resource_message_filter_unittest.cc +++ b/ppapi/host/resource_message_filter_unittest.cc @@ -2,8 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/bind.h" +#include "base/bind_helpers.h" #include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" +#include "base/run_loop.h" #include "base/synchronization/waitable_event.h" #include "base/threading/thread.h" #include "ipc/ipc_message.h" @@ -15,9 +18,6 @@ namespace ppapi { namespace host { - -typedef testing::Test ResourceMessageFilterTest; - namespace { base::WaitableEvent g_handler_completion(true, false); @@ -141,61 +141,83 @@ class MyResourceFilter : public ResourceMessageFilter { } // namespace +class ResourceMessageFilterTest : public testing::Test { + public: + void TestHandleMessageImpl() { + base::Thread io_thread("test_io_thread"); + ASSERT_TRUE(io_thread.Start()); + + base::Thread bg_thread1("test_background_thread1"); + ASSERT_TRUE(bg_thread1.Start()); + scoped_refptr<MyResourceFilter> filter1 = + new MyResourceFilter(io_thread, bg_thread1, MSG1_TYPE, REPLY_MSG1_TYPE); + + base::Thread bg_thread2("test_background_thread2"); + ASSERT_TRUE(bg_thread2.Start()); + scoped_refptr<MyResourceFilter> filter2 = + new MyResourceFilter(io_thread, bg_thread2, MSG2_TYPE, REPLY_MSG2_TYPE); + + PP_Instance instance = 12345; + PP_Resource resource = 67890; + MyResourceHost host(NULL, instance, resource, MSG3_TYPE, REPLY_MSG3_TYPE); + host.AddMessageFilter(filter1); + host.AddMessageFilter(filter2); + + proxy::ResourceMessageCallParams params(resource, 1); + params.set_has_callback(); + HostMessageContext context(params); + IPC::Message message1(0, MSG1_TYPE, IPC::Message::PRIORITY_NORMAL); + IPC::Message message2(0, MSG2_TYPE, IPC::Message::PRIORITY_NORMAL); + IPC::Message message3(0, MSG3_TYPE, IPC::Message::PRIORITY_NORMAL); + + // Message 1 handled by the first filter. + host.HandleMessage(message1, &context); + g_handler_completion.Wait(); + EXPECT_EQ(filter1->last_handled_msg().type(), message1.type()); + EXPECT_EQ(filter1->last_message_loop(), bg_thread1.message_loop()); + EXPECT_EQ(host.last_reply_msg().type(), + static_cast<uint32>(REPLY_MSG1_TYPE)); + EXPECT_EQ(host.last_reply_message_loop(), io_thread.message_loop()); + g_handler_completion.Reset(); + + // Message 2 handled by the second filter. + host.HandleMessage(message2, &context); + g_handler_completion.Wait(); + EXPECT_EQ(filter2->last_handled_msg().type(), message2.type()); + EXPECT_EQ(filter2->last_message_loop(), bg_thread2.message_loop()); + EXPECT_EQ(host.last_reply_msg().type(), + static_cast<uint32>(REPLY_MSG2_TYPE)); + EXPECT_EQ(host.last_reply_message_loop(), io_thread.message_loop()); + g_handler_completion.Reset(); + + // Message 3 handled by the resource host. + host.HandleMessage(message3, &context); + EXPECT_EQ(host.last_handled_msg().type(), message3.type()); + EXPECT_EQ(host.last_reply_msg().type(), + static_cast<uint32>(REPLY_MSG3_TYPE)); + + io_thread.Stop(); + bg_thread1.Stop(); + bg_thread2.Stop(); + } +}; + // Test that messages are filtered correctly and handlers are run on the correct // threads. TEST_F(ResourceMessageFilterTest, TestHandleMessage) { - base::Thread io_thread("test_io_thread"); - ASSERT_TRUE(io_thread.Start()); - - base::Thread bg_thread1("test_background_thread1"); - ASSERT_TRUE(bg_thread1.Start()); - scoped_refptr<MyResourceFilter> filter1 = - new MyResourceFilter(io_thread, bg_thread1, MSG1_TYPE, REPLY_MSG1_TYPE); - - base::Thread bg_thread2("test_background_thread2"); - ASSERT_TRUE(bg_thread2.Start()); - scoped_refptr<MyResourceFilter> filter2 = - new MyResourceFilter(io_thread, bg_thread2, MSG2_TYPE, REPLY_MSG2_TYPE); - - PP_Instance instance = 12345; - PP_Resource resource = 67890; - MyResourceHost host(NULL, instance, resource, MSG3_TYPE, REPLY_MSG3_TYPE); - host.AddMessageFilter(filter1); - host.AddMessageFilter(filter2); - - proxy::ResourceMessageCallParams params(resource, 1); - params.set_has_callback(); - HostMessageContext context(params); - IPC::Message message1(0, MSG1_TYPE, IPC::Message::PRIORITY_NORMAL); - IPC::Message message2(0, MSG2_TYPE, IPC::Message::PRIORITY_NORMAL); - IPC::Message message3(0, MSG3_TYPE, IPC::Message::PRIORITY_NORMAL); - - // Message 1 handled by the first filter. - host.HandleMessage(message1, &context); - g_handler_completion.Wait(); - EXPECT_EQ(filter1->last_handled_msg().type(), message1.type()); - EXPECT_EQ(filter1->last_message_loop(), bg_thread1.message_loop()); - EXPECT_EQ(host.last_reply_msg().type(), static_cast<uint32>(REPLY_MSG1_TYPE)); - EXPECT_EQ(host.last_reply_message_loop(), io_thread.message_loop()); - g_handler_completion.Reset(); - - // Message 2 handled by the second filter. - host.HandleMessage(message2, &context); - g_handler_completion.Wait(); - EXPECT_EQ(filter2->last_handled_msg().type(), message2.type()); - EXPECT_EQ(filter2->last_message_loop(), bg_thread2.message_loop()); - EXPECT_EQ(host.last_reply_msg().type(), static_cast<uint32>(REPLY_MSG2_TYPE)); - EXPECT_EQ(host.last_reply_message_loop(), io_thread.message_loop()); - g_handler_completion.Reset(); - - // Message 3 handled by the resource host. - host.HandleMessage(message3, &context); - EXPECT_EQ(host.last_handled_msg().type(), message3.type()); - EXPECT_EQ(host.last_reply_msg().type(), static_cast<uint32>(REPLY_MSG3_TYPE)); - - io_thread.Stop(); - bg_thread1.Stop(); - bg_thread2.Stop(); + // ResourceMessageFilter instances need to be created on a thread with message + // loop. Therefore, we create a message loop and run the testing logic as a + // task on it. + base::MessageLoop main_message_loop; + + // It should be safe to use base::Unretained() because the object won't be + // destroyed before the task is run. + main_message_loop.PostTask( + FROM_HERE, + base::Bind(&ResourceMessageFilterTest::TestHandleMessageImpl, + base::Unretained(this))); + + base::RunLoop().RunUntilIdle(); } } // namespace proxy diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc index 5a783af4af..2bf3021efa 100644 --- a/ppapi/native_client/src/trusted/plugin/plugin.cc +++ b/ppapi/native_client/src/trusted/plugin/plugin.cc @@ -246,49 +246,6 @@ void HistogramHTTPStatusCode(const std::string& name, int status) { } // namespace -void Plugin::AddPropertyGet(const nacl::string& prop_name, - Plugin::PropertyGetter getter) { - PLUGIN_PRINTF(("Plugin::AddPropertyGet (prop_name='%s')\n", - prop_name.c_str())); - property_getters_[nacl::string(prop_name)] = getter; -} - -bool Plugin::HasProperty(const nacl::string& prop_name) { - PLUGIN_PRINTF(("Plugin::HasProperty (prop_name=%s)\n", - prop_name.c_str())); - return property_getters_.find(prop_name) != property_getters_.end(); -} - -bool Plugin::GetProperty(const nacl::string& prop_name, - NaClSrpcArg* prop_value) { - PLUGIN_PRINTF(("Plugin::GetProperty (prop_name=%s)\n", prop_name.c_str())); - - if (property_getters_.find(prop_name) == property_getters_.end()) { - return false; - } - PropertyGetter getter = property_getters_[prop_name]; - (this->*getter)(prop_value); - return true; -} - -void Plugin::GetExitStatus(NaClSrpcArg* prop_value) { - PLUGIN_PRINTF(("GetExitStatus (this=%p)\n", reinterpret_cast<void*>(this))); - prop_value->tag = NACL_SRPC_ARG_TYPE_INT; - prop_value->u.ival = exit_status(); -} - -void Plugin::GetLastError(NaClSrpcArg* prop_value) { - PLUGIN_PRINTF(("GetLastError (this=%p)\n", reinterpret_cast<void*>(this))); - prop_value->tag = NACL_SRPC_ARG_TYPE_STRING; - prop_value->arrays.str = strdup(last_error_string().c_str()); -} - -void Plugin::GetReadyStateProperty(NaClSrpcArg* prop_value) { - PLUGIN_PRINTF(("GetReadyState (this=%p)\n", reinterpret_cast<void*>(this))); - prop_value->tag = NACL_SRPC_ARG_TYPE_INT; - prop_value->u.ival = nacl_ready_state_; -} - bool Plugin::EarlyInit(int argc, const char* argn[], const char* argv[]) { PLUGIN_PRINTF(("Plugin::EarlyInit (instance=%p)\n", static_cast<void*>(this))); @@ -330,13 +287,6 @@ bool Plugin::EarlyInit(int argc, const char* argn[], const char* argv[]) { PLUGIN_PRINTF(("Plugin::Init (wrapper_factory=%p)\n", static_cast<void*>(wrapper_factory_))); - // Export a property to allow us to get the exit status of a nexe. - AddPropertyGet("exitStatus", &Plugin::GetExitStatus); - // Export a property to allow us to get the last error description. - AddPropertyGet("lastError", &Plugin::GetLastError); - // Export a property to allow us to get the ready state of a nexe during load. - AddPropertyGet("readyState", &Plugin::GetReadyStateProperty); - PLUGIN_PRINTF(("Plugin::Init (return 1)\n")); // Return success. return true; @@ -559,20 +509,9 @@ char* Plugin::LookupArgument(const char* key) { return NULL; } -// Suggested names for progress event types, per -// http://www.w3.org/TR/progress-events/ -const char* const Plugin::kProgressEventLoadStart = "loadstart"; -const char* const Plugin::kProgressEventProgress = "progress"; -const char* const Plugin::kProgressEventError = "error"; -const char* const Plugin::kProgressEventAbort = "abort"; -const char* const Plugin::kProgressEventLoad = "load"; -const char* const Plugin::kProgressEventLoadEnd = "loadend"; -// Define a NaCl specific event type for .nexe crashes. -const char* const Plugin::kProgressEventCrash = "crash"; - class ProgressEvent { public: - ProgressEvent(const char* event_type, + ProgressEvent(PP_NaClEventType event_type, const nacl::string& url, Plugin::LengthComputable length_computable, uint64_t loaded_bytes, @@ -582,7 +521,7 @@ class ProgressEvent { length_computable_(length_computable), loaded_bytes_(loaded_bytes), total_bytes_(total_bytes) { } - const char* event_type() const { return event_type_; } + PP_NaClEventType event_type() const { return event_type_; } const char* url() const { return url_.c_str(); } Plugin::LengthComputable length_computable() const { return length_computable_; @@ -591,10 +530,7 @@ class ProgressEvent { uint64_t total_bytes() const { return total_bytes_; } private: - // event_type_ is always passed from a string literal, so ownership is - // not taken. Hence it does not need to be deleted when ProgressEvent is - // destroyed. - const char* event_type_; + PP_NaClEventType event_type_; nacl::string url_; Plugin::LengthComputable length_computable_; uint64_t loaded_bytes_; @@ -706,7 +642,6 @@ Plugin::Plugin(PP_Instance pp_instance) argn_(NULL), argv_(NULL), main_subprocess_("main subprocess", NULL, NULL), - nacl_ready_state_(UNSENT), nexe_error_reported_(false), wrapper_factory_(NULL), enable_dev_interfaces_(false), @@ -715,6 +650,7 @@ Plugin::Plugin(PP_Instance pp_instance) ready_time_(0), nexe_size_(0), time_of_last_progress_event_(0), + exit_status_(-1), nacl_interface_(NULL) { PLUGIN_PRINTF(("Plugin::Plugin (this=%p, pp_instance=%" NACL_PRId32 ")\n", static_cast<void*>(this), pp_instance)); @@ -722,6 +658,11 @@ Plugin::Plugin(PP_Instance pp_instance) nexe_downloader_.Initialize(this); nacl_interface_ = GetNaClInterface(); CHECK(nacl_interface_ != NULL); + set_nacl_ready_state(UNSENT); + set_last_error_string(""); + // We call set_exit_status() here to ensure that the 'exitStatus' property is + // set. This can only be called when nacl_interface_ is not NULL. + set_exit_status(-1); } @@ -869,7 +810,7 @@ void Plugin::NexeFileDidOpen(int32_t pp_error) { static_cast<float>(nexe_downloader_.TimeSinceOpenMilliseconds())); // Inform JavaScript that we successfully downloaded the nacl module. - EnqueueProgressEvent(kProgressEventProgress, + EnqueueProgressEvent(PP_NACL_EVENT_PROGRESS, nexe_downloader_.url_to_open(), LENGTH_IS_COMPUTABLE, nexe_bytes_read, @@ -950,14 +891,13 @@ void Plugin::NexeDidCrash(int32_t pp_error) { " non-PP_OK arg -- SHOULD NOT HAPPEN\n")); } PLUGIN_PRINTF(("Plugin::NexeDidCrash: crash event!\n")); - int exit_status = main_subprocess_.service_runtime()->exit_status(); - if (-1 != exit_status) { + if (-1 != exit_status()) { // The NaCl module voluntarily exited. However, this is still a // crash from the point of view of Pepper, since PPAPI plugins are // event handlers and should never exit. PLUGIN_PRINTF((("Plugin::NexeDidCrash: nexe exited with status %d" " so this is a \"controlled crash\".\n"), - exit_status)); + exit_status())); } // If the crash occurs during load, we just want to report an error // that fits into our load progress event grammar. If the crash @@ -1046,7 +986,7 @@ void Plugin::ReportDeadNexe() { set_last_error_string(message); AddToConsole(message); - EnqueueProgressEvent(kProgressEventCrash); + EnqueueProgressEvent(PP_NACL_EVENT_CRASH); set_nexe_error_reported(true); } // else ReportLoadError() and ReportAbortError() will be used by loading code @@ -1178,9 +1118,9 @@ void Plugin::ProcessNaClManifest(const nacl::string& manifest_json) { if (manifest_->GetProgramURL(&program_url, &pnacl_options, &error_info)) { is_installed_ = GetUrlScheme(program_url) == SCHEME_CHROME_EXTENSION; - nacl_ready_state_ = LOADING; + set_nacl_ready_state(LOADING); // Inform JavaScript that we found a nexe URL to load. - EnqueueProgressEvent(kProgressEventProgress); + EnqueueProgressEvent(PP_NACL_EVENT_PROGRESS); if (pnacl_options.translate()) { pp::CompletionCallback translate_callback = callback_factory_.NewCallback(&Plugin::BitcodeDidTranslate); @@ -1237,8 +1177,8 @@ void Plugin::RequestNaClManifest(const nacl::string& url) { set_manifest_base_url(nmf_resolved_url.AsString()); set_manifest_url(url); // Inform JavaScript that a load is starting. - nacl_ready_state_ = OPENED; - EnqueueProgressEvent(kProgressEventLoadStart); + set_nacl_ready_state(OPENED); + EnqueueProgressEvent(PP_NACL_EVENT_LOADSTART); bool is_data_uri = GetUrlScheme(nmf_resolved_url.AsString()) == SCHEME_DATA; HistogramEnumerateManifestIsDataURI(static_cast<int>(is_data_uri)); if (is_data_uri) { @@ -1356,13 +1296,13 @@ void Plugin::ReportLoadSuccess(LengthComputable length_computable, uint64_t loaded_bytes, uint64_t total_bytes) { // Set the readyState attribute to indicate loaded. - nacl_ready_state_ = DONE; + set_nacl_ready_state(DONE); // Inform JavaScript that loading was successful and is complete. const nacl::string& url = nexe_downloader_.url_to_open(); EnqueueProgressEvent( - kProgressEventLoad, url, length_computable, loaded_bytes, total_bytes); + PP_NACL_EVENT_LOAD, url, length_computable, loaded_bytes, total_bytes); EnqueueProgressEvent( - kProgressEventLoadEnd, url, length_computable, loaded_bytes, total_bytes); + PP_NACL_EVENT_LOADEND, url, length_computable, loaded_bytes, total_bytes); // UMA HistogramEnumerateLoadStatus(ERROR_LOAD_SUCCESS, is_installed_); @@ -1383,7 +1323,7 @@ void Plugin::ReportLoadError(const ErrorInfo& error_info) { } // Set the readyState attribute to indicate we need to start over. - nacl_ready_state_ = DONE; + set_nacl_ready_state(DONE); set_nexe_error_reported(true); // Report an error in lastError and on the JavaScript console. nacl::string message = nacl::string("NaCl module load failed: ") + @@ -1392,8 +1332,8 @@ void Plugin::ReportLoadError(const ErrorInfo& error_info) { AddToConsole(nacl::string("NaCl module load failed: ") + error_info.console_message()); // Inform JavaScript that loading encountered an error and is complete. - EnqueueProgressEvent(kProgressEventError); - EnqueueProgressEvent(kProgressEventLoadEnd); + EnqueueProgressEvent(PP_NACL_EVENT_ERROR); + EnqueueProgressEvent(PP_NACL_EVENT_LOADEND); // UMA HistogramEnumerateLoadStatus(error_info.error_code(), is_installed_); @@ -1403,15 +1343,15 @@ void Plugin::ReportLoadError(const ErrorInfo& error_info) { void Plugin::ReportLoadAbort() { PLUGIN_PRINTF(("Plugin::ReportLoadAbort\n")); // Set the readyState attribute to indicate we need to start over. - nacl_ready_state_ = DONE; + set_nacl_ready_state(DONE); set_nexe_error_reported(true); // Report an error in lastError and on the JavaScript console. nacl::string error_string("NaCl module load failed: user aborted"); set_last_error_string(error_string); AddToConsole(error_string); // Inform JavaScript that loading was aborted and is complete. - EnqueueProgressEvent(kProgressEventAbort); - EnqueueProgressEvent(kProgressEventLoadEnd); + EnqueueProgressEvent(PP_NACL_EVENT_ABORT); + EnqueueProgressEvent(PP_NACL_EVENT_LOADEND); // UMA HistogramEnumerateLoadStatus(ERROR_LOAD_ABORTED, is_installed_); @@ -1444,7 +1384,7 @@ void Plugin::UpdateDownloadProgress( LengthComputable length_computable = (total_bytes_to_be_received >= 0) ? LENGTH_IS_COMPUTABLE : LENGTH_IS_NOT_COMPUTABLE; - plugin->EnqueueProgressEvent(kProgressEventProgress, + plugin->EnqueueProgressEvent(PP_NACL_EVENT_PROGRESS, url, length_computable, bytes_received, @@ -1471,7 +1411,7 @@ const FileDownloader* Plugin::FindFileDownloader( return file_downloader; } -void Plugin::EnqueueProgressEvent(const char* event_type) { +void Plugin::EnqueueProgressEvent(PP_NaClEventType event_type) { EnqueueProgressEvent(event_type, NACL_NO_URL, Plugin::LENGTH_IS_NOT_COMPUTABLE, @@ -1479,15 +1419,15 @@ void Plugin::EnqueueProgressEvent(const char* event_type) { Plugin::kUnknownBytes); } -void Plugin::EnqueueProgressEvent(const char* event_type, +void Plugin::EnqueueProgressEvent(PP_NaClEventType event_type, const nacl::string& url, LengthComputable length_computable, uint64_t loaded_bytes, uint64_t total_bytes) { PLUGIN_PRINTF(("Plugin::EnqueueProgressEvent (" - "event_type='%s', url='%s', length_computable=%d, " + "event_type='%d', url='%s', length_computable=%d, " "loaded=%" NACL_PRIu64 ", total=%" NACL_PRIu64 ")\n", - event_type, + static_cast<int>(event_type), url.c_str(), static_cast<int>(length_computable), loaded_bytes, @@ -1525,63 +1465,21 @@ void Plugin::DispatchProgressEvent(int32_t result) { nacl::scoped_ptr<ProgressEvent> event(progress_events_.front()); progress_events_.pop(); PLUGIN_PRINTF(("Plugin::DispatchProgressEvent (" - "event_type='%s', url='%s', length_computable=%d, " + "event_type='%d', url='%s', length_computable=%d, " "loaded=%" NACL_PRIu64 ", total=%" NACL_PRIu64 ")\n", - event->event_type(), + static_cast<int>(event->event_type()), event->url(), static_cast<int>(event->length_computable()), event->loaded_bytes(), event->total_bytes())); - static const char* kEventClosureJS = - "(function(target, type, url," - " lengthComputable, loadedBytes, totalBytes) {" - " var progress_event = new ProgressEvent(type, {" - " bubbles: false," - " cancelable: true," - " lengthComputable: lengthComputable," - " loaded: loadedBytes," - " total: totalBytes" - " });" - " progress_event.url = url;" - " target.dispatchEvent(progress_event);" - "})"; - - // Create a function object by evaluating the JavaScript text. - // TODO(sehr, polina): We should probably cache the created function object to - // avoid JavaScript reparsing. - pp::VarPrivate exception; - pp::VarPrivate function_object = ExecuteScript(kEventClosureJS, &exception); - if (!exception.is_undefined() || !function_object.is_object()) { - PLUGIN_PRINTF(("Plugin::DispatchProgressEvent:" - " Function object creation failed.\n")); - return; - } - // Get the target of the event to be dispatched. - pp::Var owner_element_object = GetOwnerElementObject(); - if (!owner_element_object.is_object()) { - PLUGIN_PRINTF(("Plugin::DispatchProgressEvent:" - " Couldn't get owner element object.\n")); - NACL_NOTREACHED(); - return; - } - - pp::Var argv[6]; - static const uint32_t argc = NACL_ARRAY_SIZE(argv); - argv[0] = owner_element_object; - argv[1] = pp::Var(event->event_type()); - argv[2] = pp::Var(event->url()); - argv[3] = pp::Var(event->length_computable() == LENGTH_IS_COMPUTABLE); - argv[4] = pp::Var(static_cast<double>(event->loaded_bytes())); - argv[5] = pp::Var(static_cast<double>(event->total_bytes())); - - // Dispatch the event. - const pp::Var default_method; - function_object.Call(default_method, argc, argv, &exception); - if (!exception.is_undefined()) { - PLUGIN_PRINTF(("Plugin::DispatchProgressEvent:" - " event dispatch failed.\n")); - } + nacl_interface_->DispatchEvent( + pp_instance(), + event->event_type(), + pp::Var(event->url()).pp_var(), + event->length_computable() == LENGTH_IS_COMPUTABLE ? PP_TRUE : PP_FALSE, + event->loaded_bytes(), + event->total_bytes()); } bool Plugin::OpenURLFast(const nacl::string& url, @@ -1661,4 +1559,42 @@ void Plugin::AddToConsole(const nacl::string& text) { var_interface->Release(str); } +void Plugin::set_last_error_string(const nacl::string& error) { + DCHECK(nacl_interface_); + nacl_interface_->SetReadOnlyProperty(pp_instance(), + pp::Var("lastError").pp_var(), + pp::Var(error).pp_var()); +} + +void Plugin::set_nacl_ready_state(ReadyState state) { + nacl_ready_state_ = state; + DCHECK(nacl_interface_); + nacl_interface_->SetReadOnlyProperty(pp_instance(), + pp::Var("readyState").pp_var(), + pp::Var(state).pp_var()); +} + +void Plugin::set_exit_status(int exit_status) { + pp::Core* core = pp::Module::Get()->core(); + if (core->IsMainThread()) { + SetExitStatusOnMainThread(PP_OK, exit_status); + } else { + pp::CompletionCallback callback = + callback_factory_.NewCallback(&Plugin::SetExitStatusOnMainThread, + exit_status); + core->CallOnMainThread(0, callback, 0); + } +} + +void Plugin::SetExitStatusOnMainThread(int32_t pp_error, + int exit_status) { + DCHECK(pp::Module::Get()->core()->IsMainThread()); + DCHECK(nacl_interface_); + exit_status_ = exit_status; + nacl_interface_->SetReadOnlyProperty(pp_instance(), + pp::Var("exitStatus").pp_var(), + pp::Var(exit_status_).pp_var()); +} + + } // namespace plugin diff --git a/ppapi/native_client/src/trusted/plugin/plugin.h b/ppapi/native_client/src/trusted/plugin/plugin.h index c1a93880af..ca8348968d 100644 --- a/ppapi/native_client/src/trusted/plugin/plugin.h +++ b/ppapi/native_client/src/trusted/plugin/plugin.h @@ -146,22 +146,13 @@ class Plugin : public pp::InstancePrivate { // event (loadstart, progress, error, abort, load, loadend). Events are // enqueued on the JavaScript event loop, which then calls back through // DispatchProgressEvent. - void EnqueueProgressEvent(const char* event_type); - void EnqueueProgressEvent(const char* event_type, + void EnqueueProgressEvent(PP_NaClEventType event_type); + void EnqueueProgressEvent(PP_NaClEventType event_type, const nacl::string& url, LengthComputable length_computable, uint64_t loaded_bytes, uint64_t total_bytes); - // Progress event types. - static const char* const kProgressEventLoadStart; - static const char* const kProgressEventProgress; - static const char* const kProgressEventError; - static const char* const kProgressEventAbort; - static const char* const kProgressEventLoad; - static const char* const kProgressEventLoadEnd; - static const char* const kProgressEventCrash; - // Report the error code that sel_ldr produces when starting a nexe. void ReportSelLdrLoadStatus(int status); @@ -211,16 +202,6 @@ class Plugin : public pp::InstancePrivate { // Requests a NaCl manifest download from a |url| relative to the page origin. void RequestNaClManifest(const nacl::string& url); - // Support for property getting. - typedef void (Plugin::* PropertyGetter)(NaClSrpcArg* prop_value); - void AddPropertyGet(const nacl::string& prop_name, PropertyGetter getter); - bool HasProperty(const nacl::string& prop_name); - bool GetProperty(const nacl::string& prop_name, NaClSrpcArg* prop_value); - // The supported property getters. - void GetExitStatus(NaClSrpcArg* prop_value); - void GetLastError(NaClSrpcArg* prop_value); - void GetReadyStateProperty(NaClSrpcArg* prop_value); - // The size returned when a file download operation is unable to determine // the size of the file to load. W3C ProgressEvents specify that unknown // sizes return 0. @@ -250,11 +231,7 @@ class Plugin : public pp::InstancePrivate { // document to request the URL using CORS even if this function returns false. bool DocumentCanRequest(const std::string& url); - // Get the text description of the last error reported by the plugin. - const nacl::string& last_error_string() const { return last_error_string_; } - void set_last_error_string(const nacl::string& error) { - last_error_string_ = error; - } + void set_last_error_string(const nacl::string& error); // The MIME type used to instantiate this instance of the NaCl plugin. // Typically, the MIME type will be application/x-nacl. However, if the NEXE @@ -271,13 +248,9 @@ class Plugin : public pp::InstancePrivate { Manifest const* manifest() const { return manifest_.get(); } const pp::URLUtil_Dev* url_util() const { return url_util_; } - // Extracts the exit status from the (main) service runtime. - int exit_status() const { - if (NULL == main_service_runtime()) { - return -1; - } - return main_service_runtime()->exit_status(); - } + int exit_status() const { return exit_status_; } + // set_exit_status may be called off the main thread. + void set_exit_status(int exit_status); const PPB_NaCl_Private* nacl_interface() const { return nacl_interface_; } @@ -395,6 +368,10 @@ class Plugin : public pp::InstancePrivate { // request so it won't slow down non-installed file downloads. bool OpenURLFast(const nacl::string& url, FileDownloader* downloader); + void set_nacl_ready_state(ReadyState state); + + void SetExitStatusOnMainThread(int32_t pp_error, int exit_status); + ScriptablePlugin* scriptable_plugin_; int argc_; @@ -412,8 +389,6 @@ class Plugin : public pp::InstancePrivate { nacl::DescWrapperFactory* wrapper_factory_; - std::map<nacl::string, PropertyGetter> property_getters_; - // File download support. |nexe_downloader_| can be opened with a specific // callback to run when the file has been downloaded and is opened for // reading. We use one downloader for all URL downloads to prevent issuing @@ -430,10 +405,6 @@ class Plugin : public pp::InstancePrivate { // URL processing interface for use in looking up resources in manifests. const pp::URLUtil_Dev* url_util_; - // A string containing the text description of the last error - // produced by this plugin. - nacl::string last_error_string_; - // PPAPI Dev interfaces are disabled by default. bool enable_dev_interfaces_; @@ -491,6 +462,7 @@ class Plugin : public pp::InstancePrivate { const FileDownloader* FindFileDownloader(PP_Resource url_loader) const; int64_t time_of_last_progress_event_; + int exit_status_; const PPB_NaCl_Private* nacl_interface_; }; diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc index 9d7fa0d60d..d67b991476 100644 --- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc +++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc @@ -344,7 +344,7 @@ void PnaclCoordinator::TranslateFinished(int32_t pp_error) { // that were delayed (see the delay inserted in BitcodeGotCompiled). if (ExpectedProgressKnown()) { pexe_bytes_compiled_ = expected_pexe_size_; - plugin_->EnqueueProgressEvent(plugin::Plugin::kProgressEventProgress, + plugin_->EnqueueProgressEvent(PP_NACL_EVENT_PROGRESS, pexe_url_, plugin::Plugin::LENGTH_IS_COMPUTABLE, pexe_bytes_compiled_, @@ -634,14 +634,14 @@ void PnaclCoordinator::BitcodeGotCompiled(int32_t pp_error, // that bytes were sent to the compiler. if (ExpectedProgressKnown()) { if (!ShouldDelayProgressEvent()) { - plugin_->EnqueueProgressEvent(plugin::Plugin::kProgressEventProgress, + plugin_->EnqueueProgressEvent(PP_NACL_EVENT_PROGRESS, pexe_url_, plugin::Plugin::LENGTH_IS_COMPUTABLE, pexe_bytes_compiled_, expected_pexe_size_); } } else { - plugin_->EnqueueProgressEvent(plugin::Plugin::kProgressEventProgress, + plugin_->EnqueueProgressEvent(PP_NACL_EVENT_PROGRESS, pexe_url_, plugin::Plugin::LENGTH_IS_NOT_COMPUTABLE, pexe_bytes_compiled_, diff --git a/ppapi/native_client/src/trusted/plugin/scriptable_plugin.cc b/ppapi/native_client/src/trusted/plugin/scriptable_plugin.cc index 5e395675ae..05c0455d55 100644 --- a/ppapi/native_client/src/trusted/plugin/scriptable_plugin.cc +++ b/ppapi/native_client/src/trusted/plugin/scriptable_plugin.cc @@ -41,54 +41,6 @@ pp::Var Error(const nacl::string& call_name, const char* caller, return pp::Var(); } -// In JavaScript, foo[1] is equivalent to foo["1"], so map both indexed and -// string names to a string. -nacl::string NameAsString(const pp::Var& name) { - if (name.is_string()) - return name.AsString(); - CHECK(name.is_int()); - nacl::stringstream namestream; - namestream << name.AsInt(); - return namestream.str(); -} - -// Returns a pp::Var corresponding to |arg| or void. Sets |exception| on error. -pp::Var NaClSrpcArgToPPVar(const NaClSrpcArg* arg, pp::Var* exception) { - PLUGIN_PRINTF((" NaClSrpcArgToPPVar (arg->tag='%c')\n", arg->tag)); - pp::Var var; - switch (arg->tag) { - case NACL_SRPC_ARG_TYPE_BOOL: - var = pp::Var(arg->u.bval != 0); - break; - case NACL_SRPC_ARG_TYPE_DOUBLE: - var = pp::Var(arg->u.dval); - break; - case NACL_SRPC_ARG_TYPE_INT: - var = pp::Var(arg->u.ival); - break; - case NACL_SRPC_ARG_TYPE_LONG: - // PPAPI does not have a 64-bit integral type. Downcast. - var = pp::Var(static_cast<int32_t>(arg->u.lval)); - break; - case NACL_SRPC_ARG_TYPE_STRING: - var = pp::Var(arg->arrays.str); - break; - case NACL_SRPC_ARG_TYPE_CHAR_ARRAY: - case NACL_SRPC_ARG_TYPE_DOUBLE_ARRAY: - case NACL_SRPC_ARG_TYPE_INT_ARRAY: - case NACL_SRPC_ARG_TYPE_LONG_ARRAY: - case NACL_SRPC_ARG_TYPE_OBJECT: - case NACL_SRPC_ARG_TYPE_HANDLE: - case NACL_SRPC_ARG_TYPE_VARIANT_ARRAY: - case NACL_SRPC_ARG_TYPE_INVALID: - default: - *exception = "variant array and invalid argument types are not supported"; - } - PLUGIN_PRINTF((" NaClSrpcArgToPPVar (return var=%s, exception=%s)\n", - var.DebugString().c_str(), exception->DebugString().c_str())); - return var; -} - } // namespace ScriptablePlugin::ScriptablePlugin(Plugin* plugin) @@ -131,18 +83,9 @@ bool ScriptablePlugin::HasProperty(const pp::Var& name, pp::Var* exception) { UNREFERENCED_PARAMETER(exception); PLUGIN_PRINTF(("ScriptablePlugin::HasProperty (this=%p, name=%s)\n", static_cast<void*>(this), name.DebugString().c_str())); - if (plugin_ == NULL) { - return false; - } - if (!name.is_string() && !name.is_int()) - return false; - bool has_property = plugin_->HasProperty(name.AsString()); - PLUGIN_PRINTF(("ScriptablePlugin::HasProperty (has_property=%d)\n", - has_property)); - return has_property; + return false; } - bool ScriptablePlugin::HasMethod(const pp::Var& name, pp::Var* exception) { UNREFERENCED_PARAMETER(exception); PLUGIN_PRINTF(("ScriptablePlugin::HasMethod (this=%p, name='%s')\n", @@ -150,33 +93,15 @@ bool ScriptablePlugin::HasMethod(const pp::Var& name, pp::Var* exception) { return false; } - pp::Var ScriptablePlugin::GetProperty(const pp::Var& name, pp::Var* exception) { PLUGIN_PRINTF(("ScriptablePlugin::GetProperty (name=%s)\n", name.DebugString().c_str())); - if (plugin_ == NULL) { - return pp::Var(); - } - // Get the property. - NaClSrpcArg prop_value; - nacl::string prop_name = NameAsString(name); - if (!plugin_->GetProperty(prop_name, &prop_value)) { - return Error(prop_name, "GetProperty", "invocation failed", exception); - } - PLUGIN_PRINTF(("ScriptablePlugin::GetProperty (invocation done)\n")); - // Marshall output parameter. - pp::Var property = NaClSrpcArgToPPVar(&prop_value, exception); - if (!exception->is_undefined()) { - return Error(prop_name, "GetProperty", "output marshalling failed", - exception); - } - PLUGIN_PRINTF(("ScriptablePlugin::GetProperty (property=%s)\n", - property.DebugString().c_str())); - return property; + Error("GetProperty", name.DebugString().c_str(), + "property getting is not supported", exception); + return pp::Var(); } - void ScriptablePlugin::SetProperty(const pp::Var& name, const pp::Var& value, pp::Var* exception) { @@ -191,7 +116,7 @@ void ScriptablePlugin::RemoveProperty(const pp::Var& name, pp::Var* exception) { PLUGIN_PRINTF(("ScriptablePlugin::RemoveProperty (name=%s)\n", name.DebugString().c_str())); - Error(NameAsString(name), "RemoveProperty", + Error("RemoveProperty", name.DebugString().c_str(), "property removal is not supported", exception); } diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.cc b/ppapi/native_client/src/trusted/plugin/service_runtime.cc index 8f59f3a020..8a5a11aac7 100644 --- a/ppapi/native_client/src/trusted/plugin/service_runtime.cc +++ b/ppapi/native_client/src/trusted/plugin/service_runtime.cc @@ -50,7 +50,7 @@ #include "ppapi/native_client/src/trusted/plugin/manifest.h" #include "ppapi/native_client/src/trusted/plugin/plugin.h" #include "ppapi/native_client/src/trusted/plugin/plugin_error.h" -#include "ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h" +#include "ppapi/native_client/src/trusted/plugin/pnacl_options.h" #include "ppapi/native_client/src/trusted/plugin/pnacl_resources.h" #include "ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h" #include "ppapi/native_client/src/trusted/plugin/srpc_client.h" @@ -313,9 +313,9 @@ void PluginReverseInterface::OpenManifestEntry_MainThreadContinuation( plugin_, PnaclUrls::PnaclComponentURLToFilename(mapped_url).c_str()); if (fd < 0) { - // We should check earlier if the pnacl component wasn't installed - // yet. At this point, we can't do much anymore, so just continue - // with an invalid fd. + // We checked earlier if the pnacl component wasn't installed + // yet, so this shouldn't happen. At this point, we can't do much + // anymore, so just continue with an invalid fd. NaClLog(4, "OpenManifestEntry_MainThreadContinuation: " "GetReadonlyPnaclFd failed\n"); @@ -333,22 +333,18 @@ void PluginReverseInterface::OpenManifestEntry_MainThreadContinuation( "OpenManifestEntry_MainThreadContinuation: GetPnaclFd okay\n"); } } else { - // Requires PNaCl translation. + // Requires PNaCl translation, but that's not supported. NaClLog(4, "OpenManifestEntry_MainThreadContinuation: " - "pulling down and translating.\n"); - pp::CompletionCallback translate_callback = - WeakRefNewCallback( - anchor_, - this, - &PluginReverseInterface::BitcodeTranslate_MainThreadContinuation, - open_cont); - // Will always call the callback on success or failure. - pnacl_coordinator_.reset( - PnaclCoordinator::BitcodeToNative(plugin_, - mapped_url, - pnacl_options, - translate_callback)); + "Requires PNaCl translation -- not supported\n"); + nacl::MutexLocker take(&mu_); + *p->op_complete_ptr = true; // done... + p->file_info->desc = -1; // but failed. + p->error_info->SetReport( + ERROR_MANIFEST_OPEN, + "ServiceRuntime: Translating OpenManifestEntry files not supported"); + NaClXCondVarBroadcast(&cv_); + return; } // p is deleted automatically } @@ -379,38 +375,6 @@ void PluginReverseInterface::StreamAsFile_MainThreadContinuation( NaClXCondVarBroadcast(&cv_); } - -void PluginReverseInterface::BitcodeTranslate_MainThreadContinuation( - OpenManifestEntryResource* p, - int32_t result) { - NaClLog(4, - "Entered BitcodeTranslate_MainThreadContinuation\n"); - - nacl::MutexLocker take(&mu_); - if (result == PP_OK) { - // TODO(jvoung): clean this up. We are assuming that the NaClDesc is - // a host IO desc and doing a downcast. Once the ReverseInterface - // accepts NaClDescs we can avoid this downcast. - NaClDesc* desc = pnacl_coordinator_->ReleaseTranslatedFD()->desc(); - struct NaClDescIoDesc* ndiodp = (struct NaClDescIoDesc*)desc; - p->file_info->desc = ndiodp->hd->d; - pnacl_coordinator_.reset(NULL); - NaClLog(4, - "BitcodeTranslate_MainThreadContinuation: PP_OK, desc %d\n", - p->file_info->desc); - } else { - NaClLog(4, - "BitcodeTranslate_MainThreadContinuation: !PP_OK, " - "setting desc -1\n"); - p->file_info->desc = -1; - // Error should have been reported by pnacl coordinator. - NaClLog(LOG_ERROR, "PluginReverseInterface::BitcodeTranslate error.\n"); - } - *p->op_complete_ptr = true; - NaClXCondVarBroadcast(&cv_); -} - - bool PluginReverseInterface::CloseManifestEntry(int32_t desc) { bool op_complete = false; bool op_result; @@ -508,11 +472,11 @@ void PluginReverseInterface::AddTempQuotaManagedFile( ServiceRuntime::ServiceRuntime(Plugin* plugin, const Manifest* manifest, - bool should_report_uma, + bool main_service_runtime, pp::CompletionCallback init_done_cb, pp::CompletionCallback crash_cb) : plugin_(plugin), - should_report_uma_(should_report_uma), + main_service_runtime_(main_service_runtime), reverse_service_(NULL), anchor_(new nacl::WeakRefAnchor()), rev_interface_(new PluginReverseInterface(anchor_, plugin, @@ -587,7 +551,7 @@ bool ServiceRuntime::InitCommunication(nacl::DescWrapper* nacl_desc, } NaClLog(4, "ServiceRuntime::InitCommunication (load_status=%d)\n", load_status); - if (should_report_uma_) { + if (main_service_runtime_) { plugin_->ReportSelLdrLoadStatus(load_status); } if (LOAD_OK != load_status) { @@ -747,14 +711,10 @@ ServiceRuntime::~ServiceRuntime() { NaClMutexDtor(&mu_); } -int ServiceRuntime::exit_status() { - nacl::MutexLocker take(&mu_); - return exit_status_; -} - void ServiceRuntime::set_exit_status(int exit_status) { nacl::MutexLocker take(&mu_); - exit_status_ = exit_status & 0xff; + if (main_service_runtime_) + plugin_->set_exit_status(exit_status & 0xff); } nacl::string ServiceRuntime::GetCrashLogOutput() { diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.h b/ppapi/native_client/src/trusted/plugin/service_runtime.h index b06a706ae8..78c781b194 100644 --- a/ppapi/native_client/src/trusted/plugin/service_runtime.h +++ b/ppapi/native_client/src/trusted/plugin/service_runtime.h @@ -42,7 +42,6 @@ namespace plugin { class ErrorInfo; class Manifest; class Plugin; -class PnaclCoordinator; class SrpcClient; class ServiceRuntime; @@ -201,10 +200,6 @@ class PluginReverseInterface: public nacl::ReverseInterface { OpenManifestEntryResource* p, int32_t result); - virtual void BitcodeTranslate_MainThreadContinuation( - OpenManifestEntryResource* p, - int32_t result); - virtual void CloseManifestEntry_MainThreadContinuation( CloseManifestEntryResource* cls, int32_t err); @@ -220,8 +215,6 @@ class PluginReverseInterface: public nacl::ReverseInterface { std::set<int64_t> quota_files_; bool shutting_down_; - nacl::scoped_ptr<PnaclCoordinator> pnacl_coordinator_; - pp::CompletionCallback init_done_cb_; pp::CompletionCallback crash_cb_; }; @@ -287,7 +280,7 @@ class ServiceRuntime { NaClSrpcChannel command_channel_; Plugin* plugin_; - bool should_report_uma_; + bool main_service_runtime_; nacl::ReverseService* reverse_service_; nacl::scoped_ptr<nacl::SelLdrLauncherBase> subprocess_; 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 1365a3ed11..5edbe5c4a1 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 @@ -23,7 +23,6 @@ #include "ppapi/c/dev/ppb_printing_dev.h" #include "ppapi/c/dev/ppb_resource_array_dev.h" #include "ppapi/c/dev/ppb_scrollbar_dev.h" -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/dev/ppb_text_input_dev.h" #include "ppapi/c/dev/ppb_trace_event_dev.h" #include "ppapi/c/dev/ppb_truetype_font_dev.h" @@ -101,6 +100,7 @@ #include "ppapi/c/private/ppb_flash_print.h" #include "ppapi/c/private/ppb_host_resolver_private.h" #include "ppapi/c/private/ppb_instance_private.h" +#include "ppapi/c/private/ppb_isolated_file_system_private.h" #include "ppapi/c/private/ppb_nacl_private.h" #include "ppapi/c/private/ppb_net_address_private.h" #include "ppapi/c/private/ppb_output_protection_private.h" @@ -108,6 +108,7 @@ #include "ppapi/c/private/ppb_talk_private.h" #include "ppapi/c/private/ppb_tcp_server_socket_private.h" #include "ppapi/c/private/ppb_tcp_socket_private.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/c/private/ppb_udp_socket_private.h" #include "ppapi/c/private/ppb_uma_private.h" #include "ppapi/c/private/ppb_video_destination_private.h" @@ -186,9 +187,6 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_IMEInputEvent_Dev_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_IMEInputEvent_Dev_0_2; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_KeyboardInputEvent_Dev_0_2; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Printing_Dev_0_7; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Testing_Dev_0_9; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Testing_Dev_0_91; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Testing_Dev_0_92; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TrueTypeFont_Dev_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_URLUtil_Dev_0_6; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_URLUtil_Dev_0_7; @@ -197,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_7; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_8; 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; @@ -209,9 +207,11 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_Clipboard_4_0; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_Clipboard_5_0; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_DeviceID_1_0; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_DRM_1_0; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_DRM_1_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_Menu_0_2; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_HostResolver_Private_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Instance_Private_0_1; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_IsolatedFileSystem_Private_0_2; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NaCl_Private_1_0; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetAddress_Private_0_1; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NetAddress_Private_1_0; @@ -225,6 +225,7 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TCPServerSocket_Private_0 static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TCPSocket_Private_0_3; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TCPSocket_Private_0_4; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TCPSocket_Private_0_5; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Testing_Private_1_0; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_2; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_3; static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_4; @@ -232,7 +233,7 @@ 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_7; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_8; 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; @@ -1899,6 +1900,8 @@ static int32_t Pnacl_M14_PPB_Font_Dev_PixelOffsetForCharacter(PP_Resource font, /* Not generating wrapper methods for PPB_Graphics2D_Dev_0_1 */ +/* Not generating wrapper methods for PPB_Graphics2D_Dev_0_2 */ + /* Begin wrapper methods for PPB_IMEInputEvent_Dev_0_1 */ static PP_Bool Pnacl_M16_PPB_IMEInputEvent_Dev_IsIMEInputEvent(PP_Resource resource) { @@ -2011,142 +2014,6 @@ static int32_t Pnacl_M23_PPB_Printing_Dev_GetDefaultPrintSettings(PP_Resource re /* Not generating wrapper methods for PPB_Scrollbar_Dev_0_5 */ -/* Not generating wrapper methods for PPB_Testing_Dev_0_7 */ - -/* Not generating wrapper methods for PPB_Testing_Dev_0_8 */ - -/* Begin wrapper methods for PPB_Testing_Dev_0_9 */ - -static PP_Bool Pnacl_M17_PPB_Testing_Dev_ReadImageData(PP_Resource device_context_2d, PP_Resource image, const struct PP_Point* top_left) { - const struct PPB_Testing_Dev_0_9 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_9.real_iface; - return iface->ReadImageData(device_context_2d, image, top_left); -} - -static void Pnacl_M17_PPB_Testing_Dev_RunMessageLoop(PP_Instance instance) { - const struct PPB_Testing_Dev_0_9 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_9.real_iface; - iface->RunMessageLoop(instance); -} - -static void Pnacl_M17_PPB_Testing_Dev_QuitMessageLoop(PP_Instance instance) { - const struct PPB_Testing_Dev_0_9 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_9.real_iface; - iface->QuitMessageLoop(instance); -} - -static uint32_t Pnacl_M17_PPB_Testing_Dev_GetLiveObjectsForInstance(PP_Instance instance) { - const struct PPB_Testing_Dev_0_9 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_9.real_iface; - return iface->GetLiveObjectsForInstance(instance); -} - -static PP_Bool Pnacl_M17_PPB_Testing_Dev_IsOutOfProcess(void) { - const struct PPB_Testing_Dev_0_9 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_9.real_iface; - return iface->IsOutOfProcess(); -} - -static void Pnacl_M17_PPB_Testing_Dev_SimulateInputEvent(PP_Instance instance, PP_Resource input_event) { - const struct PPB_Testing_Dev_0_9 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_9.real_iface; - iface->SimulateInputEvent(instance, input_event); -} - -static void Pnacl_M17_PPB_Testing_Dev_GetDocumentURL(struct PP_Var* _struct_result, PP_Instance instance, struct PP_URLComponents_Dev* components) { - const struct PPB_Testing_Dev_0_9 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_9.real_iface; - *_struct_result = iface->GetDocumentURL(instance, components); -} - -/* End wrapper methods for PPB_Testing_Dev_0_9 */ - -/* Begin wrapper methods for PPB_Testing_Dev_0_91 */ - -static PP_Bool Pnacl_M18_PPB_Testing_Dev_ReadImageData(PP_Resource device_context_2d, PP_Resource image, const struct PP_Point* top_left) { - const struct PPB_Testing_Dev_0_91 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_91.real_iface; - return iface->ReadImageData(device_context_2d, image, top_left); -} - -static void Pnacl_M18_PPB_Testing_Dev_RunMessageLoop(PP_Instance instance) { - const struct PPB_Testing_Dev_0_91 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_91.real_iface; - iface->RunMessageLoop(instance); -} - -static void Pnacl_M18_PPB_Testing_Dev_QuitMessageLoop(PP_Instance instance) { - const struct PPB_Testing_Dev_0_91 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_91.real_iface; - iface->QuitMessageLoop(instance); -} - -static uint32_t Pnacl_M18_PPB_Testing_Dev_GetLiveObjectsForInstance(PP_Instance instance) { - const struct PPB_Testing_Dev_0_91 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_91.real_iface; - return iface->GetLiveObjectsForInstance(instance); -} - -static PP_Bool Pnacl_M18_PPB_Testing_Dev_IsOutOfProcess(void) { - const struct PPB_Testing_Dev_0_91 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_91.real_iface; - return iface->IsOutOfProcess(); -} - -static void Pnacl_M18_PPB_Testing_Dev_SimulateInputEvent(PP_Instance instance, PP_Resource input_event) { - const struct PPB_Testing_Dev_0_91 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_91.real_iface; - iface->SimulateInputEvent(instance, input_event); -} - -static void Pnacl_M18_PPB_Testing_Dev_GetDocumentURL(struct PP_Var* _struct_result, PP_Instance instance, struct PP_URLComponents_Dev* components) { - const struct PPB_Testing_Dev_0_91 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_91.real_iface; - *_struct_result = iface->GetDocumentURL(instance, components); -} - -static uint32_t Pnacl_M18_PPB_Testing_Dev_GetLiveVars(struct PP_Var live_vars[], uint32_t array_size) { - const struct PPB_Testing_Dev_0_91 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_91.real_iface; - return iface->GetLiveVars(live_vars, array_size); -} - -/* End wrapper methods for PPB_Testing_Dev_0_91 */ - -/* Begin wrapper methods for PPB_Testing_Dev_0_92 */ - -static PP_Bool Pnacl_M28_PPB_Testing_Dev_ReadImageData(PP_Resource device_context_2d, PP_Resource image, const struct PP_Point* top_left) { - const struct PPB_Testing_Dev_0_92 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_92.real_iface; - return iface->ReadImageData(device_context_2d, image, top_left); -} - -static void Pnacl_M28_PPB_Testing_Dev_RunMessageLoop(PP_Instance instance) { - const struct PPB_Testing_Dev_0_92 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_92.real_iface; - iface->RunMessageLoop(instance); -} - -static void Pnacl_M28_PPB_Testing_Dev_QuitMessageLoop(PP_Instance instance) { - const struct PPB_Testing_Dev_0_92 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_92.real_iface; - iface->QuitMessageLoop(instance); -} - -static uint32_t Pnacl_M28_PPB_Testing_Dev_GetLiveObjectsForInstance(PP_Instance instance) { - const struct PPB_Testing_Dev_0_92 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_92.real_iface; - return iface->GetLiveObjectsForInstance(instance); -} - -static PP_Bool Pnacl_M28_PPB_Testing_Dev_IsOutOfProcess(void) { - const struct PPB_Testing_Dev_0_92 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_92.real_iface; - return iface->IsOutOfProcess(); -} - -static void Pnacl_M28_PPB_Testing_Dev_SimulateInputEvent(PP_Instance instance, PP_Resource input_event) { - const struct PPB_Testing_Dev_0_92 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_92.real_iface; - iface->SimulateInputEvent(instance, input_event); -} - -static void Pnacl_M28_PPB_Testing_Dev_GetDocumentURL(struct PP_Var* _struct_result, PP_Instance instance, struct PP_URLComponents_Dev* components) { - const struct PPB_Testing_Dev_0_92 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_92.real_iface; - *_struct_result = iface->GetDocumentURL(instance, components); -} - -static uint32_t Pnacl_M28_PPB_Testing_Dev_GetLiveVars(struct PP_Var live_vars[], uint32_t array_size) { - const struct PPB_Testing_Dev_0_92 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_92.real_iface; - return iface->GetLiveVars(live_vars, array_size); -} - -static void Pnacl_M28_PPB_Testing_Dev_SetMinimumArrayBufferSizeForShmem(PP_Instance instance, uint32_t threshold) { - const struct PPB_Testing_Dev_0_92 *iface = Pnacl_WrapperInfo_PPB_Testing_Dev_0_92.real_iface; - iface->SetMinimumArrayBufferSizeForShmem(instance, threshold); -} - -/* End wrapper methods for PPB_Testing_Dev_0_92 */ - /* Not generating wrapper methods for PPB_TextInput_Dev_0_1 */ /* Not generating wrapper methods for PPB_TextInput_Dev_0_2 */ @@ -2481,54 +2348,59 @@ 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_7 */ +/* Begin wrapper methods for PPB_ContentDecryptor_Private_0_8 */ -static void Pnacl_M31_PPB_ContentDecryptor_Private_KeyAdded(PP_Instance instance, struct PP_Var* key_system, struct PP_Var* session_id) { - const struct PPB_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_7.real_iface; - iface->KeyAdded(instance, *key_system, *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_M31_PPB_ContentDecryptor_Private_KeyMessage(PP_Instance instance, struct PP_Var* key_system, struct PP_Var* session_id, struct PP_Var* message, struct PP_Var* default_url) { - const struct PPB_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_7.real_iface; - iface->KeyMessage(instance, *key_system, *session_id, *message, *default_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_M31_PPB_ContentDecryptor_Private_KeyError(PP_Instance instance, struct PP_Var* key_system, struct PP_Var* session_id, int32_t media_error, int32_t system_code) { - const struct PPB_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_7.real_iface; - iface->KeyError(instance, *key_system, *session_id, media_error, system_code); +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_M31_PPB_ContentDecryptor_Private_DeliverBlock(PP_Instance instance, PP_Resource decrypted_block, const struct PP_DecryptedBlockInfo* decrypted_block_info) { - const struct PPB_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_7.real_iface; +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_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; iface->DeliverBlock(instance, decrypted_block, decrypted_block_info); } -static void Pnacl_M31_PPB_ContentDecryptor_Private_DecoderInitializeDone(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id, PP_Bool success) { - const struct PPB_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_7.real_iface; +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; iface->DecoderInitializeDone(instance, decoder_type, request_id, success); } -static void Pnacl_M31_PPB_ContentDecryptor_Private_DecoderDeinitializeDone(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { - const struct PPB_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_7.real_iface; +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; iface->DecoderDeinitializeDone(instance, decoder_type, request_id); } -static void Pnacl_M31_PPB_ContentDecryptor_Private_DecoderResetDone(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { - const struct PPB_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_7.real_iface; +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; iface->DecoderResetDone(instance, decoder_type, request_id); } -static void Pnacl_M31_PPB_ContentDecryptor_Private_DeliverFrame(PP_Instance instance, PP_Resource decrypted_frame, const struct PP_DecryptedFrameInfo* decrypted_frame_info) { - const struct PPB_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_7.real_iface; +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; iface->DeliverFrame(instance, decrypted_frame, decrypted_frame_info); } -static void Pnacl_M31_PPB_ContentDecryptor_Private_DeliverSamples(PP_Instance instance, PP_Resource audio_frames, const struct PP_DecryptedSampleInfo* decrypted_sample_info) { - const struct PPB_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_7.real_iface; +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; iface->DeliverSamples(instance, audio_frames, decrypted_sample_info); } -/* End wrapper methods for PPB_ContentDecryptor_Private_0_7 */ +/* End wrapper methods for PPB_ContentDecryptor_Private_0_8 */ /* Begin wrapper methods for PPB_Ext_CrxFileSystem_Private_0_1 */ @@ -2954,6 +2826,35 @@ static int32_t Pnacl_M29_PPB_Flash_DRM_GetVoucherFile(PP_Resource drm, PP_Resour /* End wrapper methods for PPB_Flash_DRM_1_0 */ +/* Begin wrapper methods for PPB_Flash_DRM_1_1 */ + +static PP_Resource Pnacl_M33_PPB_Flash_DRM_Create(PP_Instance instance) { + const struct PPB_Flash_DRM_1_1 *iface = Pnacl_WrapperInfo_PPB_Flash_DRM_1_1.real_iface; + return iface->Create(instance); +} + +static int32_t Pnacl_M33_PPB_Flash_DRM_GetDeviceID(PP_Resource drm, struct PP_Var* id, struct PP_CompletionCallback* callback) { + const struct PPB_Flash_DRM_1_1 *iface = Pnacl_WrapperInfo_PPB_Flash_DRM_1_1.real_iface; + return iface->GetDeviceID(drm, id, *callback); +} + +static PP_Bool Pnacl_M33_PPB_Flash_DRM_GetHmonitor(PP_Resource drm, int64_t* hmonitor) { + const struct PPB_Flash_DRM_1_1 *iface = Pnacl_WrapperInfo_PPB_Flash_DRM_1_1.real_iface; + return iface->GetHmonitor(drm, hmonitor); +} + +static int32_t Pnacl_M33_PPB_Flash_DRM_GetVoucherFile(PP_Resource drm, PP_Resource* file_ref, struct PP_CompletionCallback* callback) { + const struct PPB_Flash_DRM_1_1 *iface = Pnacl_WrapperInfo_PPB_Flash_DRM_1_1.real_iface; + return iface->GetVoucherFile(drm, file_ref, *callback); +} + +static int32_t Pnacl_M33_PPB_Flash_DRM_MonitorIsExternal(PP_Resource drm, PP_Bool* is_external, struct PP_CompletionCallback* callback) { + const struct PPB_Flash_DRM_1_1 *iface = Pnacl_WrapperInfo_PPB_Flash_DRM_1_1.real_iface; + return iface->MonitorIsExternal(drm, is_external, *callback); +} + +/* End wrapper methods for PPB_Flash_DRM_1_1 */ + /* Not generating wrapper methods for PPB_Flash_FontFile_0_1 */ /* Not generating wrapper methods for PPB_FlashFullscreen_0_1 */ @@ -3036,6 +2937,15 @@ static void Pnacl_M13_PPB_Instance_Private_ExecuteScript(struct PP_Var* _struct_ /* End wrapper methods for PPB_Instance_Private_0_1 */ +/* Begin wrapper methods for PPB_IsolatedFileSystem_Private_0_2 */ + +static int32_t Pnacl_M33_PPB_IsolatedFileSystem_Private_Open(PP_Instance instance, PP_IsolatedFileSystemType_Private type, PP_Resource* file_system, struct PP_CompletionCallback* callback) { + const struct PPB_IsolatedFileSystem_Private_0_2 *iface = Pnacl_WrapperInfo_PPB_IsolatedFileSystem_Private_0_2.real_iface; + return iface->Open(instance, type, file_system, *callback); +} + +/* End wrapper methods for PPB_IsolatedFileSystem_Private_0_2 */ + /* Begin wrapper methods for PPB_NaCl_Private_1_0 */ static PP_ExternalPluginResult Pnacl_M25_PPB_NaCl_Private_LaunchSelLdr(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, PP_Bool enable_crash_throttling, void* imc_handle, struct PP_Var* error_message) { @@ -3098,6 +3008,16 @@ static PP_FileHandle Pnacl_M25_PPB_NaCl_Private_OpenNaClExecutable(PP_Instance i return iface->OpenNaClExecutable(instance, file_url, file_token_lo, file_token_hi); } +static void Pnacl_M25_PPB_NaCl_Private_DispatchEvent(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) { + const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; + iface->DispatchEvent(instance, event_type, *resource_url, length_is_computable, loaded_bytes, total_bytes); +} + +static void Pnacl_M25_PPB_NaCl_Private_SetReadOnlyProperty(PP_Instance instance, struct PP_Var* key, struct PP_Var* value) { + const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface; + iface->SetReadOnlyProperty(instance, *key, *value); +} + /* End wrapper methods for PPB_NaCl_Private_1_0 */ /* Begin wrapper methods for PPB_NetAddress_Private_0_1 */ @@ -3563,6 +3483,55 @@ static int32_t Pnacl_M27_PPB_TCPSocket_Private_SetOption(PP_Resource tcp_socket, /* End wrapper methods for PPB_TCPSocket_Private_0_5 */ +/* Begin wrapper methods for PPB_Testing_Private_1_0 */ + +static PP_Bool Pnacl_M33_PPB_Testing_Private_ReadImageData(PP_Resource device_context_2d, PP_Resource image, const struct PP_Point* top_left) { + const struct PPB_Testing_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_Testing_Private_1_0.real_iface; + return iface->ReadImageData(device_context_2d, image, top_left); +} + +static void Pnacl_M33_PPB_Testing_Private_RunMessageLoop(PP_Instance instance) { + const struct PPB_Testing_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_Testing_Private_1_0.real_iface; + iface->RunMessageLoop(instance); +} + +static void Pnacl_M33_PPB_Testing_Private_QuitMessageLoop(PP_Instance instance) { + const struct PPB_Testing_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_Testing_Private_1_0.real_iface; + iface->QuitMessageLoop(instance); +} + +static uint32_t Pnacl_M33_PPB_Testing_Private_GetLiveObjectsForInstance(PP_Instance instance) { + const struct PPB_Testing_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_Testing_Private_1_0.real_iface; + return iface->GetLiveObjectsForInstance(instance); +} + +static PP_Bool Pnacl_M33_PPB_Testing_Private_IsOutOfProcess(void) { + const struct PPB_Testing_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_Testing_Private_1_0.real_iface; + return iface->IsOutOfProcess(); +} + +static void Pnacl_M33_PPB_Testing_Private_SimulateInputEvent(PP_Instance instance, PP_Resource input_event) { + const struct PPB_Testing_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_Testing_Private_1_0.real_iface; + iface->SimulateInputEvent(instance, input_event); +} + +static void Pnacl_M33_PPB_Testing_Private_GetDocumentURL(struct PP_Var* _struct_result, PP_Instance instance, struct PP_URLComponents_Dev* components) { + const struct PPB_Testing_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_Testing_Private_1_0.real_iface; + *_struct_result = iface->GetDocumentURL(instance, components); +} + +static uint32_t Pnacl_M33_PPB_Testing_Private_GetLiveVars(struct PP_Var live_vars[], uint32_t array_size) { + const struct PPB_Testing_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_Testing_Private_1_0.real_iface; + return iface->GetLiveVars(live_vars, array_size); +} + +static void Pnacl_M33_PPB_Testing_Private_SetMinimumArrayBufferSizeForShmem(PP_Instance instance, uint32_t threshold) { + const struct PPB_Testing_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_Testing_Private_1_0.real_iface; + iface->SetMinimumArrayBufferSizeForShmem(instance, threshold); +} + +/* End wrapper methods for PPB_Testing_Private_1_0 */ + /* Begin wrapper methods for PPB_UDPSocket_Private_0_2 */ static PP_Resource Pnacl_M17_PPB_UDPSocket_Private_Create(PP_Instance instance_id) { @@ -3796,79 +3765,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_7 */ +/* Begin wrapper methods for PPP_ContentDecryptor_Private_0_8 */ -static void Pnacl_M31_PPP_ContentDecryptor_Private_Initialize(PP_Instance instance, struct PP_Var key_system, PP_Bool can_challenge_platform) { - const struct PPP_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_7.real_iface; - void (*temp_fp)(PP_Instance instance, struct PP_Var* key_system, PP_Bool can_challenge_platform) = - ((void (*)(PP_Instance instance, struct PP_Var* key_system, PP_Bool can_challenge_platform))iface->Initialize); - temp_fp(instance, &key_system, can_challenge_platform); +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; + 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_M31_PPP_ContentDecryptor_Private_GenerateKeyRequest(PP_Instance instance, struct PP_Var type, struct PP_Var init_data) { - const struct PPP_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_7.real_iface; - void (*temp_fp)(PP_Instance instance, struct PP_Var* type, struct PP_Var* init_data) = - ((void (*)(PP_Instance instance, struct PP_Var* type, struct PP_Var* init_data))iface->GenerateKeyRequest); - temp_fp(instance, &type, &init_data); +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_M31_PPP_ContentDecryptor_Private_AddKey(PP_Instance instance, struct PP_Var session_id, struct PP_Var key, struct PP_Var init_data) { - const struct PPP_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_7.real_iface; - void (*temp_fp)(PP_Instance instance, struct PP_Var* session_id, struct PP_Var* key, struct PP_Var* init_data) = - ((void (*)(PP_Instance instance, struct PP_Var* session_id, struct PP_Var* key, struct PP_Var* init_data))iface->AddKey); - temp_fp(instance, &session_id, &key, &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_M31_PPP_ContentDecryptor_Private_CancelKeyRequest(PP_Instance instance, struct PP_Var session_id) { - const struct PPP_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_7.real_iface; - void (*temp_fp)(PP_Instance instance, struct PP_Var* session_id) = - ((void (*)(PP_Instance instance, struct PP_Var* session_id))iface->CancelKeyRequest); - temp_fp(instance, &session_id); +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_M31_PPP_ContentDecryptor_Private_Decrypt(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info) { - const struct PPP_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_7.real_iface; +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; 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_M31_PPP_ContentDecryptor_Private_InitializeAudioDecoder(PP_Instance instance, const struct PP_AudioDecoderConfig* decoder_config, PP_Resource codec_extra_data) { - const struct PPP_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_7.real_iface; +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; 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_M31_PPP_ContentDecryptor_Private_InitializeVideoDecoder(PP_Instance instance, const struct PP_VideoDecoderConfig* decoder_config, PP_Resource codec_extra_data) { - const struct PPP_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_7.real_iface; +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; 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_M31_PPP_ContentDecryptor_Private_DeinitializeDecoder(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { - const struct PPP_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_7.real_iface; +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; 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_M31_PPP_ContentDecryptor_Private_ResetDecoder(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { - const struct PPP_ContentDecryptor_Private_0_7 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_7.real_iface; +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; 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_M31_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_7 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_7.real_iface; +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; 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_7 */ +/* End wrapper methods for PPP_ContentDecryptor_Private_0_8 */ /* Not generating wrapper methods for PPP_Flash_BrowserOperations_1_0 */ @@ -4594,6 +4563,8 @@ struct PPB_Font_Dev_0_6 Pnacl_Wrappers_PPB_Font_Dev_0_6 = { /* Not generating wrapper interface for PPB_Graphics2D_Dev_0_1 */ +/* Not generating wrapper interface for PPB_Graphics2D_Dev_0_2 */ + struct PPB_IMEInputEvent_Dev_0_1 Pnacl_Wrappers_PPB_IMEInputEvent_Dev_0_1 = { .IsIMEInputEvent = (PP_Bool (*)(PP_Resource resource))&Pnacl_M16_PPB_IMEInputEvent_Dev_IsIMEInputEvent, .GetText = (struct PP_Var (*)(PP_Resource ime_event))&Pnacl_M16_PPB_IMEInputEvent_Dev_GetText, @@ -4630,43 +4601,6 @@ struct PPB_Printing_Dev_0_7 Pnacl_Wrappers_PPB_Printing_Dev_0_7 = { /* Not generating wrapper interface for PPB_Scrollbar_Dev_0_5 */ -/* Not generating wrapper interface for PPB_Testing_Dev_0_7 */ - -/* Not generating wrapper interface for PPB_Testing_Dev_0_8 */ - -struct PPB_Testing_Dev_0_9 Pnacl_Wrappers_PPB_Testing_Dev_0_9 = { - .ReadImageData = (PP_Bool (*)(PP_Resource device_context_2d, PP_Resource image, const struct PP_Point* top_left))&Pnacl_M17_PPB_Testing_Dev_ReadImageData, - .RunMessageLoop = (void (*)(PP_Instance instance))&Pnacl_M17_PPB_Testing_Dev_RunMessageLoop, - .QuitMessageLoop = (void (*)(PP_Instance instance))&Pnacl_M17_PPB_Testing_Dev_QuitMessageLoop, - .GetLiveObjectsForInstance = (uint32_t (*)(PP_Instance instance))&Pnacl_M17_PPB_Testing_Dev_GetLiveObjectsForInstance, - .IsOutOfProcess = (PP_Bool (*)(void))&Pnacl_M17_PPB_Testing_Dev_IsOutOfProcess, - .SimulateInputEvent = (void (*)(PP_Instance instance, PP_Resource input_event))&Pnacl_M17_PPB_Testing_Dev_SimulateInputEvent, - .GetDocumentURL = (struct PP_Var (*)(PP_Instance instance, struct PP_URLComponents_Dev* components))&Pnacl_M17_PPB_Testing_Dev_GetDocumentURL -}; - -struct PPB_Testing_Dev_0_91 Pnacl_Wrappers_PPB_Testing_Dev_0_91 = { - .ReadImageData = (PP_Bool (*)(PP_Resource device_context_2d, PP_Resource image, const struct PP_Point* top_left))&Pnacl_M18_PPB_Testing_Dev_ReadImageData, - .RunMessageLoop = (void (*)(PP_Instance instance))&Pnacl_M18_PPB_Testing_Dev_RunMessageLoop, - .QuitMessageLoop = (void (*)(PP_Instance instance))&Pnacl_M18_PPB_Testing_Dev_QuitMessageLoop, - .GetLiveObjectsForInstance = (uint32_t (*)(PP_Instance instance))&Pnacl_M18_PPB_Testing_Dev_GetLiveObjectsForInstance, - .IsOutOfProcess = (PP_Bool (*)(void))&Pnacl_M18_PPB_Testing_Dev_IsOutOfProcess, - .SimulateInputEvent = (void (*)(PP_Instance instance, PP_Resource input_event))&Pnacl_M18_PPB_Testing_Dev_SimulateInputEvent, - .GetDocumentURL = (struct PP_Var (*)(PP_Instance instance, struct PP_URLComponents_Dev* components))&Pnacl_M18_PPB_Testing_Dev_GetDocumentURL, - .GetLiveVars = (uint32_t (*)(struct PP_Var live_vars[], uint32_t array_size))&Pnacl_M18_PPB_Testing_Dev_GetLiveVars -}; - -struct PPB_Testing_Dev_0_92 Pnacl_Wrappers_PPB_Testing_Dev_0_92 = { - .ReadImageData = (PP_Bool (*)(PP_Resource device_context_2d, PP_Resource image, const struct PP_Point* top_left))&Pnacl_M28_PPB_Testing_Dev_ReadImageData, - .RunMessageLoop = (void (*)(PP_Instance instance))&Pnacl_M28_PPB_Testing_Dev_RunMessageLoop, - .QuitMessageLoop = (void (*)(PP_Instance instance))&Pnacl_M28_PPB_Testing_Dev_QuitMessageLoop, - .GetLiveObjectsForInstance = (uint32_t (*)(PP_Instance instance))&Pnacl_M28_PPB_Testing_Dev_GetLiveObjectsForInstance, - .IsOutOfProcess = (PP_Bool (*)(void))&Pnacl_M28_PPB_Testing_Dev_IsOutOfProcess, - .SimulateInputEvent = (void (*)(PP_Instance instance, PP_Resource input_event))&Pnacl_M28_PPB_Testing_Dev_SimulateInputEvent, - .GetDocumentURL = (struct PP_Var (*)(PP_Instance instance, struct PP_URLComponents_Dev* components))&Pnacl_M28_PPB_Testing_Dev_GetDocumentURL, - .GetLiveVars = (uint32_t (*)(struct PP_Var live_vars[], uint32_t array_size))&Pnacl_M28_PPB_Testing_Dev_GetLiveVars, - .SetMinimumArrayBufferSizeForShmem = (void (*)(PP_Instance instance, uint32_t threshold))&Pnacl_M28_PPB_Testing_Dev_SetMinimumArrayBufferSizeForShmem -}; - /* Not generating wrapper interface for PPB_TextInput_Dev_0_1 */ /* Not generating wrapper interface for PPB_TextInput_Dev_0_2 */ @@ -4781,16 +4715,17 @@ 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_7 Pnacl_Wrappers_PPB_ContentDecryptor_Private_0_7 = { - .KeyAdded = (void (*)(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id))&Pnacl_M31_PPB_ContentDecryptor_Private_KeyAdded, - .KeyMessage = (void (*)(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id, struct PP_Var message, struct PP_Var default_url))&Pnacl_M31_PPB_ContentDecryptor_Private_KeyMessage, - .KeyError = (void (*)(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id, int32_t media_error, int32_t system_code))&Pnacl_M31_PPB_ContentDecryptor_Private_KeyError, - .DeliverBlock = (void (*)(PP_Instance instance, PP_Resource decrypted_block, const struct PP_DecryptedBlockInfo* decrypted_block_info))&Pnacl_M31_PPB_ContentDecryptor_Private_DeliverBlock, - .DecoderInitializeDone = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id, PP_Bool success))&Pnacl_M31_PPB_ContentDecryptor_Private_DecoderInitializeDone, - .DecoderDeinitializeDone = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))&Pnacl_M31_PPB_ContentDecryptor_Private_DecoderDeinitializeDone, - .DecoderResetDone = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))&Pnacl_M31_PPB_ContentDecryptor_Private_DecoderResetDone, - .DeliverFrame = (void (*)(PP_Instance instance, PP_Resource decrypted_frame, const struct PP_DecryptedFrameInfo* decrypted_frame_info))&Pnacl_M31_PPB_ContentDecryptor_Private_DeliverFrame, - .DeliverSamples = (void (*)(PP_Instance instance, PP_Resource audio_frames, const struct PP_DecryptedSampleInfo* decrypted_sample_info))&Pnacl_M31_PPB_ContentDecryptor_Private_DeliverSamples +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_Ext_CrxFileSystem_Private_0_1 Pnacl_Wrappers_PPB_Ext_CrxFileSystem_Private_0_1 = { @@ -4902,6 +4837,14 @@ struct PPB_Flash_DRM_1_0 Pnacl_Wrappers_PPB_Flash_DRM_1_0 = { .GetVoucherFile = (int32_t (*)(PP_Resource drm, PP_Resource* file_ref, struct PP_CompletionCallback callback))&Pnacl_M29_PPB_Flash_DRM_GetVoucherFile }; +struct PPB_Flash_DRM_1_1 Pnacl_Wrappers_PPB_Flash_DRM_1_1 = { + .Create = (PP_Resource (*)(PP_Instance instance))&Pnacl_M33_PPB_Flash_DRM_Create, + .GetDeviceID = (int32_t (*)(PP_Resource drm, struct PP_Var* id, struct PP_CompletionCallback callback))&Pnacl_M33_PPB_Flash_DRM_GetDeviceID, + .GetHmonitor = (PP_Bool (*)(PP_Resource drm, int64_t* hmonitor))&Pnacl_M33_PPB_Flash_DRM_GetHmonitor, + .GetVoucherFile = (int32_t (*)(PP_Resource drm, PP_Resource* file_ref, struct PP_CompletionCallback callback))&Pnacl_M33_PPB_Flash_DRM_GetVoucherFile, + .MonitorIsExternal = (int32_t (*)(PP_Resource drm, PP_Bool* is_external, struct PP_CompletionCallback callback))&Pnacl_M33_PPB_Flash_DRM_MonitorIsExternal +}; + /* Not generating wrapper interface for PPB_Flash_FontFile_0_1 */ /* Not generating wrapper interface for PPB_FlashFullscreen_0_1 */ @@ -4933,6 +4876,10 @@ struct PPB_Instance_Private_0_1 Pnacl_Wrappers_PPB_Instance_Private_0_1 = { .ExecuteScript = (struct PP_Var (*)(PP_Instance instance, struct PP_Var script, struct PP_Var* exception))&Pnacl_M13_PPB_Instance_Private_ExecuteScript }; +struct PPB_IsolatedFileSystem_Private_0_2 Pnacl_Wrappers_PPB_IsolatedFileSystem_Private_0_2 = { + .Open = (int32_t (*)(PP_Instance instance, PP_IsolatedFileSystemType_Private type, PP_Resource* file_system, struct PP_CompletionCallback callback))&Pnacl_M33_PPB_IsolatedFileSystem_Private_Open +}; + struct PPB_NaCl_Private_1_0 Pnacl_Wrappers_PPB_NaCl_Private_1_0 = { .LaunchSelLdr = (PP_ExternalPluginResult (*)(PP_Instance instance, const char* alleged_url, PP_Bool uses_irt, PP_Bool uses_ppapi, PP_Bool enable_ppapi_dev, PP_Bool enable_dyncode_syscalls, PP_Bool enable_exception_handling, PP_Bool enable_crash_throttling, void* imc_handle, struct PP_Var* error_message))&Pnacl_M25_PPB_NaCl_Private_LaunchSelLdr, .StartPpapiProxy = (PP_ExternalPluginResult (*)(PP_Instance instance))&Pnacl_M25_PPB_NaCl_Private_StartPpapiProxy, @@ -4945,7 +4892,9 @@ struct PPB_NaCl_Private_1_0 Pnacl_Wrappers_PPB_NaCl_Private_1_0 = { .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 + .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, + .SetReadOnlyProperty = (void (*)(PP_Instance instance, struct PP_Var key, struct PP_Var value))&Pnacl_M25_PPB_NaCl_Private_SetReadOnlyProperty }; struct PPB_NetAddress_Private_0_1 Pnacl_Wrappers_PPB_NetAddress_Private_0_1 = { @@ -5067,6 +5016,18 @@ struct PPB_TCPSocket_Private_0_5 Pnacl_Wrappers_PPB_TCPSocket_Private_0_5 = { .SetOption = (int32_t (*)(PP_Resource tcp_socket, PP_TCPSocketOption_Private name, struct PP_Var value, struct PP_CompletionCallback callback))&Pnacl_M27_PPB_TCPSocket_Private_SetOption }; +struct PPB_Testing_Private_1_0 Pnacl_Wrappers_PPB_Testing_Private_1_0 = { + .ReadImageData = (PP_Bool (*)(PP_Resource device_context_2d, PP_Resource image, const struct PP_Point* top_left))&Pnacl_M33_PPB_Testing_Private_ReadImageData, + .RunMessageLoop = (void (*)(PP_Instance instance))&Pnacl_M33_PPB_Testing_Private_RunMessageLoop, + .QuitMessageLoop = (void (*)(PP_Instance instance))&Pnacl_M33_PPB_Testing_Private_QuitMessageLoop, + .GetLiveObjectsForInstance = (uint32_t (*)(PP_Instance instance))&Pnacl_M33_PPB_Testing_Private_GetLiveObjectsForInstance, + .IsOutOfProcess = (PP_Bool (*)(void))&Pnacl_M33_PPB_Testing_Private_IsOutOfProcess, + .SimulateInputEvent = (void (*)(PP_Instance instance, PP_Resource input_event))&Pnacl_M33_PPB_Testing_Private_SimulateInputEvent, + .GetDocumentURL = (struct PP_Var (*)(PP_Instance instance, struct PP_URLComponents_Dev* components))&Pnacl_M33_PPB_Testing_Private_GetDocumentURL, + .GetLiveVars = (uint32_t (*)(struct PP_Var live_vars[], uint32_t array_size))&Pnacl_M33_PPB_Testing_Private_GetLiveVars, + .SetMinimumArrayBufferSizeForShmem = (void (*)(PP_Instance instance, uint32_t threshold))&Pnacl_M33_PPB_Testing_Private_SetMinimumArrayBufferSizeForShmem +}; + struct PPB_UDPSocket_Private_0_2 Pnacl_Wrappers_PPB_UDPSocket_Private_0_2 = { .Create = (PP_Resource (*)(PP_Instance instance_id))&Pnacl_M17_PPB_UDPSocket_Private_Create, .IsUDPSocket = (PP_Bool (*)(PP_Resource resource_id))&Pnacl_M17_PPB_UDPSocket_Private_IsUDPSocket, @@ -5129,17 +5090,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_7 Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_7 = { - .Initialize = &Pnacl_M31_PPP_ContentDecryptor_Private_Initialize, - .GenerateKeyRequest = &Pnacl_M31_PPP_ContentDecryptor_Private_GenerateKeyRequest, - .AddKey = &Pnacl_M31_PPP_ContentDecryptor_Private_AddKey, - .CancelKeyRequest = &Pnacl_M31_PPP_ContentDecryptor_Private_CancelKeyRequest, - .Decrypt = &Pnacl_M31_PPP_ContentDecryptor_Private_Decrypt, - .InitializeAudioDecoder = &Pnacl_M31_PPP_ContentDecryptor_Private_InitializeAudioDecoder, - .InitializeVideoDecoder = &Pnacl_M31_PPP_ContentDecryptor_Private_InitializeVideoDecoder, - .DeinitializeDecoder = &Pnacl_M31_PPP_ContentDecryptor_Private_DeinitializeDecoder, - .ResetDecoder = &Pnacl_M31_PPP_ContentDecryptor_Private_ResetDecoder, - .DecryptAndDecode = &Pnacl_M31_PPP_ContentDecryptor_Private_DecryptAndDecode +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 }; /* Not generating wrapper interface for PPP_Flash_BrowserOperations_1_0 */ @@ -5506,24 +5467,6 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Printing_Dev_0_7 = { .real_iface = NULL }; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Testing_Dev_0_9 = { - .iface_macro = PPB_TESTING_DEV_INTERFACE_0_9, - .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_Testing_Dev_0_9, - .real_iface = NULL -}; - -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Testing_Dev_0_91 = { - .iface_macro = PPB_TESTING_DEV_INTERFACE_0_91, - .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_Testing_Dev_0_91, - .real_iface = NULL -}; - -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Testing_Dev_0_92 = { - .iface_macro = PPB_TESTING_DEV_INTERFACE_0_92, - .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_Testing_Dev_0_92, - .real_iface = NULL -}; - static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TrueTypeFont_Dev_0_1 = { .iface_macro = PPB_TRUETYPEFONT_DEV_INTERFACE_0_1, .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_TrueTypeFont_Dev_0_1, @@ -5572,9 +5515,9 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_Selection_Dev_0_3 = { .real_iface = NULL }; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_7 = { - .iface_macro = PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_7, - .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_ContentDecryptor_Private_0_7, +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, .real_iface = NULL }; @@ -5644,6 +5587,12 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_DRM_1_0 = { .real_iface = NULL }; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_DRM_1_1 = { + .iface_macro = PPB_FLASH_DRM_INTERFACE_1_1, + .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_Flash_DRM_1_1, + .real_iface = NULL +}; + static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Flash_Menu_0_2 = { .iface_macro = PPB_FLASH_MENU_INTERFACE_0_2, .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_Flash_Menu_0_2, @@ -5662,6 +5611,12 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Instance_Private_0_1 = { .real_iface = NULL }; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_IsolatedFileSystem_Private_0_2 = { + .iface_macro = PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE_0_2, + .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_IsolatedFileSystem_Private_0_2, + .real_iface = NULL +}; + static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_NaCl_Private_1_0 = { .iface_macro = PPB_NACL_PRIVATE_INTERFACE_1_0, .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_NaCl_Private_1_0, @@ -5740,6 +5695,12 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_TCPSocket_Private_0_5 = { .real_iface = NULL }; +static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_Testing_Private_1_0 = { + .iface_macro = PPB_TESTING_PRIVATE_INTERFACE_1_0, + .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_Testing_Private_1_0, + .real_iface = NULL +}; + static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_2 = { .iface_macro = PPB_UDPSOCKET_PRIVATE_INTERFACE_0_2, .wrapped_iface = (void *) &Pnacl_Wrappers_PPB_UDPSocket_Private_0_2, @@ -5782,9 +5743,9 @@ static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPB_X509Certificate_Private_0 .real_iface = NULL }; -static struct __PnaclWrapperInfo Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_7 = { - .iface_macro = PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_7, - .wrapped_iface = (void *) &Pnacl_Wrappers_PPP_ContentDecryptor_Private_0_7, +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, .real_iface = NULL }; @@ -5868,9 +5829,6 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = { &Pnacl_WrapperInfo_PPB_IMEInputEvent_Dev_0_2, &Pnacl_WrapperInfo_PPB_KeyboardInputEvent_Dev_0_2, &Pnacl_WrapperInfo_PPB_Printing_Dev_0_7, - &Pnacl_WrapperInfo_PPB_Testing_Dev_0_9, - &Pnacl_WrapperInfo_PPB_Testing_Dev_0_91, - &Pnacl_WrapperInfo_PPB_Testing_Dev_0_92, &Pnacl_WrapperInfo_PPB_TrueTypeFont_Dev_0_1, &Pnacl_WrapperInfo_PPB_URLUtil_Dev_0_6, &Pnacl_WrapperInfo_PPB_URLUtil_Dev_0_7, @@ -5878,7 +5836,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_7, + &Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_8, &Pnacl_WrapperInfo_PPB_Ext_CrxFileSystem_Private_0_1, &Pnacl_WrapperInfo_PPB_FileIO_Private_0_1, &Pnacl_WrapperInfo_PPB_FileRefPrivate_0_1, @@ -5890,9 +5848,11 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = { &Pnacl_WrapperInfo_PPB_Flash_Clipboard_5_0, &Pnacl_WrapperInfo_PPB_Flash_DeviceID_1_0, &Pnacl_WrapperInfo_PPB_Flash_DRM_1_0, + &Pnacl_WrapperInfo_PPB_Flash_DRM_1_1, &Pnacl_WrapperInfo_PPB_Flash_Menu_0_2, &Pnacl_WrapperInfo_PPB_HostResolver_Private_0_1, &Pnacl_WrapperInfo_PPB_Instance_Private_0_1, + &Pnacl_WrapperInfo_PPB_IsolatedFileSystem_Private_0_2, &Pnacl_WrapperInfo_PPB_NaCl_Private_1_0, &Pnacl_WrapperInfo_PPB_NetAddress_Private_0_1, &Pnacl_WrapperInfo_PPB_NetAddress_Private_1_0, @@ -5906,6 +5866,7 @@ static struct __PnaclWrapperInfo *s_ppb_wrappers[] = { &Pnacl_WrapperInfo_PPB_TCPSocket_Private_0_3, &Pnacl_WrapperInfo_PPB_TCPSocket_Private_0_4, &Pnacl_WrapperInfo_PPB_TCPSocket_Private_0_5, + &Pnacl_WrapperInfo_PPB_Testing_Private_1_0, &Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_2, &Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_3, &Pnacl_WrapperInfo_PPB_UDPSocket_Private_0_4, @@ -5923,7 +5884,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_7, + &Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_8, &Pnacl_WrapperInfo_PPP_Instance_Private_0_1, NULL }; diff --git a/ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_support_extension.gyp b/ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_support_extension.gyp index e290eaea07..dfd8349675 100644 --- a/ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_support_extension.gyp +++ b/ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_support_extension.gyp @@ -39,7 +39,6 @@ 'outputs': [ '<(PRODUCT_DIR)/pnacl/pnacl_public_pnacl_json', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_crtbegin_o', - '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_crtbeginS_o', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_ld_nexe', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_libcrt_platform_a', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_libgcc_a', @@ -47,7 +46,6 @@ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_libpnacl_irt_shim_a', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_pnacl_llc_nexe', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_crtbegin_o', - '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_crtbeginS_o', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_ld_nexe', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_libcrt_platform_a', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_libgcc_a', @@ -74,7 +72,6 @@ 'outputs': [ '<(PRODUCT_DIR)/pnacl/pnacl_public_pnacl_json', '<(PRODUCT_DIR)/pnacl/pnacl_public_arm_crtbegin_o', - '<(PRODUCT_DIR)/pnacl/pnacl_public_arm_crtbeginS_o', '<(PRODUCT_DIR)/pnacl/pnacl_public_arm_ld_nexe', '<(PRODUCT_DIR)/pnacl/pnacl_public_arm_libcrt_platform_a', '<(PRODUCT_DIR)/pnacl/pnacl_public_arm_libgcc_a', @@ -96,7 +93,6 @@ 'outputs': [ '<(PRODUCT_DIR)/pnacl/pnacl_public_pnacl_json', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_crtbegin_o', - '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_crtbeginS_o', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_ld_nexe', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_libcrt_platform_a', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_libgcc_a', @@ -118,7 +114,6 @@ 'outputs': [ '<(PRODUCT_DIR)/pnacl/pnacl_public_pnacl_json', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_crtbegin_o', - '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_crtbeginS_o', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_ld_nexe', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_libcrt_platform_a', '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_libgcc_a', diff --git a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc index 38ccf10851..ea5a39f501 100644 --- a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc +++ b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc @@ -6,7 +6,6 @@ #include "ppapi/c/dev/ppb_font_dev.h" #include "ppapi/c/dev/ppb_memory_dev.h" -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/dev/ppb_var_deprecated.h" #include "ppapi/c/ppb_audio.h" #include "ppapi/c/ppb_audio_config.h" @@ -28,6 +27,7 @@ #include "ppapi/c/ppb_url_response_info.h" #include "ppapi/c/ppb_var.h" #include "ppapi/c/ppb_view.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h" #include "ppapi/native_client/tests/ppapi_test_lib/internal_utils.h" @@ -171,10 +171,9 @@ const PPB_Memory_Dev* PPBMemoryDev() { GetBrowserInterface(PPB_MEMORY_DEV_INTERFACE)); } -const PPB_Testing_Dev* PPBTestingDev() { - return reinterpret_cast<const PPB_Testing_Dev*>( - // Change to GetBrowserInterfaceSafe when moving out of dev. - GetBrowserInterface(PPB_TESTING_DEV_INTERFACE)); +const PPB_Testing_Private* PPBTestingPrivate() { + return reinterpret_cast<const PPB_Testing_Private*>( + GetBrowserInterface(PPB_TESTING_PRIVATE_INTERFACE)); } const PPB_View* PPBView() { diff --git a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h index 82eae1c4bc..c0aa389d71 100644 --- a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h +++ b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h @@ -30,7 +30,7 @@ #include "ppapi/c/ppb_view.h" #include "ppapi/c/dev/ppb_font_dev.h" #include "ppapi/c/dev/ppb_memory_dev.h" -#include "ppapi/c/dev/ppb_testing_dev.h" +#include "ppapi/c/private/ppb_testing_private.h" // Looks up the interface and returns its pointer or NULL. const void* GetBrowserInterface(const char* interface_name); @@ -73,6 +73,12 @@ const PPB_WheelInputEvent* PPBWheelInputEvent(); const PPB_Font_Dev* PPBFontDev(); const PPB_Memory_Dev* PPBMemoryDev(); -const PPB_Testing_Dev* PPBTestingDev(); + +// +// Private interfaces. +// Lookup returns NULL if the interface is not available. +// + +const PPB_Testing_Private* PPBTestingPrivate(); #endif // NATIVE_CLIENT_TESTS_PPAPI_TEST_PPB_TEMPLATE_GET_BROWSER_INTERFACE_H diff --git a/ppapi/native_client/tests/ppapi_test_lib/test_interface.cc b/ppapi/native_client/tests/ppapi_test_lib/test_interface.cc index 374ca79adc..4cc7952c53 100644 --- a/ppapi/native_client/tests/ppapi_test_lib/test_interface.cc +++ b/ppapi/native_client/tests/ppapi_test_lib/test_interface.cc @@ -22,7 +22,7 @@ #include "ppapi/c/ppb_instance.h" #include "ppapi/c/ppb_messaging.h" #include "ppapi/c/ppb_var.h" -#include "ppapi/c/dev/ppb_testing_dev.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h" #include "ppapi/native_client/tests/ppapi_test_lib/internal_utils.h" @@ -224,7 +224,8 @@ bool IsImageRectOnScreen(PP_Resource graphics2d, (origin.x + size.width) <= stride && (origin.y + size.height) <= image_desc.size.height); - CHECK(PP_TRUE == PPBTestingDev()->ReadImageData(graphics2d, image, &kOrigin)); + CHECK(PP_TRUE == PPBTestingPrivate()->ReadImageData( + graphics2d, image, &kOrigin)); bool found_error = false; for (int y = origin.y; y < origin.y + size.height && !found_error; y++) { for (int x = origin.x; x < origin.x + size.width && !found_error; x++) { diff --git a/ppapi/native_client/tests/ppapi_test_lib/testable_callback.cc b/ppapi/native_client/tests/ppapi_test_lib/testable_callback.cc index 6f65b6615d..f353d536e2 100644 --- a/ppapi/native_client/tests/ppapi_test_lib/testable_callback.cc +++ b/ppapi/native_client/tests/ppapi_test_lib/testable_callback.cc @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/pp_errors.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h" #include "ppapi/native_client/tests/ppapi_test_lib/testable_callback.h" @@ -23,7 +23,7 @@ int32_t TestableCallback::WaitForResult() { // This waits until PPBTestingDev()->QuitMessageLoop() is called // by the "Handler" which represents the actual callback code. - PPBTestingDev()->RunMessageLoop(instance_); + PPBTestingPrivate()->RunMessageLoop(instance_); } have_result_ = false; return result_; @@ -48,6 +48,6 @@ void TestableCallback::Handler(void* user_data, int32_t result) { ++callback->run_count_; if (callback->post_quit_task_) { callback->post_quit_task_ = false; - PPBTestingDev()->QuitMessageLoop(callback->instance_); + PPBTestingPrivate()->QuitMessageLoop(callback->instance_); } } diff --git a/ppapi/native_client/tools/browser_tester/browser_tester.py b/ppapi/native_client/tools/browser_tester/browser_tester.py index e22bfde299..844956d7b3 100755 --- a/ppapi/native_client/tools/browser_tester/browser_tester.py +++ b/ppapi/native_client/tools/browser_tester/browser_tester.py @@ -14,9 +14,9 @@ import urllib # Allow the import of third party modules script_dir = os.path.dirname(os.path.abspath(__file__)) -sys.path.append(os.path.join(script_dir, '../../../../third_party/')) -sys.path.append(os.path.join(script_dir, '../../../../tools/valgrind/')) -sys.path.append(os.path.join(script_dir, '../../../../testing/')) +sys.path.insert(0, os.path.join(script_dir, '../../../../third_party/')) +sys.path.insert(0, os.path.join(script_dir, '../../../../tools/valgrind/')) +sys.path.insert(0, os.path.join(script_dir, '../../../../testing/')) import browsertester.browserlauncher import browsertester.rpclistener @@ -298,6 +298,8 @@ def RunTestsOnce(url, options): else: err += '\nThe test probably did not get a callback that it expected.' listener.ServerError(err) + if not server.received_request: + raise RetryTest('Chrome hung before running the test.') break elif not options.interactive and HardTimeout(options.hard_timeout): listener.ServerError('The test took over %.1f seconds. This is ' @@ -356,6 +358,17 @@ def Run(url, options): while True: try: result = RunTestsOnce(url, options) + if result: + # Currently (2013/11/15) nacl_integration is fairly flaky and there is + # not enough time to look into it. Retry if the test fails for any + # reason. Note that in general this test runner tries to only retry + # when a known flake is encountered. (See the other raise + # RetryTest(..)s in this file.) This blanket retry means that those + # other cases could be removed without changing the behavior of the test + # runner, but it is hoped that this blanket retry will eventually be + # unnecessary and subsequently removed. The more precise retries have + # been left in place to preserve the knowledge. + raise RetryTest('HACK retrying failed test.') break except RetryTest: # Only retry once. diff --git a/ppapi/native_client/tools/browser_tester/browsertester/browserlauncher.py b/ppapi/native_client/tools/browser_tester/browsertester/browserlauncher.py index c27ece5d60..36b8c2ab2b 100755 --- a/ppapi/native_client/tools/browser_tester/browsertester/browserlauncher.py +++ b/ppapi/native_client/tools/browser_tester/browsertester/browserlauncher.py @@ -265,9 +265,10 @@ class ChromeLauncher(BrowserLauncher): def MakeCmd(self, url, host, port): cmd = [self.binary, - # Note that we do not use "--enable-logging" here because - # it actually turns off logging to the Buildbot logs on - # Windows (see http://crbug.com/169941). + # --enable-logging enables stderr output from Chromium subprocesses + # on Windows (see + # https://code.google.com/p/chromium/issues/detail?id=171836) + '--enable-logging', '--disable-web-resources', '--disable-preconnect', # This is speculative, sync should not occur with a clean profile. diff --git a/ppapi/ppapi_proxy.gypi b/ppapi/ppapi_proxy.gypi index c078ef19ec..9246e2a9fe 100644 --- a/ppapi/ppapi_proxy.gypi +++ b/ppapi/ppapi_proxy.gypi @@ -35,8 +35,6 @@ 'proxy/enter_proxy.h', 'proxy/error_conversion.cc', 'proxy/error_conversion.h', - 'proxy/ext_crx_file_system_private_resource.cc', - 'proxy/ext_crx_file_system_private_resource.h', 'proxy/extensions_common_resource.cc', 'proxy/extensions_common_resource.h', 'proxy/file_chooser_resource.cc', @@ -79,6 +77,8 @@ 'proxy/interface_list.h', 'proxy/interface_proxy.cc', 'proxy/interface_proxy.h', + 'proxy/isolated_file_system_private_resource.cc', + 'proxy/isolated_file_system_private_resource.h', 'proxy/locking_resource_releaser.h', 'proxy/net_address_resource.cc', 'proxy/net_address_resource.h', diff --git a/ppapi/ppapi_shared.gypi b/ppapi/ppapi_shared.gypi index 8fe3c07ccf..a4b8267d64 100644 --- a/ppapi/ppapi_shared.gypi +++ b/ppapi/ppapi_shared.gypi @@ -27,6 +27,8 @@ 'shared_impl/file_ref_create_info.h', 'shared_impl/file_ref_util.cc', 'shared_impl/file_ref_util.h', + 'shared_impl/file_system_util.cc', + 'shared_impl/file_system_util.h', 'shared_impl/file_type_conversion.cc', 'shared_impl/file_type_conversion.h', 'shared_impl/flash_clipboard_format_registry.cc', @@ -148,7 +150,6 @@ '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_api.h', 'thunk/ppb_ext_crx_file_system_private_thunk.cc', 'thunk/ppb_ext_socket_thunk.cc', 'thunk/ppb_file_chooser_api.h', @@ -200,6 +201,8 @@ 'thunk/ppb_instance_api.h', 'thunk/ppb_instance_private_thunk.cc', 'thunk/ppb_instance_thunk.cc', + 'thunk/ppb_isolated_file_system_private_api.h', + 'thunk/ppb_isolated_file_system_private_thunk.cc', 'thunk/ppb_message_loop_api.h', 'thunk/ppb_messaging_thunk.cc', 'thunk/ppb_mouse_cursor_thunk.cc', diff --git a/ppapi/ppapi_sources.gypi b/ppapi/ppapi_sources.gypi index 52d8e00523..abbedb8f6d 100644 --- a/ppapi/ppapi_sources.gypi +++ b/ppapi/ppapi_sources.gypi @@ -82,7 +82,6 @@ 'c/dev/ppb_printing_dev.h', 'c/dev/ppb_resource_array_dev.h', 'c/dev/ppb_scrollbar_dev.h', - 'c/dev/ppb_testing_dev.h', 'c/dev/ppb_text_input_dev.h', 'c/dev/ppb_truetype_font_dev.h', 'c/dev/ppb_url_util_dev.h', @@ -114,13 +113,14 @@ 'c/private/ppb_flash_message_loop.h', 'c/private/ppb_host_resolver_private.h', 'c/private/ppb_instance_private.h', + 'c/private/ppb_isolated_file_system_private.h', 'c/private/ppb_nacl_private.h', 'c/private/ppb_net_address_private.h', 'c/private/ppb_output_protection_private.h', 'c/private/ppb_pdf.h', 'c/private/ppb_platform_verification_private.h', 'c/private/ppb_proxy_private.h', - 'c/private/ppp_instance_private.h', + 'c/private/ppb_testing_private.h', 'c/private/ppb_tcp_server_socket_private.h', 'c/private/ppb_tcp_socket_private.h', 'c/private/ppb_udp_socket_private.h', @@ -128,6 +128,7 @@ 'c/private/ppb_video_source_private.h', 'c/private/ppb_x509_certificate_private.h', 'c/private/ppp_content_decryptor_private.h', + 'c/private/ppp_instance_private.h', # Deprecated interfaces. 'c/dev/deprecated_bool.h', @@ -322,6 +323,8 @@ 'cpp/private/host_resolver_private.h', 'cpp/private/instance_private.cc', 'cpp/private/instance_private.h', + 'cpp/private/isolated_file_system_private.cc', + 'cpp/private/isolated_file_system_private.h', 'cpp/private/net_address_private.cc', 'cpp/private/net_address_private.h', 'cpp/private/output_protection_private.cc', diff --git a/ppapi/proxy/file_io_resource.cc b/ppapi/proxy/file_io_resource.cc index 09432f876c..f46cc1758b 100644 --- a/ppapi/proxy/file_io_resource.cc +++ b/ppapi/proxy/file_io_resource.cc @@ -10,6 +10,8 @@ #include "ppapi/c/pp_errors.h" #include "ppapi/proxy/ppapi_messages.h" #include "ppapi/shared_impl/array_writer.h" +#include "ppapi/shared_impl/file_ref_create_info.h" +#include "ppapi/shared_impl/file_system_util.h" #include "ppapi/shared_impl/file_type_conversion.h" #include "ppapi/shared_impl/ppapi_globals.h" #include "ppapi/shared_impl/proxy_lock.h" @@ -96,21 +98,22 @@ int32_t FileIOResource::Open(PP_Resource file_ref, return PP_ERROR_BADRESOURCE; PPB_FileRef_API* file_ref_api = enter.object(); - PP_FileSystemType type = file_ref_api->GetFileSystemType(); - if (type != PP_FILESYSTEMTYPE_LOCALPERSISTENT && - type != PP_FILESYSTEMTYPE_LOCALTEMPORARY && - type != PP_FILESYSTEMTYPE_EXTERNAL && - type != PP_FILESYSTEMTYPE_ISOLATED) { + const FileRefCreateInfo& create_info = file_ref_api->GetCreateInfo(); + if (!FileSystemTypeIsValid(create_info.file_system_type)) { NOTREACHED(); return PP_ERROR_FAILED; } - file_system_type_ = type; int32_t rv = state_manager_.CheckOperationState( FileIOStateManager::OPERATION_EXCLUSIVE, false); if (rv != PP_OK) return rv; + file_system_type_ = create_info.file_system_type; + // Keep the FileSystem host alive by taking a reference to its resource. The + // FileIO host uses the FileSystem host for running tasks. + file_system_resource_ = create_info.file_system_plugin_resource; + // Take a reference on the FileRef resource while we're opening the file; we // don't want the plugin destroying it during the Open operation. file_ref_ = enter.resource(); diff --git a/ppapi/proxy/file_io_resource.h b/ppapi/proxy/file_io_resource.h index 5fc6370de3..ee19848cea 100644 --- a/ppapi/proxy/file_io_resource.h +++ b/ppapi/proxy/file_io_resource.h @@ -15,6 +15,7 @@ #include "ppapi/proxy/ppapi_proxy_export.h" #include "ppapi/shared_impl/file_io_state_manager.h" #include "ppapi/shared_impl/resource.h" +#include "ppapi/shared_impl/scoped_pp_resource.h" #include "ppapi/thunk/ppb_file_io_api.h" namespace ppapi { @@ -163,6 +164,7 @@ class PPAPI_PROXY_EXPORT FileIOResource scoped_refptr<FileHandleHolder> file_handle_; PP_FileSystemType file_system_type_; + ScopedPPResource file_system_resource_; FileIOStateManager state_manager_; scoped_refptr<Resource> file_ref_; diff --git a/ppapi/proxy/file_system_resource.cc b/ppapi/proxy/file_system_resource.cc index af1928b4c6..df8c390775 100644 --- a/ppapi/proxy/file_system_resource.cc +++ b/ppapi/proxy/file_system_resource.cc @@ -21,7 +21,8 @@ FileSystemResource::FileSystemResource(Connection connection, : PluginResource(connection, instance), type_(type), called_open_(false), - callback_count_(0) { + callback_count_(0), + callback_result_(PP_OK) { DCHECK(type_ != PP_FILESYSTEMTYPE_INVALID); SendCreate(RENDERER, PpapiHostMsg_FileSystem_Create(type_)); SendCreate(BROWSER, PpapiHostMsg_FileSystem_Create(type_)); @@ -34,7 +35,9 @@ FileSystemResource::FileSystemResource(Connection connection, PP_FileSystemType type) : PluginResource(connection, instance), type_(type), - called_open_(true) { + called_open_(true), + callback_count_(0), + callback_result_(PP_OK) { DCHECK(type_ != PP_FILESYSTEMTYPE_INVALID); AttachToPendingHost(RENDERER, pending_renderer_id); AttachToPendingHost(BROWSER, pending_browser_id); @@ -73,6 +76,7 @@ PP_FileSystemType FileSystemResource::GetType() { int32_t FileSystemResource::InitIsolatedFileSystem( const std::string& fsid, + PP_IsolatedFileSystemType_Private type, const base::Callback<void(int32_t)>& callback) { // This call is mutually exclusive with Open() above, so we can reuse the // called_open state. @@ -82,12 +86,12 @@ int32_t FileSystemResource::InitIsolatedFileSystem( called_open_ = true; Call<PpapiPluginMsg_FileSystem_InitIsolatedFileSystemReply>(RENDERER, - PpapiHostMsg_FileSystem_InitIsolatedFileSystem(fsid), + PpapiHostMsg_FileSystem_InitIsolatedFileSystem(fsid, type), base::Bind(&FileSystemResource::InitIsolatedFileSystemComplete, this, callback)); Call<PpapiPluginMsg_FileSystem_InitIsolatedFileSystemReply>(BROWSER, - PpapiHostMsg_FileSystem_InitIsolatedFileSystem(fsid), + PpapiHostMsg_FileSystem_InitIsolatedFileSystem(fsid, type), base::Bind(&FileSystemResource::InitIsolatedFileSystemComplete, this, callback)); @@ -98,18 +102,24 @@ void FileSystemResource::OpenComplete( scoped_refptr<TrackedCallback> callback, const ResourceMessageReplyParams& params) { ++callback_count_; + // Prioritize worse result since only one status can be returned. + if (params.result() != PP_OK) + callback_result_ = params.result(); // Received callback from browser and renderer. if (callback_count_ == 2) - callback->Run(params.result()); + callback->Run(callback_result_); } void FileSystemResource::InitIsolatedFileSystemComplete( const base::Callback<void(int32_t)>& callback, const ResourceMessageReplyParams& params) { ++callback_count_; + // Prioritize worse result since only one status can be returned. + if (params.result() != PP_OK) + callback_result_ = params.result(); // Received callback from browser and renderer. if (callback_count_ == 2) - callback.Run(params.result()); + callback.Run(callback_result_); } } // namespace proxy diff --git a/ppapi/proxy/file_system_resource.h b/ppapi/proxy/file_system_resource.h index a716434333..9029583c81 100644 --- a/ppapi/proxy/file_system_resource.h +++ b/ppapi/proxy/file_system_resource.h @@ -9,6 +9,7 @@ #include "base/memory/ref_counted.h" #include "ppapi/c/pp_file_info.h" +#include "ppapi/c/private/ppb_isolated_file_system_private.h" #include "ppapi/proxy/connection.h" #include "ppapi/proxy/plugin_resource.h" #include "ppapi/proxy/ppapi_proxy_export.h" @@ -49,6 +50,7 @@ class PPAPI_PROXY_EXPORT FileSystemResource virtual PP_FileSystemType GetType() OVERRIDE; int32_t InitIsolatedFileSystem(const std::string& fsid, + PP_IsolatedFileSystemType_Private type, const base::Callback<void(int32_t)>& callback); private: // Called when the host has responded to our open request. @@ -63,6 +65,7 @@ class PPAPI_PROXY_EXPORT FileSystemResource PP_FileSystemType type_; bool called_open_; uint32_t callback_count_; + int32_t callback_result_; DISALLOW_COPY_AND_ASSIGN(FileSystemResource); }; diff --git a/ppapi/proxy/flash_drm_resource.cc b/ppapi/proxy/flash_drm_resource.cc index 889aa72b45..8c80c5912b 100644 --- a/ppapi/proxy/flash_drm_resource.cc +++ b/ppapi/proxy/flash_drm_resource.cc @@ -71,6 +71,22 @@ int32_t FlashDRMResource::GetVoucherFile( return PP_OK_COMPLETIONPENDING; } +int32_t FlashDRMResource::MonitorIsExternal( + PP_Bool* is_external, + scoped_refptr<TrackedCallback> callback) { + if (!is_external) + return PP_ERROR_BADARGUMENT; + + *is_external = PP_FALSE; + + Call<PpapiPluginMsg_FlashDRM_MonitorIsExternalReply>( + BROWSER, + PpapiHostMsg_FlashDRM_MonitorIsExternal(), + base::Bind(&FlashDRMResource::OnPluginMsgMonitorIsExternalReply, this, + is_external, callback)); + return PP_OK_COMPLETIONPENDING; +} + void FlashDRMResource::OnPluginMsgGetDeviceIDReply( PP_Var* dest, scoped_refptr<TrackedCallback> callback, @@ -99,5 +115,17 @@ void FlashDRMResource::OnPluginMsgGetVoucherFileReply( } } +void FlashDRMResource::OnPluginMsgMonitorIsExternalReply( + PP_Bool* dest, + scoped_refptr<TrackedCallback> callback, + const ResourceMessageReplyParams& params, + PP_Bool is_external) { + if (TrackedCallback::IsPending(callback)) { + if (params.result() == PP_OK) + *dest = is_external; + callback->Run(params.result()); + } +} + } // namespace proxy } // namespace ppapi diff --git a/ppapi/proxy/flash_drm_resource.h b/ppapi/proxy/flash_drm_resource.h index 9a4b31c941..dd2b599c1c 100644 --- a/ppapi/proxy/flash_drm_resource.h +++ b/ppapi/proxy/flash_drm_resource.h @@ -35,6 +35,9 @@ class FlashDRMResource virtual int32_t GetVoucherFile( PP_Resource* file_ref, scoped_refptr<TrackedCallback> callback) OVERRIDE; + virtual int32_t MonitorIsExternal( + PP_Bool* is_external, + scoped_refptr<TrackedCallback> callback) OVERRIDE; private: void OnPluginMsgGetDeviceIDReply(PP_Var* dest, @@ -45,6 +48,11 @@ class FlashDRMResource scoped_refptr<TrackedCallback> callback, const ResourceMessageReplyParams& params, const FileRefCreateInfo& file_info); + void OnPluginMsgMonitorIsExternalReply( + PP_Bool* dest, + scoped_refptr<TrackedCallback> callback, + const ResourceMessageReplyParams& params, + PP_Bool is_external); DISALLOW_COPY_AND_ASSIGN(FlashDRMResource); }; diff --git a/ppapi/proxy/graphics_2d_resource.cc b/ppapi/proxy/graphics_2d_resource.cc index 3bad2e4e13..f545364f1e 100644 --- a/ppapi/proxy/graphics_2d_resource.cc +++ b/ppapi/proxy/graphics_2d_resource.cc @@ -11,6 +11,7 @@ #include "ppapi/c/pp_size.h" #include "ppapi/c/ppb_graphics_2d.h" #include "ppapi/proxy/dispatch_reply_message.h" +#include "ppapi/proxy/plugin_dispatcher.h" #include "ppapi/proxy/ppapi_messages.h" #include "ppapi/shared_impl/ppapi_globals.h" #include "ppapi/shared_impl/resource_tracker.h" @@ -111,6 +112,15 @@ float Graphics2DResource::GetScale() { return scale_; } +void Graphics2DResource::SetOffset(const PP_Point* offset) { + Post(RENDERER, PpapiHostMsg_Graphics2D_SetOffset(*offset)); +} + +void Graphics2DResource::SetResizeMode( + PP_Graphics2D_Dev_ResizeMode resize_mode) { + Post(RENDERER, PpapiHostMsg_Graphics2D_SetResizeMode(resize_mode)); +} + int32_t Graphics2DResource::Flush(scoped_refptr<TrackedCallback> callback) { // If host is not even created, return failure immediately. This can happen // when failed to initialize (in constructor). @@ -121,9 +131,20 @@ int32_t Graphics2DResource::Flush(scoped_refptr<TrackedCallback> callback) { return PP_ERROR_INPROGRESS; // Can't have >1 flush pending. current_flush_callback_ = callback; + // Send the current view data with the Flush() message. This allows the + // renderer to know what the plugin's view of the renderer is at the time + // Flush was called. + PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance( + pp_instance()); + ppapi::ViewData view_data; + if (dispatcher) { + InstanceData* data = dispatcher->GetInstanceData(pp_instance()); + if (data) + view_data = data->view; + } Call<PpapiPluginMsg_Graphics2D_FlushAck>( RENDERER, - PpapiHostMsg_Graphics2D_Flush(), + PpapiHostMsg_Graphics2D_Flush(view_data), base::Bind(&Graphics2DResource::OnPluginMsgFlushACK, this)); return PP_OK_COMPLETIONPENDING; } diff --git a/ppapi/proxy/graphics_2d_resource.h b/ppapi/proxy/graphics_2d_resource.h index b7ec30c710..93d182b65a 100644 --- a/ppapi/proxy/graphics_2d_resource.h +++ b/ppapi/proxy/graphics_2d_resource.h @@ -40,6 +40,8 @@ class PPAPI_PROXY_EXPORT Graphics2DResource virtual void ReplaceContents(PP_Resource image_data) OVERRIDE; virtual PP_Bool SetScale(float scale) OVERRIDE; virtual float GetScale() OVERRIDE; + virtual void SetOffset(const PP_Point* offset) OVERRIDE; + virtual void SetResizeMode(PP_Graphics2D_Dev_ResizeMode resize_mode) OVERRIDE; virtual int32_t Flush(scoped_refptr<TrackedCallback> callback) OVERRIDE; virtual bool ReadImageData(PP_Resource image, const PP_Point* top_left) OVERRIDE; diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc index 00022bfb10..f609855242 100644 --- a/ppapi/proxy/interface_list.cc +++ b/ppapi/proxy/interface_list.cc @@ -21,7 +21,6 @@ #include "ppapi/c/dev/ppb_opengles2ext_dev.h" #include "ppapi/c/dev/ppb_printing_dev.h" #include "ppapi/c/dev/ppb_resource_array_dev.h" -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/dev/ppb_text_input_dev.h" #include "ppapi/c/dev/ppb_trace_event_dev.h" #include "ppapi/c/dev/ppb_truetype_font_dev.h" @@ -81,6 +80,7 @@ #include "ppapi/c/private/ppb_flash_message_loop.h" #include "ppapi/c/private/ppb_flash_print.h" #include "ppapi/c/private/ppb_host_resolver_private.h" +#include "ppapi/c/private/ppb_isolated_file_system_private.h" #include "ppapi/c/private/ppb_net_address_private.h" #include "ppapi/c/private/ppb_output_protection_private.h" #include "ppapi/c/private/ppb_pdf.h" @@ -88,6 +88,7 @@ #include "ppapi/c/private/ppb_talk_private.h" #include "ppapi/c/private/ppb_tcp_server_socket_private.h" #include "ppapi/c/private/ppb_tcp_socket_private.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/c/private/ppb_udp_socket_private.h" #include "ppapi/c/private/ppb_video_destination_private.h" #include "ppapi/c/private/ppb_video_source_private.h" diff --git a/ppapi/proxy/ext_crx_file_system_private_resource.cc b/ppapi/proxy/isolated_file_system_private_resource.cc index be4c3f7bbd..756bdb7bd6 100644 --- a/ppapi/proxy/ext_crx_file_system_private_resource.cc +++ b/ppapi/proxy/isolated_file_system_private_resource.cc @@ -1,10 +1,11 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// 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 "ppapi/proxy/ext_crx_file_system_private_resource.h" +#include "ppapi/proxy/isolated_file_system_private_resource.h" #include "base/bind.h" +#include "base/logging.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/pp_file_info.h" #include "ppapi/proxy/file_system_resource.h" @@ -24,40 +25,37 @@ void RunTrackedCallback(scoped_refptr<TrackedCallback> callback, } } // namespace -ExtCrxFileSystemPrivateResource::ExtCrxFileSystemPrivateResource( +IsolatedFileSystemPrivateResource::IsolatedFileSystemPrivateResource( Connection connection, PP_Instance instance) - : PluginResource(connection, instance), called_open_(false) { - SendCreate(BROWSER, PpapiHostMsg_Ext_CrxFileSystem_Create()); + : PluginResource(connection, instance) { + SendCreate(BROWSER, PpapiHostMsg_IsolatedFileSystem_Create()); } -ExtCrxFileSystemPrivateResource::~ExtCrxFileSystemPrivateResource() { +IsolatedFileSystemPrivateResource::~IsolatedFileSystemPrivateResource() { } -thunk::PPB_Ext_CrxFileSystem_Private_API* -ExtCrxFileSystemPrivateResource::AsPPB_Ext_CrxFileSystem_Private_API() { +thunk::PPB_IsolatedFileSystem_Private_API* +IsolatedFileSystemPrivateResource::AsPPB_IsolatedFileSystem_Private_API() { return this; } -int32_t ExtCrxFileSystemPrivateResource::Open( +int32_t IsolatedFileSystemPrivateResource::Open( PP_Instance /* unused */, + PP_IsolatedFileSystemType_Private type, PP_Resource* file_system_resource, scoped_refptr<TrackedCallback> callback) { - if (called_open_) - return PP_ERROR_FAILED; - called_open_ = true; - if (!file_system_resource) return PP_ERROR_BADARGUMENT; - Call<PpapiPluginMsg_Ext_CrxFileSystem_BrowserOpenReply>(BROWSER, - PpapiHostMsg_Ext_CrxFileSystem_BrowserOpen(), - base::Bind(&ExtCrxFileSystemPrivateResource::OnBrowserOpenComplete, this, - file_system_resource, - callback)); + Call<PpapiPluginMsg_IsolatedFileSystem_BrowserOpenReply>(BROWSER, + PpapiHostMsg_IsolatedFileSystem_BrowserOpen(type), + base::Bind(&IsolatedFileSystemPrivateResource::OnBrowserOpenComplete, + this, type, file_system_resource, callback)); return PP_OK_COMPLETIONPENDING; } -void ExtCrxFileSystemPrivateResource::OnBrowserOpenComplete( +void IsolatedFileSystemPrivateResource::OnBrowserOpenComplete( + PP_IsolatedFileSystemType_Private type, PP_Resource* file_system_resource, scoped_refptr<TrackedCallback> callback, const ResourceMessageReplyParams& params, @@ -75,7 +73,8 @@ void ExtCrxFileSystemPrivateResource::OnBrowserOpenComplete( *file_system_resource = fs->GetReference(); if (*file_system_resource == 0) callback->Run(PP_ERROR_FAILED); - fs->InitIsolatedFileSystem(fsid, base::Bind(&RunTrackedCallback, callback)); + fs->InitIsolatedFileSystem( + fsid, type, base::Bind(&RunTrackedCallback, callback)); } } // namespace proxy diff --git a/ppapi/proxy/ext_crx_file_system_private_resource.h b/ppapi/proxy/isolated_file_system_private_resource.h index 5f2887a718..6f3f5e6a5d 100644 --- a/ppapi/proxy/ext_crx_file_system_private_resource.h +++ b/ppapi/proxy/isolated_file_system_private_resource.h @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// 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. // @@ -16,8 +16,8 @@ // Once the plugin receives the fsid, it creates a PPB_FileSystem and forwards // the fsid to PepperFileSystemHost in order to construct root url. -#ifndef PPAPI_PROXY_EXT_CRX_FILE_SYSTEM_PRIVATE_RESOURCE_H_ -#define PPAPI_PROXY_EXT_CRX_FILE_SYSTEM_PRIVATE_RESOURCE_H_ +#ifndef PPAPI_PROXY_ISOLATED_FILE_SYSTEM_PRIVATE_RESOURCE_H_ +#define PPAPI_PROXY_ISOLATED_FILE_SYSTEM_PRIVATE_RESOURCE_H_ #include <string> @@ -25,7 +25,7 @@ #include "ppapi/proxy/connection.h" #include "ppapi/proxy/plugin_resource.h" #include "ppapi/proxy/ppapi_proxy_export.h" -#include "ppapi/thunk/ppb_ext_crx_file_system_private_api.h" +#include "ppapi/thunk/ppb_isolated_file_system_private_api.h" namespace ppapi { @@ -35,34 +35,35 @@ namespace proxy { class ResourceMessageReplyParams; -class PPAPI_PROXY_EXPORT ExtCrxFileSystemPrivateResource +class PPAPI_PROXY_EXPORT IsolatedFileSystemPrivateResource : public PluginResource, - public thunk::PPB_Ext_CrxFileSystem_Private_API { + public thunk::PPB_IsolatedFileSystem_Private_API { public: - ExtCrxFileSystemPrivateResource(Connection connection, PP_Instance instance); - virtual ~ExtCrxFileSystemPrivateResource(); + IsolatedFileSystemPrivateResource( + Connection connection, PP_Instance instance); + virtual ~IsolatedFileSystemPrivateResource(); // Resource overrides. - virtual thunk::PPB_Ext_CrxFileSystem_Private_API* - AsPPB_Ext_CrxFileSystem_Private_API() OVERRIDE; + virtual thunk::PPB_IsolatedFileSystem_Private_API* + AsPPB_IsolatedFileSystem_Private_API() OVERRIDE; - // PPB_Ext_CrxFileSystem_Private_API implementation. + // PPB_IsolatedFileSystem_Private_API implementation. virtual int32_t Open(PP_Instance instance, + PP_IsolatedFileSystemType_Private type, PP_Resource* file_system_resource, scoped_refptr<TrackedCallback> callback) OVERRIDE; private: - void OnBrowserOpenComplete(PP_Resource* file_system_resource, + void OnBrowserOpenComplete(PP_IsolatedFileSystemType_Private type, + PP_Resource* file_system_resource, scoped_refptr<TrackedCallback> callback, const ResourceMessageReplyParams& params, const std::string& fsid); - bool called_open_; - - DISALLOW_COPY_AND_ASSIGN(ExtCrxFileSystemPrivateResource); + DISALLOW_COPY_AND_ASSIGN(IsolatedFileSystemPrivateResource); }; } // namespace proxy } // namespace ppapi -#endif // PPAPI_PROXY_EXT_CRX_FILE_SYSTEM_PRIVATE_RESOURCE_H_ +#endif // PPAPI_PROXY_ISOLATED_FILE_SYSTEM_PRIVATE_RESOURCE_H_ diff --git a/ppapi/proxy/pdf_resource.cc b/ppapi/proxy/pdf_resource.cc index 8e0a2e0bbf..80c4237a5e 100644 --- a/ppapi/proxy/pdf_resource.cc +++ b/ppapi/proxy/pdf_resource.cc @@ -188,5 +188,9 @@ PP_Resource PDFResource::GetResourceImage(PP_ResourceImage image_id) { return GetResourceImageForScale(image_id, 1.0f); } +PP_Bool PDFResource::IsOutOfProcess() { + return PP_TRUE; +} + } // namespace proxy } // namespace ppapi diff --git a/ppapi/proxy/pdf_resource.h b/ppapi/proxy/pdf_resource.h index 704e1d4a44..4ab30ba1ca 100644 --- a/ppapi/proxy/pdf_resource.h +++ b/ppapi/proxy/pdf_resource.h @@ -54,6 +54,7 @@ class PPAPI_PROXY_EXPORT PDFResource virtual PP_Resource GetResourceImageForScale(PP_ResourceImage image_id, float scale) OVERRIDE; virtual PP_Resource GetResourceImage(PP_ResourceImage image_id) OVERRIDE; + virtual PP_Bool IsOutOfProcess() OVERRIDE; private: std::string locale_; diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index 2313cf7074..8118bddb75 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -21,6 +21,7 @@ #include "ipc/ipc_platform_file.h" #include "ppapi/c/dev/pp_video_capture_dev.h" #include "ppapi/c/dev/pp_video_dev.h" +#include "ppapi/c/dev/ppb_graphics_2d_dev.h" #include "ppapi/c/dev/ppb_truetype_font_dev.h" #include "ppapi/c/dev/ppb_url_util_dev.h" #include "ppapi/c/dev/ppp_printing_dev.h" @@ -42,6 +43,7 @@ #include "ppapi/c/private/pp_private_font_charset.h" #include "ppapi/c/private/ppb_flash.h" #include "ppapi/c/private/ppb_host_resolver_private.h" +#include "ppapi/c/private/ppb_isolated_file_system_private.h" #include "ppapi/c/private/ppb_net_address_private.h" #include "ppapi/c/private/ppb_pdf.h" #include "ppapi/c/private/ppb_talk_private.h" @@ -80,14 +82,18 @@ IPC_ENUM_TRAITS_MAX_VALUE(ppapi::TCPSocketVersion, IPC_ENUM_TRAITS(PP_AudioSampleRate) IPC_ENUM_TRAITS(PP_DeviceType_Dev) IPC_ENUM_TRAITS(PP_DecryptorStreamType) -IPC_ENUM_TRAITS(PP_FileSystemType) -IPC_ENUM_TRAITS(PP_FileType) +IPC_ENUM_TRAITS_MAX_VALUE(PP_FileSystemType, PP_FILESYSTEMTYPE_ISOLATED) +IPC_ENUM_TRAITS_MAX_VALUE(PP_FileType, PP_FILETYPE_OTHER) IPC_ENUM_TRAITS(PP_Flash_BrowserOperations_Permission) IPC_ENUM_TRAITS(PP_Flash_BrowserOperations_SettingType) IPC_ENUM_TRAITS(PP_FlashSetting) +IPC_ENUM_TRAITS_MAX_VALUE(PP_Graphics2D_Dev_ResizeMode, + PP_GRAPHICS2D_DEV_RESIZEMODE_STRETCH) IPC_ENUM_TRAITS(PP_ImageDataFormat) IPC_ENUM_TRAITS(PP_InputEvent_MouseButton) IPC_ENUM_TRAITS(PP_InputEvent_Type) +IPC_ENUM_TRAITS_MAX_VALUE(PP_IsolatedFileSystemType_Private, + PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE) IPC_ENUM_TRAITS_MAX_VALUE(PP_NetAddressFamily_Private, PP_NETADDRESSFAMILY_PRIVATE_IPV6) IPC_ENUM_TRAITS_MAX_VALUE(PP_NetworkList_State, PP_NETWORKLIST_STATE_UP) @@ -194,6 +200,15 @@ IPC_STRUCT_TRAITS_BEGIN(PP_URLComponents_Dev) IPC_STRUCT_TRAITS_MEMBER(ref) IPC_STRUCT_TRAITS_END() +IPC_STRUCT_TRAITS_BEGIN(PP_FileInfo) + IPC_STRUCT_TRAITS_MEMBER(size) + IPC_STRUCT_TRAITS_MEMBER(type) + IPC_STRUCT_TRAITS_MEMBER(system_type) + IPC_STRUCT_TRAITS_MEMBER(creation_time) + IPC_STRUCT_TRAITS_MEMBER(last_access_time) + IPC_STRUCT_TRAITS_MEMBER(last_modified_time) +IPC_STRUCT_TRAITS_END() + IPC_STRUCT_TRAITS_BEGIN(ppapi::DeviceRefData) IPC_STRUCT_TRAITS_MEMBER(type) IPC_STRUCT_TRAITS_MEMBER(name) @@ -630,22 +645,22 @@ IPC_MESSAGE_ROUTED3( int32_t /* result */) // PPP_ContentDecryptor_Dev -IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_Initialize, +IPC_MESSAGE_ROUTED2(PpapiMsg_PPPContentDecryptor_Initialize, PP_Instance /* instance */, - ppapi::proxy::SerializedVar /* key_system, String */, - bool /* can_challenge_platform */) -IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_GenerateKeyRequest, + ppapi::proxy::SerializedVar /* key_system, String */) +IPC_MESSAGE_ROUTED4(PpapiMsg_PPPContentDecryptor_GenerateKeyRequest, PP_Instance /* instance */, + uint32_t /* reference_id */, ppapi::proxy::SerializedVar /* type, String */, ppapi::proxy::SerializedVar /* init_data, ArrayBuffer */) IPC_MESSAGE_ROUTED4(PpapiMsg_PPPContentDecryptor_AddKey, PP_Instance /* instance */, - ppapi::proxy::SerializedVar /* session_id, String */, + uint32_t /* reference_id */, ppapi::proxy::SerializedVar /* key, ArrayBuffer */, ppapi::proxy::SerializedVar /* init_data, ArrayBuffer */) IPC_MESSAGE_ROUTED2(PpapiMsg_PPPContentDecryptor_CancelKeyRequest, PP_Instance /* instance */, - ppapi::proxy::SerializedVar /* session_id, String */) + uint32_t /* reference_id */) IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_Decrypt, PP_Instance /* instance */, ppapi::proxy::PPPDecryptor_Buffer /* buffer */, @@ -968,22 +983,23 @@ IPC_SYNC_MESSAGE_ROUTED2_2( ppapi::proxy::SerializedHandle /* result_shm_handle */) // PPB_ContentDecryptor_Dev messages handled in PPB_Instance_Proxy. -IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_KeyAdded, +IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBInstance_KeyAdded, PP_Instance /* instance */, - ppapi::proxy::SerializedVar /* key_system, String */, - ppapi::proxy::SerializedVar /* session_id, String */) -IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBInstance_KeyMessage, + uint32_t /* reference_id */) +IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBInstance_KeyMessage, PP_Instance /* instance */, - ppapi::proxy::SerializedVar /* key_system, String */, - ppapi::proxy::SerializedVar /* session_id, String */, + uint32_t /* reference_id */, ppapi::proxy::SerializedVar /* message, ArrayBuffer */, ppapi::proxy::SerializedVar /* default_url, String */) -IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBInstance_KeyError, +IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBInstance_KeyError, PP_Instance /* instance */, - ppapi::proxy::SerializedVar /* key_system, String */, - ppapi::proxy::SerializedVar /* session_id, String */, + uint32_t /* reference_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 */, @@ -1188,12 +1204,6 @@ IPC_MESSAGE_CONTROL2(PpapiHostMsg_ExtensionsCommon_Call, IPC_MESSAGE_CONTROL1(PpapiPluginMsg_ExtensionsCommon_CallReply, base::ListValue /* output */) -// Ext_CrxFileSystem -IPC_MESSAGE_CONTROL0(PpapiHostMsg_Ext_CrxFileSystem_Create) -IPC_MESSAGE_CONTROL0(PpapiHostMsg_Ext_CrxFileSystem_BrowserOpen) -IPC_MESSAGE_CONTROL1(PpapiPluginMsg_Ext_CrxFileSystem_BrowserOpenReply, - std::string /* fsid */) - // File chooser. IPC_MESSAGE_CONTROL0(PpapiHostMsg_FileChooser_Create) IPC_MESSAGE_CONTROL4(PpapiHostMsg_FileChooser_Show, @@ -1288,8 +1298,9 @@ IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileSystem_Create, IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileSystem_Open, int64_t /* expected_size */) IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileSystem_OpenReply) -IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileSystem_InitIsolatedFileSystem, - std::string /* fsid */) +IPC_MESSAGE_CONTROL2(PpapiHostMsg_FileSystem_InitIsolatedFileSystem, + std::string /* fsid */, + PP_IsolatedFileSystemType_Private /* type */) IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileSystem_InitIsolatedFileSystemReply) // Passed from renderer to browser. Creates an already-open file system with a // given |root_url| and |file_system_type|. @@ -1326,6 +1337,14 @@ IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashDRM_GetVoucherFile) IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FlashDRM_GetVoucherFileReply, ppapi::FileRefCreateInfo /* file_info */) +// Requests a value indicating whether the monitor on which the instance is +// displayed is external. +IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashDRM_MonitorIsExternal) +// Reply message for MonitorIsExternal which contains the value indicating if +// the monitor is external. +IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FlashDRM_MonitorIsExternalReply, + PP_Bool /* is_external */) + // Gamepad. IPC_MESSAGE_CONTROL0(PpapiHostMsg_Gamepad_Create) @@ -1355,9 +1374,14 @@ IPC_MESSAGE_CONTROL1(PpapiHostMsg_Graphics2D_ReplaceContents, ppapi::HostResource /* image_data */) IPC_MESSAGE_CONTROL1(PpapiHostMsg_Graphics2D_Dev_SetScale, float /* scale */) +IPC_MESSAGE_CONTROL1(PpapiHostMsg_Graphics2D_SetOffset, + PP_Point /* offset */) +IPC_MESSAGE_CONTROL1(PpapiHostMsg_Graphics2D_SetResizeMode, + PP_Graphics2D_Dev_ResizeMode /* resize_mode */) // Graphics2D, plugin -> host -> plugin -IPC_MESSAGE_CONTROL0(PpapiHostMsg_Graphics2D_Flush) +IPC_MESSAGE_CONTROL1(PpapiHostMsg_Graphics2D_Flush, + ppapi::ViewData /* view_data */) IPC_MESSAGE_CONTROL0(PpapiPluginMsg_Graphics2D_FlushAck) IPC_MESSAGE_CONTROL2(PpapiHostMsg_Graphics2D_ReadImageData, @@ -1365,13 +1389,19 @@ IPC_MESSAGE_CONTROL2(PpapiHostMsg_Graphics2D_ReadImageData, PP_Point /* top_left */) IPC_MESSAGE_CONTROL0(PpapiPluginMsg_Graphics2D_ReadImageDataAck) +// IsolatedFileSystem +IPC_MESSAGE_CONTROL0(PpapiHostMsg_IsolatedFileSystem_Create) +IPC_MESSAGE_CONTROL1(PpapiHostMsg_IsolatedFileSystem_BrowserOpen, + PP_IsolatedFileSystemType_Private /* type */) +IPC_MESSAGE_CONTROL1(PpapiPluginMsg_IsolatedFileSystem_BrowserOpenReply, + std::string /* fsid */) + // NetworkMonitor. IPC_MESSAGE_CONTROL0(PpapiHostMsg_NetworkMonitor_Create) IPC_MESSAGE_CONTROL1(PpapiPluginMsg_NetworkMonitor_NetworkList, ppapi::proxy::SerializedNetworkList /* network_list */) IPC_MESSAGE_CONTROL0(PpapiPluginMsg_NetworkMonitor_Forbidden) - // NetworkProxy ---------------------------------------------------------------- IPC_MESSAGE_CONTROL0(PpapiHostMsg_NetworkProxy_Create) diff --git a/ppapi/proxy/ppapi_param_traits.cc b/ppapi/proxy/ppapi_param_traits.cc index 5d4345f85a..5ee0a34397 100644 --- a/ppapi/proxy/ppapi_param_traits.cc +++ b/ppapi/proxy/ppapi_param_traits.cc @@ -6,7 +6,6 @@ #include <string.h> // For memcpy -#include "ppapi/c/pp_file_info.h" #include "ppapi/c/pp_resource.h" #include "ppapi/proxy/ppapi_messages.h" #include "ppapi/proxy/serialized_var.h" @@ -98,48 +97,6 @@ bool ParamTraits<PP_Bool>::Read(const Message* m, void ParamTraits<PP_Bool>::Log(const param_type& p, std::string* l) { } -// PP_FileInfo ------------------------------------------------------------- - -// static -void ParamTraits<PP_FileInfo>::Write(Message* m, const param_type& p) { - ParamTraits<int64_t>::Write(m, p.size); - ParamTraits<int>::Write(m, static_cast<int>(p.type)); - ParamTraits<int>::Write(m, static_cast<int>(p.system_type)); - ParamTraits<double>::Write(m, p.creation_time); - ParamTraits<double>::Write(m, p.last_access_time); - ParamTraits<double>::Write(m, p.last_modified_time); -} - -// static -bool ParamTraits<PP_FileInfo>::Read(const Message* m, PickleIterator* iter, - param_type* r) { - int type, system_type; - if (!ParamTraits<int64_t>::Read(m, iter, &r->size) || - !ParamTraits<int>::Read(m, iter, &type) || - !ParamTraits<int>::Read(m, iter, &system_type) || - !ParamTraits<double>::Read(m, iter, &r->creation_time) || - !ParamTraits<double>::Read(m, iter, &r->last_access_time) || - !ParamTraits<double>::Read(m, iter, &r->last_modified_time)) - return false; - if (type != PP_FILETYPE_REGULAR && - type != PP_FILETYPE_DIRECTORY && - type != PP_FILETYPE_OTHER) - return false; - r->type = static_cast<PP_FileType>(type); - if (system_type != PP_FILESYSTEMTYPE_INVALID && - system_type != PP_FILESYSTEMTYPE_EXTERNAL && - system_type != PP_FILESYSTEMTYPE_LOCALPERSISTENT && - system_type != PP_FILESYSTEMTYPE_LOCALTEMPORARY && - system_type != PP_FILESYSTEMTYPE_ISOLATED) - return false; - r->system_type = static_cast<PP_FileSystemType>(system_type); - return true; -} - -// static -void ParamTraits<PP_FileInfo>::Log(const param_type& p, std::string* l) { -} - // PP_NetAddress_Private ------------------------------------------------------- // static diff --git a/ppapi/proxy/ppapi_param_traits.h b/ppapi/proxy/ppapi_param_traits.h index b56ec3e3d4..3bf5fb6b69 100644 --- a/ppapi/proxy/ppapi_param_traits.h +++ b/ppapi/proxy/ppapi_param_traits.h @@ -19,7 +19,6 @@ #include "ppapi/shared_impl/ppapi_permissions.h" #include "ppapi/shared_impl/socket_option_data.h" -struct PP_FileInfo; struct PP_NetAddress_Private; namespace ppapi { @@ -51,14 +50,6 @@ struct PPAPI_PROXY_EXPORT ParamTraits<PP_Bool> { static void Log(const param_type& p, std::string* l); }; -template<> -struct PPAPI_PROXY_EXPORT ParamTraits<PP_FileInfo> { - typedef PP_FileInfo param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, PickleIterator* iter, param_type* r); - static void Log(const param_type& p, std::string* l); -}; - template <> struct PPAPI_PROXY_EXPORT ParamTraits<PP_NetAddress_Private> { typedef PP_NetAddress_Private param_type; diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc index 1997f89008..40cd4706d3 100644 --- a/ppapi/proxy/ppb_instance_proxy.cc +++ b/ppapi/proxy/ppb_instance_proxy.cc @@ -18,7 +18,6 @@ #include "ppapi/proxy/browser_font_singleton_resource.h" #include "ppapi/proxy/content_decryptor_private_serializer.h" #include "ppapi/proxy/enter_proxy.h" -#include "ppapi/proxy/ext_crx_file_system_private_resource.h" #include "ppapi/proxy/extensions_common_resource.h" #include "ppapi/proxy/flash_clipboard_resource.h" #include "ppapi/proxy/flash_file_resource.h" @@ -26,6 +25,7 @@ #include "ppapi/proxy/flash_resource.h" #include "ppapi/proxy/gamepad_resource.h" #include "ppapi/proxy/host_dispatcher.h" +#include "ppapi/proxy/isolated_file_system_private_resource.h" #include "ppapi/proxy/network_proxy_resource.h" #include "ppapi/proxy/pdf_resource.h" #include "ppapi/proxy/plugin_dispatcher.h" @@ -181,6 +181,8 @@ bool PPB_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) { OnHostMsgKeyMessage) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyError, OnHostMsgKeyError) + IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetSessionId, + OnHostMsgSetSessionId) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverBlock, OnHostMsgDeliverBlock) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderInitializeDone, @@ -371,15 +373,16 @@ Resource* PPB_Instance_Proxy::GetSingletonResource(PP_Instance instance, case BROKER_SINGLETON_ID: new_singleton = new BrokerResource(connection, instance); break; - case CRX_FILESYSTEM_SINGLETON_ID: - new_singleton = new ExtCrxFileSystemPrivateResource(connection, instance); - break; case EXTENSIONS_COMMON_SINGLETON_ID: new_singleton = new ExtensionsCommonResource(connection, instance); break; case GAMEPAD_SINGLETON_ID: new_singleton = new GamepadResource(connection, instance); break; + case ISOLATED_FILESYSTEM_SINGLETON_ID: + new_singleton = + new IsolatedFileSystemPrivateResource(connection, instance); + break; case NETWORK_PROXY_SINGLETON_ID: new_singleton = new NetworkProxyResource(connection, instance); break; @@ -537,47 +540,51 @@ PP_Var PPB_Instance_Proxy::GetPluginReferrerURL( components); } -void PPB_Instance_Proxy::KeyAdded(PP_Instance instance, - PP_Var key_system, - PP_Var session_id) { +void PPB_Instance_Proxy::KeyAdded(PP_Instance instance, uint32_t reference_id) { dispatcher()->Send( new PpapiHostMsg_PPBInstance_KeyAdded( API_ID_PPB_INSTANCE, instance, - SerializedVarSendInput(dispatcher(), key_system), - SerializedVarSendInput(dispatcher(), session_id))); + reference_id)); } void PPB_Instance_Proxy::KeyMessage(PP_Instance instance, - PP_Var key_system, - PP_Var session_id, + uint32_t reference_id, PP_Var message, PP_Var default_url) { dispatcher()->Send( new PpapiHostMsg_PPBInstance_KeyMessage( API_ID_PPB_INSTANCE, instance, - SerializedVarSendInput(dispatcher(), key_system), - SerializedVarSendInput(dispatcher(), session_id), + reference_id, SerializedVarSendInput(dispatcher(), message), SerializedVarSendInput(dispatcher(), default_url))); } void PPB_Instance_Proxy::KeyError(PP_Instance instance, - PP_Var key_system, - PP_Var session_id, + uint32_t reference_id, int32_t media_error, int32_t system_code) { dispatcher()->Send( new PpapiHostMsg_PPBInstance_KeyError( API_ID_PPB_INSTANCE, instance, - SerializedVarSendInput(dispatcher(), key_system), - SerializedVarSendInput(dispatcher(), session_id), + reference_id, media_error, system_code)); } +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::DeliverBlock(PP_Instance instance, PP_Resource decrypted_block, const PP_DecryptedBlockInfo* block_info) { @@ -1044,22 +1051,18 @@ void PPB_Instance_Proxy::OnHostMsgGetPluginReferrerURL( void PPB_Instance_Proxy::OnHostMsgKeyAdded( PP_Instance instance, - SerializedVarReceiveInput key_system, - SerializedVarReceiveInput session_id) { + uint32_t reference_id) { if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) return; EnterInstanceNoLock enter(instance); if (enter.succeeded()) { - enter.functions()->KeyAdded(instance, - key_system.Get(dispatcher()), - session_id.Get(dispatcher())); + enter.functions()->KeyAdded(instance, reference_id); } } void PPB_Instance_Proxy::OnHostMsgKeyMessage( PP_Instance instance, - SerializedVarReceiveInput key_system, - SerializedVarReceiveInput session_id, + uint32_t reference_id, SerializedVarReceiveInput message, SerializedVarReceiveInput default_url) { if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) @@ -1067,8 +1070,7 @@ void PPB_Instance_Proxy::OnHostMsgKeyMessage( EnterInstanceNoLock enter(instance); if (enter.succeeded()) { enter.functions()->KeyMessage(instance, - key_system.Get(dispatcher()), - session_id.Get(dispatcher()), + reference_id, message.Get(dispatcher()), default_url.Get(dispatcher())); } @@ -1076,8 +1078,7 @@ void PPB_Instance_Proxy::OnHostMsgKeyMessage( void PPB_Instance_Proxy::OnHostMsgKeyError( PP_Instance instance, - SerializedVarReceiveInput key_system, - SerializedVarReceiveInput session_id, + uint32_t reference_id, int32_t media_error, int32_t system_error) { if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) @@ -1085,13 +1086,26 @@ void PPB_Instance_Proxy::OnHostMsgKeyError( EnterInstanceNoLock enter(instance); if (enter.succeeded()) { enter.functions()->KeyError(instance, - key_system.Get(dispatcher()), - session_id.Get(dispatcher()), + reference_id, media_error, system_error); } } +void PPB_Instance_Proxy::OnHostMsgSetSessionId( + PP_Instance instance, + uint32_t reference_id, + SerializedVarReceiveInput session_id) { + if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) + return; + EnterInstanceNoLock enter(instance); + if (enter.succeeded()) { + enter.functions()->SetSessionId(instance, + reference_id, + session_id.Get(dispatcher())); + } +} + void PPB_Instance_Proxy::OnHostMsgDeliverBlock( PP_Instance instance, PP_Resource decrypted_block, diff --git a/ppapi/proxy/ppb_instance_proxy.h b/ppapi/proxy/ppb_instance_proxy.h index 5aaa2d11a6..4a892e54f4 100644 --- a/ppapi/proxy/ppb_instance_proxy.h +++ b/ppapi/proxy/ppb_instance_proxy.h @@ -118,18 +118,18 @@ class PPB_Instance_Proxy : public InterfaceProxy, PP_Instance instance, PP_URLComponents_Dev* components) OVERRIDE; virtual void KeyAdded(PP_Instance instance, - PP_Var key_system, - PP_Var session_id) OVERRIDE; + uint32_t reference_id) OVERRIDE; virtual void KeyMessage(PP_Instance instance, - PP_Var key_system, - PP_Var session_id, + uint32_t reference_id, PP_Var message, PP_Var default_url) OVERRIDE; virtual void KeyError(PP_Instance instance, - PP_Var key_system, - PP_Var session_id, + 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 DeliverBlock(PP_Instance instance, PP_Resource decrypted_block, const PP_DecryptedBlockInfo* block_info) OVERRIDE; @@ -221,18 +221,18 @@ class PPB_Instance_Proxy : public InterfaceProxy, void OnHostMsgGetPluginReferrerURL(PP_Instance instance, SerializedVarReturnValue result); virtual void OnHostMsgKeyAdded(PP_Instance instance, - SerializedVarReceiveInput key_system, - SerializedVarReceiveInput session_id); + uint32_t reference_id); virtual void OnHostMsgKeyMessage(PP_Instance instance, - SerializedVarReceiveInput key_system, - SerializedVarReceiveInput session_id, + uint32_t reference_id, SerializedVarReceiveInput message, SerializedVarReceiveInput default_url); virtual void OnHostMsgKeyError(PP_Instance instance, - SerializedVarReceiveInput key_system, - SerializedVarReceiveInput session_id, + 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 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 f80e60cbf5..e4602e8d66 100644 --- a/ppapi/proxy/ppb_testing_proxy.cc +++ b/ppapi/proxy/ppb_testing_proxy.cc @@ -5,7 +5,7 @@ #include "ppapi/proxy/ppb_testing_proxy.h" #include "base/message_loop/message_loop.h" -#include "ppapi/c/dev/ppb_testing_dev.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/proxy/enter_proxy.h" #include "ppapi/proxy/plugin_dispatcher.h" #include "ppapi/proxy/ppapi_messages.h" @@ -127,7 +127,7 @@ void SetMinimumArrayBufferSizeForShmem(PP_Instance instance, API_ID_PPB_TESTING, threshold)); } -const PPB_Testing_Dev testing_interface = { +const PPB_Testing_Private testing_interface = { &ReadImageData, &RunMessageLoop, &QuitMessageLoop, @@ -149,8 +149,8 @@ PPB_Testing_Proxy::PPB_Testing_Proxy(Dispatcher* dispatcher) : InterfaceProxy(dispatcher), ppb_testing_impl_(NULL) { if (!dispatcher->IsPlugin()) { - ppb_testing_impl_ = static_cast<const PPB_Testing_Dev*>( - dispatcher->local_get_interface()(PPB_TESTING_DEV_INTERFACE)); + ppb_testing_impl_ = static_cast<const PPB_Testing_Private*>( + dispatcher->local_get_interface()(PPB_TESTING_PRIVATE_INTERFACE)); } } @@ -161,7 +161,7 @@ PPB_Testing_Proxy::~PPB_Testing_Proxy() { const InterfaceProxy::Info* PPB_Testing_Proxy::GetInfo() { static const Info info = { &testing_interface, - PPB_TESTING_DEV_INTERFACE, + PPB_TESTING_PRIVATE_INTERFACE, API_ID_PPB_TESTING, false, &CreateTestingProxy, diff --git a/ppapi/proxy/ppb_testing_proxy.h b/ppapi/proxy/ppb_testing_proxy.h index 61af47fcb0..bee539a020 100644 --- a/ppapi/proxy/ppb_testing_proxy.h +++ b/ppapi/proxy/ppb_testing_proxy.h @@ -8,7 +8,7 @@ #include "base/basictypes.h" #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_resource.h" -#include "ppapi/c/dev/ppb_testing_dev.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/proxy/interface_proxy.h" #include "ppapi/shared_impl/host_resource.h" @@ -46,7 +46,7 @@ class PPB_Testing_Proxy : public InterfaceProxy { // When this proxy is in the host side, this value caches the interface // pointer so we don't have to retrieve it from the dispatcher each time. // In the plugin, this value is always NULL. - const PPB_Testing_Dev* ppb_testing_impl_; + const PPB_Testing_Private* ppb_testing_impl_; DISALLOW_COPY_AND_ASSIGN(PPB_Testing_Proxy); }; diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc index d32e632009..12ee04e9fe 100644 --- a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc +++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc @@ -110,8 +110,7 @@ bool InitializePppDecryptorBuffer(PP_Instance instance, } void Initialize(PP_Instance instance, - PP_Var key_system, - PP_Bool can_challenge_platform) { + PP_Var key_system) { HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); if (!dispatcher) { NOTREACHED(); @@ -122,11 +121,11 @@ void Initialize(PP_Instance instance, new PpapiMsg_PPPContentDecryptor_Initialize( API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, instance, - SerializedVarSendInput(dispatcher, key_system), - PP_ToBool(can_challenge_platform))); + SerializedVarSendInput(dispatcher, key_system))); } void GenerateKeyRequest(PP_Instance instance, + uint32_t reference_id, PP_Var type, PP_Var init_data) { HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); @@ -139,12 +138,13 @@ void GenerateKeyRequest(PP_Instance instance, new PpapiMsg_PPPContentDecryptor_GenerateKeyRequest( API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, instance, + reference_id, SerializedVarSendInput(dispatcher, type), SerializedVarSendInput(dispatcher, init_data))); } void AddKey(PP_Instance instance, - PP_Var session_id, + uint32_t reference_id, PP_Var key, PP_Var init_data) { HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); @@ -157,12 +157,12 @@ void AddKey(PP_Instance instance, new PpapiMsg_PPPContentDecryptor_AddKey( API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, instance, - SerializedVarSendInput(dispatcher, session_id), + reference_id, SerializedVarSendInput(dispatcher, key), SerializedVarSendInput(dispatcher, init_data))); } -void CancelKeyRequest(PP_Instance instance, PP_Var session_id) { +void CancelKeyRequest(PP_Instance instance, uint32_t reference_id) { HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); if (!dispatcher) { NOTREACHED(); @@ -173,7 +173,7 @@ void CancelKeyRequest(PP_Instance instance, PP_Var session_id) { new PpapiMsg_PPPContentDecryptor_CancelKeyRequest( API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, instance, - SerializedVarSendInput(dispatcher, session_id))); + reference_id)); } void Decrypt(PP_Instance instance, @@ -434,24 +434,24 @@ bool PPP_ContentDecryptor_Private_Proxy::OnMessageReceived( void PPP_ContentDecryptor_Private_Proxy::OnMsgInitialize( PP_Instance instance, - SerializedVarReceiveInput key_system, - bool can_challenge_platform) { + SerializedVarReceiveInput key_system) { if (ppp_decryptor_impl_) { CallWhileUnlocked( ppp_decryptor_impl_->Initialize, instance, - ExtractReceivedVarAndAddRef(dispatcher(), &key_system), - PP_FromBool(can_challenge_platform)); + ExtractReceivedVarAndAddRef(dispatcher(), &key_system)); } } void PPP_ContentDecryptor_Private_Proxy::OnMsgGenerateKeyRequest( PP_Instance instance, + uint32_t reference_id, SerializedVarReceiveInput type, SerializedVarReceiveInput init_data) { if (ppp_decryptor_impl_) { CallWhileUnlocked(ppp_decryptor_impl_->GenerateKeyRequest, instance, + reference_id, ExtractReceivedVarAndAddRef(dispatcher(), &type), ExtractReceivedVarAndAddRef(dispatcher(), &init_data)); } @@ -459,13 +459,13 @@ void PPP_ContentDecryptor_Private_Proxy::OnMsgGenerateKeyRequest( void PPP_ContentDecryptor_Private_Proxy::OnMsgAddKey( PP_Instance instance, - SerializedVarReceiveInput session_id, + uint32_t reference_id, SerializedVarReceiveInput key, SerializedVarReceiveInput init_data) { if (ppp_decryptor_impl_) { CallWhileUnlocked(ppp_decryptor_impl_->AddKey, instance, - ExtractReceivedVarAndAddRef(dispatcher(), &session_id), + reference_id, ExtractReceivedVarAndAddRef(dispatcher(), &key), ExtractReceivedVarAndAddRef(dispatcher(), &init_data)); } @@ -473,11 +473,11 @@ void PPP_ContentDecryptor_Private_Proxy::OnMsgAddKey( void PPP_ContentDecryptor_Private_Proxy::OnMsgCancelKeyRequest( PP_Instance instance, - SerializedVarReceiveInput session_id) { + uint32_t reference_id) { if (ppp_decryptor_impl_) { CallWhileUnlocked(ppp_decryptor_impl_->CancelKeyRequest, instance, - ExtractReceivedVarAndAddRef(dispatcher(), &session_id)); + reference_id); } } diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.h b/ppapi/proxy/ppp_content_decryptor_private_proxy.h index 2e4ad8548a..b4472f537f 100644 --- a/ppapi/proxy/ppp_content_decryptor_private_proxy.h +++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.h @@ -31,17 +31,17 @@ class PPP_ContentDecryptor_Private_Proxy : public InterfaceProxy { // Message handlers. void OnMsgInitialize(PP_Instance instance, - SerializedVarReceiveInput key_system, - bool can_challenge_platform); + SerializedVarReceiveInput key_system); void OnMsgGenerateKeyRequest(PP_Instance instance, + uint32_t reference_id, SerializedVarReceiveInput type, SerializedVarReceiveInput init_data); void OnMsgAddKey(PP_Instance instance, - SerializedVarReceiveInput session_id, + uint32_t reference_id, SerializedVarReceiveInput key, SerializedVarReceiveInput init_data); void OnMsgCancelKeyRequest(PP_Instance instance, - SerializedVarReceiveInput session_id); + uint32_t reference_id); void OnMsgDecrypt(PP_Instance instance, const PPPDecryptor_Buffer& encrypted_buffer, const std::string& serialized_encrypted_block_info); diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc index 7ee761bad3..231142a937 100644 --- a/ppapi/proxy/resource_creation_proxy.cc +++ b/ppapi/proxy/resource_creation_proxy.cc @@ -8,7 +8,6 @@ #include "ppapi/c/pp_size.h" #include "ppapi/proxy/audio_input_resource.h" #include "ppapi/proxy/connection.h" -#include "ppapi/proxy/ext_crx_file_system_private_resource.h" #include "ppapi/proxy/file_chooser_resource.h" #include "ppapi/proxy/file_io_resource.h" #include "ppapi/proxy/file_ref_resource.h" diff --git a/ppapi/proxy/websocket_resource.cc b/ppapi/proxy/websocket_resource.cc index 394a2c54f9..c998cd94b7 100644 --- a/ppapi/proxy/websocket_resource.cc +++ b/ppapi/proxy/websocket_resource.cc @@ -137,13 +137,13 @@ int32_t WebSocketResource::Close(uint16_t code, // Validate |code| and |reason|. scoped_refptr<StringVar> reason_string_var; std::string reason_string; - WebKit::WebSocket::CloseEventCode event_code = - static_cast<WebKit::WebSocket::CloseEventCode>(code); + blink::WebSocket::CloseEventCode event_code = + static_cast<blink::WebSocket::CloseEventCode>(code); if (code == PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED) { // PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED and CloseEventCodeNotSpecified are // assigned to different values. A conversion is needed if // PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED is specified. - event_code = WebKit::WebSocket::CloseEventCodeNotSpecified; + event_code = blink::WebSocket::CloseEventCodeNotSpecified; } else { if (!(code == PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE || (PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN <= code && diff --git a/ppapi/shared_impl/DEPS b/ppapi/shared_impl/DEPS index 30cc66e9a5..48f8c43408 100644 --- a/ppapi/shared_impl/DEPS +++ b/ppapi/shared_impl/DEPS @@ -5,6 +5,7 @@ include_rules = [ "+media/base", "+skia", "+webkit/common/webpreferences.h", + "+webkit/common/fileapi/file_system_types.h", # The untrusted build references the NaCl integrated runtime (IRT). "+native_client/src/untrusted/irt", diff --git a/ppapi/shared_impl/file_system_util.cc b/ppapi/shared_impl/file_system_util.cc new file mode 100644 index 0000000000..330995cceb --- /dev/null +++ b/ppapi/shared_impl/file_system_util.cc @@ -0,0 +1,50 @@ +// 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 "ppapi/shared_impl/file_system_util.h" + +#include "base/logging.h" + +namespace ppapi { + +fileapi::FileSystemType PepperFileSystemTypeToFileSystemType( + PP_FileSystemType type) { + switch (type) { + case PP_FILESYSTEMTYPE_LOCALTEMPORARY: + return fileapi::kFileSystemTypeTemporary; + case PP_FILESYSTEMTYPE_LOCALPERSISTENT: + return fileapi::kFileSystemTypePersistent; + case PP_FILESYSTEMTYPE_EXTERNAL: + return fileapi::kFileSystemTypeExternal; + default: + return fileapi::kFileSystemTypeUnknown; + } +} + +bool FileSystemTypeIsValid(PP_FileSystemType type) { + return (type == PP_FILESYSTEMTYPE_LOCALPERSISTENT || + type == PP_FILESYSTEMTYPE_LOCALTEMPORARY || + type == PP_FILESYSTEMTYPE_EXTERNAL || + type == PP_FILESYSTEMTYPE_ISOLATED); +} + +bool FileSystemTypeHasQuota(PP_FileSystemType type) { + return (type == PP_FILESYSTEMTYPE_LOCALTEMPORARY || + type == PP_FILESYSTEMTYPE_LOCALPERSISTENT); +} + +std::string IsolatedFileSystemTypeToRootName( + PP_IsolatedFileSystemType_Private type) { + switch (type) { + case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX: + return "crxfs"; + case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE: + return "pluginprivate"; + default: + NOTREACHED() << type; + return std::string(); + } +} + +} // namespace ppapi diff --git a/ppapi/shared_impl/file_system_util.h b/ppapi/shared_impl/file_system_util.h new file mode 100644 index 0000000000..5b39f69757 --- /dev/null +++ b/ppapi/shared_impl/file_system_util.h @@ -0,0 +1,30 @@ +// 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. + +#ifndef PPAPI_SHARED_IMPL_FILE_SYSTEM_UTIL_H_ +#define PPAPI_SHARED_IMPL_FILE_SYSTEM_UTIL_H_ + +#include <string> + +#include "ppapi/c/pp_file_info.h" +#include "ppapi/c/private/ppb_isolated_file_system_private.h" +#include "ppapi/shared_impl/ppapi_shared_export.h" +#include "webkit/common/fileapi/file_system_types.h" + +namespace ppapi { + +PPAPI_SHARED_EXPORT +fileapi::FileSystemType PepperFileSystemTypeToFileSystemType( + PP_FileSystemType type); + +PPAPI_SHARED_EXPORT bool FileSystemTypeIsValid(PP_FileSystemType type); + +PPAPI_SHARED_EXPORT bool FileSystemTypeHasQuota(PP_FileSystemType type); + +PPAPI_SHARED_EXPORT std::string IsolatedFileSystemTypeToRootName( + PP_IsolatedFileSystemType_Private type); + +} // namespace ppapi + +#endif // PPAPI_SHARED_IMPL_FILE_SYSTEM_UTIL_H_ diff --git a/ppapi/shared_impl/file_type_conversion.cc b/ppapi/shared_impl/file_type_conversion.cc index 917d1968ea..1a4bb16c7b 100644 --- a/ppapi/shared_impl/file_type_conversion.cc +++ b/ppapi/shared_impl/file_type_conversion.cc @@ -44,12 +44,13 @@ bool PepperFileOpenFlagsToPlatformFileFlags(int32_t pp_open_flags, bool pp_exclusive = !!(pp_open_flags & PP_FILEOPENFLAG_EXCLUSIVE); bool pp_append = !!(pp_open_flags & PP_FILEOPENFLAG_APPEND); - int flags = 0; + // Pepper allows Touch on any open file, so always set this Windows-only flag. + int flags = base::PLATFORM_FILE_WRITE_ATTRIBUTES; + if (pp_read) flags |= base::PLATFORM_FILE_READ; if (pp_write) { flags |= base::PLATFORM_FILE_WRITE; - flags |= base::PLATFORM_FILE_WRITE_ATTRIBUTES; } if (pp_append) { if (pp_write) diff --git a/ppapi/shared_impl/ppb_gamepad_shared.h b/ppapi/shared_impl/ppb_gamepad_shared.h index 2a30c7d874..72d53311e5 100644 --- a/ppapi/shared_impl/ppb_gamepad_shared.h +++ b/ppapi/shared_impl/ppb_gamepad_shared.h @@ -17,7 +17,7 @@ namespace ppapi { #pragma pack(push, 1) -// This must match the definition of WebKit::Gamepad. The GamepadHost unit test +// This must match the definition of blink::Gamepad. The GamepadHost unit test // has some compile asserts to validate this. struct WebKitGamepad { static const size_t kIdLengthCap = 128; @@ -47,7 +47,7 @@ struct WebKitGamepad { float buttons[kButtonsLengthCap]; }; -// This must match the definition of WebKit::Gamepads. The GamepadHost unit +// This must match the definition of blink::Gamepads. The GamepadHost unit // test has some compile asserts to validate this. struct WebKitGamepads { static const size_t kItemsLengthCap = 4; diff --git a/ppapi/shared_impl/ppb_opengles2_shared.cc b/ppapi/shared_impl/ppb_opengles2_shared.cc index 534e816396..5c05065dcd 100644 --- a/ppapi/shared_impl/ppb_opengles2_shared.cc +++ b/ppapi/shared_impl/ppb_opengles2_shared.cc @@ -1207,7 +1207,7 @@ void BlitFramebufferEXT( Enter3D enter(context_id, true); if (enter.succeeded()) { ToGles2Impl( - &enter)->BlitFramebufferEXT( + &enter)->BlitFramebufferCHROMIUM( srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); } @@ -1219,7 +1219,7 @@ void RenderbufferStorageMultisampleEXT( Enter3D enter(context_id, true); if (enter.succeeded()) { ToGles2Impl( - &enter)->RenderbufferStorageMultisampleEXT( + &enter)->RenderbufferStorageMultisampleCHROMIUM( target, samples, internalformat, width, height); } } diff --git a/ppapi/shared_impl/resource.h b/ppapi/shared_impl/resource.h index d364b44e60..ec4f5179c1 100644 --- a/ppapi/shared_impl/resource.h +++ b/ppapi/shared_impl/resource.h @@ -51,6 +51,7 @@ F(PPB_HostResolver_Private_API) \ F(PPB_ImageData_API) \ F(PPB_InputEvent_API) \ + F(PPB_IsolatedFileSystem_Private_API) \ F(PPB_LayerCompositor_API) \ F(PPB_MessageLoop_API) \ F(PPB_NetAddress_API) \ diff --git a/ppapi/shared_impl/singleton_resource_id.h b/ppapi/shared_impl/singleton_resource_id.h index 2d89de6807..90b0e6f61f 100644 --- a/ppapi/shared_impl/singleton_resource_id.h +++ b/ppapi/shared_impl/singleton_resource_id.h @@ -15,13 +15,13 @@ enum SingletonResourceID { // resource model. BROKER_SINGLETON_ID, BROWSER_FONT_SINGLETON_ID, - CRX_FILESYSTEM_SINGLETON_ID, EXTENSIONS_COMMON_SINGLETON_ID, FLASH_CLIPBOARD_SINGLETON_ID, FLASH_FILE_SINGLETON_ID, FLASH_FULLSCREEN_SINGLETON_ID, FLASH_SINGLETON_ID, GAMEPAD_SINGLETON_ID, + ISOLATED_FILESYSTEM_SINGLETON_ID, NETWORK_PROXY_SINGLETON_ID, PDF_SINGLETON_ID, TRUETYPE_FONT_SINGLETON_ID, diff --git a/ppapi/shared_impl/var_tracker.h b/ppapi/shared_impl/var_tracker.h index 4856766e58..a63c74372b 100644 --- a/ppapi/shared_impl/var_tracker.h +++ b/ppapi/shared_impl/var_tracker.h @@ -114,8 +114,8 @@ class PPAPI_SHARED_EXPORT VarTracker { // does not exist, returns NULL. virtual ResourceVar* MakeResourceVar(PP_Resource pp_resource) = 0; - // Return a vector containing all PP_Vars that are in the tracker. This is - // to help implement PPB_Testing_Dev.GetLiveVars and should generally not be + // Return a vector containing all PP_Vars that are in the tracker. This is to + // help implement PPB_Testing_Private.GetLiveVars and should generally not be // used in production code. The PP_Vars are returned in no particular order, // and their reference counts are unaffected. std::vector<PP_Var> GetLiveVars(); diff --git a/ppapi/tests/all_c_includes.h b/ppapi/tests/all_c_includes.h index 76f939641f..e89f4d1308 100644 --- a/ppapi/tests/all_c_includes.h +++ b/ppapi/tests/all_c_includes.h @@ -25,7 +25,6 @@ #include "ppapi/c/dev/ppb_printing_dev.h" #include "ppapi/c/dev/ppb_resource_array_dev.h" #include "ppapi/c/dev/ppb_scrollbar_dev.h" -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/dev/ppb_text_input_dev.h" #include "ppapi/c/dev/ppb_trace_event_dev.h" #include "ppapi/c/dev/ppb_truetype_font_dev.h" @@ -122,6 +121,7 @@ #include "ppapi/c/private/ppb_platform_verification_private.h" #include "ppapi/c/private/ppb_proxy_private.h" #include "ppapi/c/private/ppb_tcp_socket_private.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/c/private/ppb_udp_socket_private.h" #include "ppapi/c/private/ppb_uma_private.h" #include "ppapi/c/private/ppb_video_destination_private.h" diff --git a/ppapi/tests/test_browser_font.cc b/ppapi/tests/test_browser_font.cc index 973f19f9fd..689b421a40 100644 --- a/ppapi/tests/test_browser_font.cc +++ b/ppapi/tests/test_browser_font.cc @@ -31,7 +31,7 @@ void TestBrowserFont::RunTests(const std::string& filter) { // Just tests that GetFontFamilies is hooked up & returns something. std::string TestBrowserFont::TestFontFamilies() { // This function is only supported out-of-process. - const PPB_Testing_Dev* testing_interface = GetTestingInterface(); + const PPB_Testing_Private* testing_interface = GetTestingInterface(); if (testing_interface && !testing_interface->IsOutOfProcess()) PASS(); diff --git a/ppapi/tests/test_case.cc b/ppapi/tests/test_case.cc index 196798bd31..696a514bd0 100644 --- a/ppapi/tests/test_case.cc +++ b/ppapi/tests/test_case.cc @@ -254,13 +254,14 @@ void TestCase::DoQuitMainMessageLoop(void* pp_instance, int32_t result) { delete instance; } -void TestCase::RunOnThreadInternal(void (*thread_func)(void*), - void* thread_param, - const PPB_Testing_Dev* testing_interface) { - PP_ThreadType thread; - PP_CreateThread(&thread, thread_func, thread_param); - // Run a message loop so pepper calls can be dispatched. The background - // thread will set result_ and make us Quit when it's done. - testing_interface->RunMessageLoop(instance_->pp_instance()); - PP_JoinThread(thread); +void TestCase::RunOnThreadInternal( + void (*thread_func)(void*), + void* thread_param, + const PPB_Testing_Private* testing_interface) { + PP_ThreadType thread; + PP_CreateThread(&thread, thread_func, thread_param); + // Run a message loop so pepper calls can be dispatched. The background + // thread will set result_ and make us Quit when it's done. + testing_interface->RunMessageLoop(instance_->pp_instance()); + PP_JoinThread(thread); } diff --git a/ppapi/tests/test_case.h b/ppapi/tests/test_case.h index 9a3c31f98d..0a96c9b665 100644 --- a/ppapi/tests/test_case.h +++ b/ppapi/tests/test_case.h @@ -11,9 +11,9 @@ #include <set> #include <string> -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_time.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/cpp/dev/scrollbar_dev.h" #include "ppapi/cpp/message_loop.h" #include "ppapi/cpp/view.h" @@ -84,7 +84,7 @@ class TestCase { TestingInstance* instance() { return instance_; } - const PPB_Testing_Dev* testing_interface() { return testing_interface_; } + const PPB_Testing_Private* testing_interface() { return testing_interface_; } static void QuitMainMessageLoop(PP_Instance instance); @@ -157,7 +157,7 @@ class TestCase { TestingInstance* instance_; // NULL unless InitTestingInterface is called. - const PPB_Testing_Dev* testing_interface_; + const PPB_Testing_Private* testing_interface_; void set_callback_type(CallbackType callback_type) { callback_type_ = callback_type; @@ -213,7 +213,7 @@ class TestCase { // for it to complete using RunMessageLoop(), then joins. void RunOnThreadInternal(void (*thread_func)(void*), void* thread_param, - const PPB_Testing_Dev* testing_interface); + const PPB_Testing_Private* testing_interface); static void DoQuitMainMessageLoop(void* pp_instance, int32_t result); diff --git a/ppapi/tests/test_case.html b/ppapi/tests/test_case.html index 1552ae2a5e..12053bce5f 100644 --- a/ppapi/tests/test_case.html +++ b/ppapi/tests/test_case.html @@ -297,14 +297,7 @@ onload = function() { // below. var original = obj.dispatchEvent; obj.dispatchEvent = function() { - // TODO(dmichael): NaCl triggers this; take out the special case for NaCl - // when crbug.com/109775 is fixed. - if (mode.indexOf("nacl") !== 0) - InternalError("Bad dispatchEvent called!"); - - // Pass it on anyways, we need the event to detect load progress and - // errors. - return original.apply(obj, arguments); + InternalError("Bad dispatchEvent called!"); } container.appendChild(obj); } @@ -314,10 +307,9 @@ onload = function() { // This part of the script does some nefarious things to make sure that it // doesn't affect the behavior of PostMessage (on which all the tests rely). In // particular, we replace document.createEvent, MessageEvent.initMessageEvent, -// and the MessageEvent constructor. Previous versions of the PostMessage -// implementation made use of these and would fail (http://crbug.com/82604). -// The NaCl plugin uses dispatchEvent for progress events, hence we are careful -// to make that still pass for NaCl (see above, and see crbug.com/109775). +// and the MessageEvent constructor. Previously, the NaCl integration +// implementation made use of these and would fail (http://crbug.com/82604 +// and http://crbug.com/109775). document.createEvent = function() { InternalError("Bad document.createEvent called!"); } diff --git a/ppapi/tests/test_file_io.cc b/ppapi/tests/test_file_io.cc index 92b760e767..f699ba1559 100644 --- a/ppapi/tests/test_file_io.cc +++ b/ppapi/tests/test_file_io.cc @@ -13,10 +13,10 @@ #include <vector> -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/ppb_file_io.h" #include "ppapi/c/private/pp_file_handle.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/cpp/file_io.h" #include "ppapi/cpp/file_ref.h" #include "ppapi/cpp/file_system.h" diff --git a/ppapi/tests/test_file_ref.cc b/ppapi/tests/test_file_ref.cc index 054ee24f57..0a10a32192 100644 --- a/ppapi/tests/test_file_ref.cc +++ b/ppapi/tests/test_file_ref.cc @@ -11,7 +11,7 @@ #include "ppapi/c/pp_errors.h" #include "ppapi/c/ppb_file_io.h" -#include "ppapi/c/dev/ppb_testing_dev.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/cpp/directory_entry.h" #include "ppapi/cpp/file_io.h" #include "ppapi/cpp/file_ref.h" diff --git a/ppapi/tests/test_flash_fullscreen.cc b/ppapi/tests/test_flash_fullscreen.cc index 819ffabe8b..4d17f19d44 100644 --- a/ppapi/tests/test_flash_fullscreen.cc +++ b/ppapi/tests/test_flash_fullscreen.cc @@ -8,7 +8,6 @@ #include <string.h> #include <string> -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/private/ppb_flash_fullscreen.h" #include "ppapi/cpp/graphics_2d.h" #include "ppapi/cpp/instance.h" diff --git a/ppapi/tests/test_fullscreen.cc b/ppapi/tests/test_fullscreen.cc index 8651b742f7..1d57dd495a 100644 --- a/ppapi/tests/test_fullscreen.cc +++ b/ppapi/tests/test_fullscreen.cc @@ -8,7 +8,6 @@ #include <string.h> #include <string> -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/ppb_fullscreen.h" #include "ppapi/cpp/image_data.h" #include "ppapi/cpp/input_event.h" diff --git a/ppapi/tests/test_graphics_2d.cc b/ppapi/tests/test_graphics_2d.cc index 23a4fe76fb..5bb66d73b7 100644 --- a/ppapi/tests/test_graphics_2d.cc +++ b/ppapi/tests/test_graphics_2d.cc @@ -9,7 +9,6 @@ #include <set> -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/ppb_graphics_2d.h" #include "ppapi/cpp/completion_callback.h" @@ -28,14 +27,6 @@ REGISTER_TEST_CASE(Graphics2D); namespace { -// A NOP flush callback for use in various tests. -void FlushCallbackNOP(void* data, int32_t result) { -} - -void FlushCallbackQuitMessageLoop(void* data, int32_t result) { - static_cast<TestGraphics2D*>(data)->QuitMessageLoop(); -} - bool CanFlushContext(pp::Instance* instance, pp::Graphics2D* context) { TestCompletionCallback callback(instance->pp_instance()); callback.WaitForResult(context->Flush(callback.GetCallback())); diff --git a/ppapi/tests/test_graphics_3d.cc b/ppapi/tests/test_graphics_3d.cc index 8c1bdc17bc..6b26d45ea1 100644 --- a/ppapi/tests/test_graphics_3d.cc +++ b/ppapi/tests/test_graphics_3d.cc @@ -10,7 +10,6 @@ #include <stdlib.h> #include <string.h> -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/ppb_opengles2.h" #include "ppapi/cpp/graphics_3d.h" #include "ppapi/cpp/module.h" diff --git a/ppapi/tests/test_ime_input_event.cc b/ppapi/tests/test_ime_input_event.cc index c28a044683..fdb51c2023 100644 --- a/ppapi/tests/test_ime_input_event.cc +++ b/ppapi/tests/test_ime_input_event.cc @@ -4,7 +4,6 @@ #include "ppapi/tests/test_ime_input_event.h" -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/ppb_input_event.h" #include "ppapi/cpp/input_event.h" diff --git a/ppapi/tests/test_input_event.cc b/ppapi/tests/test_input_event.cc index 9b138fff30..34ad680f22 100644 --- a/ppapi/tests/test_input_event.cc +++ b/ppapi/tests/test_input_event.cc @@ -4,7 +4,6 @@ #include "ppapi/tests/test_input_event.h" -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/ppb_input_event.h" #include "ppapi/cpp/input_event.h" diff --git a/ppapi/tests/test_input_event.h b/ppapi/tests/test_input_event.h index 54cf2f9cb6..3b8936847d 100644 --- a/ppapi/tests/test_input_event.h +++ b/ppapi/tests/test_input_event.h @@ -9,7 +9,7 @@ #include <vector> #include "ppapi/c/ppb_input_event.h" -#include "ppapi/c/dev/ppb_testing_dev.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/cpp/input_event.h" #include "ppapi/cpp/point.h" #include "ppapi/cpp/rect.h" diff --git a/ppapi/tests/test_instance_deprecated.cc b/ppapi/tests/test_instance_deprecated.cc index b69f4276f0..1fd99e15b0 100644 --- a/ppapi/tests/test_instance_deprecated.cc +++ b/ppapi/tests/test_instance_deprecated.cc @@ -35,7 +35,7 @@ class InstanceSO : public pp::deprecated::ScriptableObject { // For out-of-process, the InstanceSO might be deleted after the instance was // already destroyed, so we can't rely on test_instance_->testing_interface() // being valid. Therefore we store our own. - const PPB_Testing_Dev* testing_interface_; + const PPB_Testing_Private* testing_interface_; }; InstanceSO::InstanceSO(TestInstance* i) diff --git a/ppapi/tests/test_memory.cc b/ppapi/tests/test_memory.cc index ea612a4fd8..9073227687 100644 --- a/ppapi/tests/test_memory.cc +++ b/ppapi/tests/test_memory.cc @@ -4,7 +4,6 @@ #include "ppapi/tests/test_memory.h" -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/dev/ppb_memory_dev.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" diff --git a/ppapi/tests/test_post_message.cc b/ppapi/tests/test_post_message.cc index df126c701b..5cd4200333 100644 --- a/ppapi/tests/test_post_message.cc +++ b/ppapi/tests/test_post_message.cc @@ -9,7 +9,6 @@ #include <map> #include <sstream> -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/pp_var.h" #include "ppapi/c/ppb_file_io.h" #include "ppapi/cpp/dev/var_resource_dev.h" @@ -128,7 +127,7 @@ bool VarsEqual(const pp::Var& expected, class ScopedArrayBufferSizeSetter { public: - ScopedArrayBufferSizeSetter(const PPB_Testing_Dev* interface, + ScopedArrayBufferSizeSetter(const PPB_Testing_Private* interface, PP_Instance instance, uint32_t threshold) : interface_(interface), @@ -139,7 +138,7 @@ class ScopedArrayBufferSizeSetter { interface_->SetMinimumArrayBufferSizeForShmem(instance_, 0); } private: - const PPB_Testing_Dev* interface_; + const PPB_Testing_Private* interface_; PP_Instance instance_; }; diff --git a/ppapi/tests/test_scrollbar.cc b/ppapi/tests/test_scrollbar.cc index cde40a7c7e..5bf3cf3832 100644 --- a/ppapi/tests/test_scrollbar.cc +++ b/ppapi/tests/test_scrollbar.cc @@ -6,7 +6,6 @@ #include <cstring> -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/pp_input_event.h" #include "ppapi/cpp/input_event.h" #include "ppapi/cpp/instance.h" diff --git a/ppapi/tests/test_talk_private.cc b/ppapi/tests/test_talk_private.cc index 3af0ff34d5..aa2b5c0f62 100644 --- a/ppapi/tests/test_talk_private.cc +++ b/ppapi/tests/test_talk_private.cc @@ -8,7 +8,6 @@ #include <string.h> #include <string> -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/private/ppb_talk_private.h" #include "ppapi/cpp/instance.h" diff --git a/ppapi/tests/test_truetype_font.cc b/ppapi/tests/test_truetype_font.cc index 1cb8c496d3..2295fe032a 100644 --- a/ppapi/tests/test_truetype_font.cc +++ b/ppapi/tests/test_truetype_font.cc @@ -10,7 +10,7 @@ #include <algorithm> #include <limits> -#include "ppapi/c/dev/ppb_testing_dev.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/cpp/dev/truetype_font_dev.h" #include "ppapi/cpp/instance.h" diff --git a/ppapi/tests/test_url_loader.cc b/ppapi/tests/test_url_loader.cc index c268eb09ac..835588e695 100644 --- a/ppapi/tests/test_url_loader.cc +++ b/ppapi/tests/test_url_loader.cc @@ -8,7 +8,6 @@ #include <string.h> #include <string> -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/ppb_file_io.h" #include "ppapi/c/ppb_url_loader.h" diff --git a/ppapi/tests/test_url_request.cc b/ppapi/tests/test_url_request.cc index 05a7bbaee4..febc867d29 100644 --- a/ppapi/tests/test_url_request.cc +++ b/ppapi/tests/test_url_request.cc @@ -9,7 +9,6 @@ #include <string.h> #include <string> -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/ppb_file_io.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/cpp/file_io.h" diff --git a/ppapi/tests/test_utils.cc b/ppapi/tests/test_utils.cc index eecbe7a96e..e091e68c49 100644 --- a/ppapi/tests/test_utils.cc +++ b/ppapi/tests/test_utils.cc @@ -36,10 +36,11 @@ bool IsBigEndian() { const int kActionTimeoutMs = 10000; -const PPB_Testing_Dev* GetTestingInterface() { - static const PPB_Testing_Dev* g_testing_interface = - static_cast<const PPB_Testing_Dev*>( - pp::Module::Get()->GetBrowserInterface(PPB_TESTING_DEV_INTERFACE)); +const PPB_Testing_Private* GetTestingInterface() { + static const PPB_Testing_Private* g_testing_interface = + static_cast<const PPB_Testing_Private*>( + pp::Module::Get()->GetBrowserInterface( + PPB_TESTING_PRIVATE_INTERFACE)); return g_testing_interface; } @@ -63,7 +64,7 @@ bool GetLocalHostPort(PP_Instance instance, std::string* host, uint16_t* port) { if (!host || !port) return false; - const PPB_Testing_Dev* testing = GetTestingInterface(); + const PPB_Testing_Private* testing = GetTestingInterface(); if (!testing) return false; diff --git a/ppapi/tests/test_utils.h b/ppapi/tests/test_utils.h index 4621c35574..257bdcd7e8 100644 --- a/ppapi/tests/test_utils.h +++ b/ppapi/tests/test_utils.h @@ -7,9 +7,9 @@ #include <string> -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_stdint.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/cpp/message_loop.h" #include "ppapi/utility/completion_callback_factory.h" @@ -21,7 +21,7 @@ class NetAddress; // Timeout to wait for some action to complete. extern const int kActionTimeoutMs; -const PPB_Testing_Dev* GetTestingInterface(); +const PPB_Testing_Private* GetTestingInterface(); std::string ReportError(const char* method, int32_t error); void PlatformSleep(int duration_ms); bool GetLocalHostPort(PP_Instance instance, std::string* host, uint16_t* port); diff --git a/ppapi/tests/test_var.cc b/ppapi/tests/test_var.cc index 0fedb13da3..714008a14b 100644 --- a/ppapi/tests/test_var.cc +++ b/ppapi/tests/test_var.cc @@ -8,7 +8,6 @@ #include <limits> -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/pp_var.h" #include "ppapi/c/ppb_var.h" #include "ppapi/cpp/instance.h" diff --git a/ppapi/tests/test_var_deprecated.cc b/ppapi/tests/test_var_deprecated.cc index 23633ac7c3..dbfa83e21d 100644 --- a/ppapi/tests/test_var_deprecated.cc +++ b/ppapi/tests/test_var_deprecated.cc @@ -9,7 +9,6 @@ #include <limits> #include "ppapi/c/pp_var.h" -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/dev/ppb_var_deprecated.h" #include "ppapi/cpp/dev/scriptable_object_deprecated.h" #include "ppapi/cpp/instance.h" diff --git a/ppapi/tests/test_video_decoder.cc b/ppapi/tests/test_video_decoder.cc index 0cee7949c1..dc36685cd2 100644 --- a/ppapi/tests/test_video_decoder.cc +++ b/ppapi/tests/test_video_decoder.cc @@ -5,7 +5,6 @@ #include "ppapi/tests/test_video_decoder.h" #include "ppapi/c/dev/ppb_video_decoder_dev.h" -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/ppb_var.h" #include "ppapi/tests/testing_instance.h" diff --git a/ppapi/tests/test_video_destination.cc b/ppapi/tests/test_video_destination.cc index 93f6f0b969..b06abcb4b0 100644 --- a/ppapi/tests/test_video_destination.cc +++ b/ppapi/tests/test_video_destination.cc @@ -10,7 +10,7 @@ #include <limits> #include <string> -#include "ppapi/c/dev/ppb_testing_dev.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/private/video_destination_private.h" diff --git a/ppapi/tests/test_video_source.cc b/ppapi/tests/test_video_source.cc index 585558ec90..b6587f870a 100644 --- a/ppapi/tests/test_video_source.cc +++ b/ppapi/tests/test_video_source.cc @@ -10,7 +10,7 @@ #include <algorithm> #include <limits> -#include "ppapi/c/dev/ppb_testing_dev.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/private/video_frame_private.h" diff --git a/ppapi/tests/test_view.cc b/ppapi/tests/test_view.cc index 44b02257f4..29ab1a652a 100644 --- a/ppapi/tests/test_view.cc +++ b/ppapi/tests/test_view.cc @@ -7,7 +7,7 @@ #include <sstream> #include "ppapi/c/pp_time.h" -#include "ppapi/c/dev/ppb_testing_dev.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/tests/testing_instance.h" diff --git a/ppapi/tests/test_websocket.cc b/ppapi/tests/test_websocket.cc index 3b654e2438..d22da3745a 100644 --- a/ppapi/tests/test_websocket.cc +++ b/ppapi/tests/test_websocket.cc @@ -12,7 +12,6 @@ #include <string> #include <vector> -#include "ppapi/c/dev/ppb_testing_dev.h" #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/pp_errors.h" @@ -23,6 +22,7 @@ #include "ppapi/c/ppb_var.h" #include "ppapi/c/ppb_var_array_buffer.h" #include "ppapi/c/ppb_websocket.h" +#include "ppapi/c/private/ppb_testing_private.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/var_array_buffer.h" diff --git a/ppapi/thunk/interfaces_ppb_private.h b/ppapi/thunk/interfaces_ppb_private.h index 9aac89b886..900254543b 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_7, - PPB_ContentDecryptor_Private_0_7) + PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_8, + PPB_ContentDecryptor_Private_0_8) 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_private_no_permissions.h b/ppapi/thunk/interfaces_ppb_private_no_permissions.h index 15e8043eef..3b4446f9fb 100644 --- a/ppapi/thunk/interfaces_ppb_private_no_permissions.h +++ b/ppapi/thunk/interfaces_ppb_private_no_permissions.h @@ -40,6 +40,8 @@ PROXIED_IFACE(NoAPIName, PPB_EXT_CRXFILESYSTEM_PRIVATE_INTERFACE_0_1, PPB_Ext_CrxFileSystem_Private_0_1) PROXIED_IFACE(NoAPIName, PPB_FILEIO_PRIVATE_INTERFACE_0_1, PPB_FileIO_Private_0_1) +PROXIED_IFACE(NoAPIName, PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE_0_2, + PPB_IsolatedFileSystem_Private_0_2) PROXIED_IFACE(NoAPIName, PPB_VIDEODESTINATION_PRIVATE_INTERFACE_0_1, PPB_VideoDestination_Private_0_1) diff --git a/ppapi/thunk/interfaces_ppb_public_dev.h b/ppapi/thunk/interfaces_ppb_public_dev.h index d07f5dcade..1ad85bcac3 100644 --- a/ppapi/thunk/interfaces_ppb_public_dev.h +++ b/ppapi/thunk/interfaces_ppb_public_dev.h @@ -68,6 +68,8 @@ PROXIED_IFACE(NoAPIName, PPB_CRYPTO_DEV_INTERFACE_0_1, PPB_Crypto_Dev_0_1) PROXIED_IFACE(NoAPIName, PPB_DEVICEREF_DEV_INTERFACE_0_1, PPB_DeviceRef_Dev_0_1) PROXIED_IFACE(NoAPIName, PPB_GRAPHICS2D_DEV_INTERFACE_0_1, PPB_Graphics2D_Dev_0_1) +PROXIED_IFACE(NoAPIName, PPB_GRAPHICS2D_DEV_INTERFACE_0_2, + PPB_Graphics2D_Dev_0_2) PROXIED_IFACE(PPB_Instance, PPB_CHAR_SET_DEV_INTERFACE_0_4, PPB_CharSet_Dev_0_4) PROXIED_IFACE(PPB_Instance, PPB_URLUTIL_DEV_INTERFACE_0_6, PPB_URLUtil_Dev_0_6) PROXIED_IFACE(PPB_Instance, PPB_URLUTIL_DEV_INTERFACE_0_7, PPB_URLUtil_Dev_0_7) diff --git a/ppapi/thunk/ppb_content_decryptor_private_thunk.cc b/ppapi/thunk/ppb_content_decryptor_private_thunk.cc index a43d24dea6..201d526dd2 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 10 14:49:51 2013. +// modified Thu Oct 17 15:03:48 2013. #include "ppapi/c/pp_errors.h" #include "ppapi/c/private/ppb_content_decryptor_private.h" @@ -18,46 +18,44 @@ namespace thunk { namespace { -void KeyAdded(PP_Instance instance, - struct PP_Var key_system, - struct PP_Var session_id) { +void KeyAdded(PP_Instance instance, uint32_t reference_id) { VLOG(4) << "PPB_ContentDecryptor_Private::KeyAdded()"; EnterInstance enter(instance); if (enter.failed()) return; - enter.functions()->KeyAdded(instance, key_system, session_id); + enter.functions()->KeyAdded(instance, reference_id); } void KeyMessage(PP_Instance instance, - struct PP_Var key_system, - struct PP_Var session_id, + uint32_t reference_id, struct PP_Var message, struct PP_Var default_url) { VLOG(4) << "PPB_ContentDecryptor_Private::KeyMessage()"; EnterInstance enter(instance); if (enter.failed()) return; - enter.functions()->KeyMessage(instance, - key_system, - session_id, - message, - default_url); + enter.functions()->KeyMessage(instance, reference_id, message, default_url); } void KeyError(PP_Instance instance, - struct PP_Var key_system, - struct PP_Var session_id, + uint32_t reference_id, int32_t media_error, int32_t system_code) { VLOG(4) << "PPB_ContentDecryptor_Private::KeyError()"; EnterInstance enter(instance); if (enter.failed()) return; - enter.functions()->KeyError(instance, - key_system, - session_id, - media_error, - system_code); + enter.functions()->KeyError(instance, reference_id, media_error, system_code); +} + +void SetSessionId(PP_Instance instance, + uint32_t reference_id, + struct PP_Var session_id) { + VLOG(4) << "PPB_ContentDecryptor_Private::SetSessionId()"; + EnterInstance enter(instance); + if (enter.failed()) + return; + enter.functions()->SetSessionId(instance, reference_id, session_id); } void DeliverBlock(PP_Instance instance, @@ -133,11 +131,12 @@ void DeliverSamples( decrypted_sample_info); } -const PPB_ContentDecryptor_Private_0_7 - g_ppb_contentdecryptor_private_thunk_0_7 = { +const PPB_ContentDecryptor_Private_0_8 + g_ppb_contentdecryptor_private_thunk_0_8 = { &KeyAdded, &KeyMessage, &KeyError, + &SetSessionId, &DeliverBlock, &DecoderInitializeDone, &DecoderDeinitializeDone, @@ -148,9 +147,9 @@ const PPB_ContentDecryptor_Private_0_7 } // namespace -const PPB_ContentDecryptor_Private_0_7* - GetPPB_ContentDecryptor_Private_0_7_Thunk() { - return &g_ppb_contentdecryptor_private_thunk_0_7; +const PPB_ContentDecryptor_Private_0_8* + GetPPB_ContentDecryptor_Private_0_8_Thunk() { + return &g_ppb_contentdecryptor_private_thunk_0_8; } } // namespace thunk diff --git a/ppapi/thunk/ppb_ext_crx_file_system_private_thunk.cc b/ppapi/thunk/ppb_ext_crx_file_system_private_thunk.cc index 7e18ba941d..67f0ec8686 100644 --- a/ppapi/thunk/ppb_ext_crx_file_system_private_thunk.cc +++ b/ppapi/thunk/ppb_ext_crx_file_system_private_thunk.cc @@ -2,16 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// From private/ppb_ext_crx_file_system_private.idl, -// modified Fri May 3 09:24:58 2013. - #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/private/ppb_ext_crx_file_system_private.h" #include "ppapi/shared_impl/tracked_callback.h" #include "ppapi/thunk/enter.h" -#include "ppapi/thunk/ppb_ext_crx_file_system_private_api.h" #include "ppapi/thunk/ppb_instance_api.h" +#include "ppapi/thunk/ppb_isolated_file_system_private_api.h" #include "ppapi/thunk/resource_creation_api.h" #include "ppapi/thunk/thunk.h" @@ -24,12 +21,15 @@ int32_t Open(PP_Instance instance, PP_Resource* file_system, struct PP_CompletionCallback callback) { VLOG(4) << "PPB_Ext_CrxFileSystem_Private::Open()"; - EnterInstanceAPI<PPB_Ext_CrxFileSystem_Private_API> enter(instance, callback); + EnterInstanceAPI<PPB_IsolatedFileSystem_Private_API> enter(instance, + callback); if (enter.failed()) return enter.retval(); - return enter.SetResult(enter.functions()->Open(instance, - file_system, - enter.callback())); + return enter.SetResult(enter.functions()->Open( + instance, + PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX, + file_system, + enter.callback())); } const PPB_Ext_CrxFileSystem_Private_0_1 diff --git a/ppapi/thunk/ppb_flash_drm_api.h b/ppapi/thunk/ppb_flash_drm_api.h index 87712b916b..9937bef45e 100644 --- a/ppapi/thunk/ppb_flash_drm_api.h +++ b/ppapi/thunk/ppb_flash_drm_api.h @@ -20,6 +20,9 @@ class PPAPI_THUNK_EXPORT PPB_Flash_DRM_API { virtual PP_Bool GetHmonitor(int64_t* hmonitor) = 0; virtual int32_t GetVoucherFile(PP_Resource* file_ref, scoped_refptr<TrackedCallback> callback) = 0; + virtual int32_t MonitorIsExternal( + PP_Bool* is_external, + scoped_refptr<TrackedCallback> callback) = 0; }; } // namespace thunk diff --git a/ppapi/thunk/ppb_flash_drm_thunk.cc b/ppapi/thunk/ppb_flash_drm_thunk.cc index eff2fdf74d..a7a3cbaa3c 100644 --- a/ppapi/thunk/ppb_flash_drm_thunk.cc +++ b/ppapi/thunk/ppb_flash_drm_thunk.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// From private/ppb_flash_drm.idl modified Sat Jun 8 16:45:26 2013. +// From private/ppb_flash_drm.idl modified Mon Nov 11 14:49:53 2013. #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/pp_errors.h" @@ -56,6 +56,17 @@ int32_t GetVoucherFile(PP_Resource drm, enter.callback())); } +int32_t MonitorIsExternal(PP_Resource drm, + PP_Bool* is_external, + struct PP_CompletionCallback callback) { + VLOG(4) << "PPB_Flash_DRM::MonitorIsExternal()"; + EnterResource<PPB_Flash_DRM_API> enter(drm, callback, true); + if (enter.failed()) + return enter.retval(); + return enter.SetResult(enter.object()->MonitorIsExternal(is_external, + enter.callback())); +} + const PPB_Flash_DRM_1_0 g_ppb_flash_drm_thunk_1_0 = { &Create, &GetDeviceID, @@ -63,11 +74,23 @@ const PPB_Flash_DRM_1_0 g_ppb_flash_drm_thunk_1_0 = { &GetVoucherFile }; +const PPB_Flash_DRM_1_1 g_ppb_flash_drm_thunk_1_1 = { + &Create, + &GetDeviceID, + &GetHmonitor, + &GetVoucherFile, + &MonitorIsExternal +}; + } // namespace const PPB_Flash_DRM_1_0* GetPPB_Flash_DRM_1_0_Thunk() { return &g_ppb_flash_drm_thunk_1_0; } +const PPB_Flash_DRM_1_1* GetPPB_Flash_DRM_1_1_Thunk() { + return &g_ppb_flash_drm_thunk_1_1; +} + } // namespace thunk } // namespace ppapi diff --git a/ppapi/thunk/ppb_graphics_2d_api.h b/ppapi/thunk/ppb_graphics_2d_api.h index 4e1bda398b..0709a50ba9 100644 --- a/ppapi/thunk/ppb_graphics_2d_api.h +++ b/ppapi/thunk/ppb_graphics_2d_api.h @@ -6,6 +6,7 @@ #define PPAPI_THUNK_PPB_GRAPHICS_2D_API_H_ #include "base/memory/ref_counted.h" +#include "ppapi/c/dev/ppb_graphics_2d_dev.h" #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/pp_point.h" @@ -36,6 +37,8 @@ class PPAPI_THUNK_EXPORT PPB_Graphics2D_API { // Dev interface. virtual PP_Bool SetScale(float scale) = 0; virtual float GetScale() = 0; + virtual void SetOffset(const PP_Point* offset) = 0; + virtual void SetResizeMode(PP_Graphics2D_Dev_ResizeMode resize_mode) = 0; // Test only virtual bool ReadImageData(PP_Resource image, const PP_Point* top_left) = 0; diff --git a/ppapi/thunk/ppb_graphics_2d_dev_thunk.cc b/ppapi/thunk/ppb_graphics_2d_dev_thunk.cc index 760ecee2a4..288215555b 100644 --- a/ppapi/thunk/ppb_graphics_2d_dev_thunk.cc +++ b/ppapi/thunk/ppb_graphics_2d_dev_thunk.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// From dev/ppb_graphics_2d_dev.idl modified Fri Apr 26 08:52:02 2013. +// From dev/ppb_graphics_2d_dev.idl modified Fri Nov 8 13:58:50 2013. #include "ppapi/c/dev/ppb_graphics_2d_dev.h" #include "ppapi/c/pp_errors.h" @@ -34,9 +34,34 @@ float GetScale(PP_Resource resource) { return enter.object()->GetScale(); } +void SetOffset(PP_Resource resource, const struct PP_Point* offset) { + VLOG(4) << "PPB_Graphics2D_Dev::SetOffset()"; + EnterResource<PPB_Graphics2D_API> enter(resource, true); + if (enter.failed()) + return; + enter.object()->SetOffset(offset); +} + +void SetResizeMode(PP_Resource resource, + PP_Graphics2D_Dev_ResizeMode resize_mode) { + VLOG(4) << "PPB_Graphics2D_Dev::SetResizeMode()"; + EnterResource<PPB_Graphics2D_API> enter(resource, true); + if (enter.failed()) + return; + enter.object()->SetResizeMode(resize_mode); +} + const PPB_Graphics2D_Dev_0_1 g_ppb_graphics2d_dev_thunk_0_1 = { &SetScale, - &GetScale + &GetScale, + &SetResizeMode +}; + +const PPB_Graphics2D_Dev_0_2 g_ppb_graphics2d_dev_thunk_0_2 = { + &SetScale, + &GetScale, + &SetOffset, + &SetResizeMode }; } // namespace @@ -45,5 +70,9 @@ const PPB_Graphics2D_Dev_0_1* GetPPB_Graphics2D_Dev_0_1_Thunk() { return &g_ppb_graphics2d_dev_thunk_0_1; } +const PPB_Graphics2D_Dev_0_2* GetPPB_Graphics2D_Dev_0_2_Thunk() { + return &g_ppb_graphics2d_dev_thunk_0_2; +} + } // namespace thunk } // namespace ppapi diff --git a/ppapi/thunk/ppb_instance_api.h b/ppapi/thunk/ppb_instance_api.h index 93eba9ca4f..60e4f073d1 100644 --- a/ppapi/thunk/ppb_instance_api.h +++ b/ppapi/thunk/ppb_instance_api.h @@ -143,18 +143,18 @@ class PPB_Instance_API { #if !defined(OS_NACL) // Content Decryptor. virtual void KeyAdded(PP_Instance instance, - PP_Var key_system, - PP_Var session_id) = 0; + uint32 reference_id) = 0; virtual void KeyMessage(PP_Instance instance, - PP_Var key_system, - PP_Var session_id, + uint32 reference_id, PP_Var message, PP_Var default_url) = 0; virtual void KeyError(PP_Instance instance, - PP_Var key_system, - PP_Var session_id, + 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 DeliverBlock(PP_Instance instance, PP_Resource decrypted_block, const PP_DecryptedBlockInfo* block_info) = 0; diff --git a/ppapi/thunk/ppb_ext_crx_file_system_private_api.h b/ppapi/thunk/ppb_isolated_file_system_private_api.h index 9af926d3b1..bca233279f 100644 --- a/ppapi/thunk/ppb_ext_crx_file_system_private_api.h +++ b/ppapi/thunk/ppb_isolated_file_system_private_api.h @@ -1,11 +1,12 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// 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. -#ifndef PPAPI_THUNK_PPB_EXT_CRX_FILE_SYSTEM_API_H_ -#define PPAPI_THUNK_PPB_EXT_CRX_FILE_SYSTEM_API_H_ +#ifndef PPAPI_THUNK_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_API_H_ +#define PPAPI_THUNK_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_API_H_ #include "base/memory/ref_counted.h" +#include "ppapi/c/private/ppb_isolated_file_system_private.h" #include "ppapi/shared_impl/singleton_resource_id.h" #include "ppapi/shared_impl/tracked_callback.h" #include "ppapi/thunk/ppapi_thunk_export.h" @@ -16,19 +17,20 @@ class TrackedCallback; namespace thunk { -class PPAPI_THUNK_EXPORT PPB_Ext_CrxFileSystem_Private_API { +class PPAPI_THUNK_EXPORT PPB_IsolatedFileSystem_Private_API { public: - virtual ~PPB_Ext_CrxFileSystem_Private_API() {} + virtual ~PPB_IsolatedFileSystem_Private_API() {} virtual int32_t Open(PP_Instance instance, + PP_IsolatedFileSystemType_Private type, PP_Resource* file_system, scoped_refptr<TrackedCallback> callback) = 0; static const SingletonResourceID kSingletonResourceID = - CRX_FILESYSTEM_SINGLETON_ID; + ISOLATED_FILESYSTEM_SINGLETON_ID; }; } // namespace thunk } // namespace ppapi -#endif // PPAPI_THUNK_PPB_EXT_CRX_FILE_SYSTEM_API_H_ +#endif // PPAPI_THUNK_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_API_H_ diff --git a/ppapi/thunk/ppb_isolated_file_system_private_thunk.cc b/ppapi/thunk/ppb_isolated_file_system_private_thunk.cc new file mode 100644 index 0000000000..cd58b24527 --- /dev/null +++ b/ppapi/thunk/ppb_isolated_file_system_private_thunk.cc @@ -0,0 +1,51 @@ +// 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 private/ppb_isolated_file_system_private.idl, +// modified Fri Nov 8 02:21:15 2013. + +#include "ppapi/c/pp_completion_callback.h" +#include "ppapi/c/pp_errors.h" +#include "ppapi/c/private/ppb_isolated_file_system_private.h" +#include "ppapi/shared_impl/tracked_callback.h" +#include "ppapi/thunk/enter.h" +#include "ppapi/thunk/ppb_instance_api.h" +#include "ppapi/thunk/ppb_isolated_file_system_private_api.h" +#include "ppapi/thunk/resource_creation_api.h" +#include "ppapi/thunk/thunk.h" + +namespace ppapi { +namespace thunk { + +namespace { + +int32_t Open(PP_Instance instance, + PP_IsolatedFileSystemType_Private type, + PP_Resource* file_system, + struct PP_CompletionCallback callback) { + VLOG(4) << "PPB_IsolatedFileSystem_Private::Open()"; + EnterInstanceAPI<PPB_IsolatedFileSystem_Private_API> enter(instance, + callback); + if (enter.failed()) + return enter.retval(); + return enter.SetResult(enter.functions()->Open(instance, + type, + file_system, + enter.callback())); +} + +const PPB_IsolatedFileSystem_Private_0_2 + g_ppb_isolatedfilesystem_private_thunk_0_2 = { + &Open +}; + +} // namespace + +const PPB_IsolatedFileSystem_Private_0_2* + GetPPB_IsolatedFileSystem_Private_0_2_Thunk() { + return &g_ppb_isolatedfilesystem_private_thunk_0_2; +} + +} // namespace thunk +} // namespace ppapi diff --git a/ppapi/thunk/ppb_pdf_api.h b/ppapi/thunk/ppb_pdf_api.h index c5d276a4bf..a23c527189 100644 --- a/ppapi/thunk/ppb_pdf_api.h +++ b/ppapi/thunk/ppb_pdf_api.h @@ -31,6 +31,7 @@ class PPB_PDF_API { virtual void Print() = 0; virtual PP_Resource GetResourceImageForScale(PP_ResourceImage image_id, float scale) = 0; + virtual PP_Bool IsOutOfProcess() = 0; static const SingletonResourceID kSingletonResourceID = PDF_SINGLETON_ID; }; diff --git a/ppapi/thunk/ppb_pdf_thunk.cc b/ppapi/thunk/ppb_pdf_thunk.cc index 94334d143a..282f893485 100644 --- a/ppapi/thunk/ppb_pdf_thunk.cc +++ b/ppapi/thunk/ppb_pdf_thunk.cc @@ -133,6 +133,20 @@ PP_Resource GetResourceImageForScale(PP_Instance instance, return enter.functions()->GetResourceImageForScale(image_id, scale); } +PP_Var ModalPromptForPassword(PP_Instance instance_id, + PP_Var message) { + // TODO(raymes): Implement or remove this function. + NOTIMPLEMENTED(); + return PP_MakeUndefined(); +} + +PP_Bool IsOutOfProcess(PP_Instance instance) { + EnterInstanceAPI<PPB_PDF_API> enter(instance); + if (enter.failed()) + return PP_FALSE; + return enter.functions()->IsOutOfProcess(); +} + const PPB_PDF g_ppb_pdf_thunk = { &GetLocalizedString, &GetResourceImage, @@ -148,7 +162,9 @@ const PPB_PDF g_ppb_pdf_thunk = { &SaveAs, &Print, &IsFeatureEnabled, - &GetResourceImageForScale + &GetResourceImageForScale, + &ModalPromptForPassword, + &IsOutOfProcess, }; } // namespace |