diff options
author | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-23 16:55:03 +0000 |
---|---|---|
committer | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-23 16:55:03 +0000 |
commit | 45cba27eb5ab9f37429a412cf616f23ec974fd18 (patch) | |
tree | ff592bc0ce8553e4637262ed692c8cc42301b249 /ppapi/api/private/ppb_nacl_private.idl | |
parent | dc0a1b2777acc4b9b97de6c471eb8e35dcac2254 (diff) | |
download | chromium_src-45cba27eb5ab9f37429a412cf616f23ec974fd18.zip chromium_src-45cba27eb5ab9f37429a412cf616f23ec974fd18.tar.gz chromium_src-45cba27eb5ab9f37429a412cf616f23ec974fd18.tar.bz2 |
Pepper: Move StreamAsFile out of trusted plugin.
This removes a significant amount of code from the trusted plugin and
simplifies the callbacks that are used in PluginReverseInterface.
I was confused at first by the existing use of url_file_info_map_; it looks
like it was intended to serve as a cache for retrieved files, but I think the
files would be reopened every time, even if the file was already open. For
simplicity, I didn't try to add any caching behavior in this change.
Note that this changes progress events to be rate limited at 10ms per-file,
not 10ms per-plugin. It's a bit simpler to write this way, but I can
change that limit to be per-plugin if that makes more sense.
BUG=370556
R=bbudge@chromium.org
Review URL: https://codereview.chromium.org/294633003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/api/private/ppb_nacl_private.idl')
-rw-r--r-- | ppapi/api/private/ppb_nacl_private.idl | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/ppapi/api/private/ppb_nacl_private.idl b/ppapi/api/private/ppb_nacl_private.idl index 530132d..8272503 100644 --- a/ppapi/api/private/ppb_nacl_private.idl +++ b/ppapi/api/private/ppb_nacl_private.idl @@ -166,6 +166,16 @@ interface PPP_ManifestService { [inout] mem_t callback_user_data); }; +/* Corresponds to NaClFileInfo in + * native_client/src/trusted/validator/nacl_file_info.h */ +struct PP_NaClFileInfo { + PP_FileHandle handle; + + /* See NaClFileToken comment in nacl_file_info.h */ + uint64_t token_lo; + uint64_t token_hi; +}; + /* PPB_NaCl_Private */ interface PPB_NaCl_Private { /* Launches NaCl's sel_ldr process. Returns PP_EXTERNAL_PLUGIN_OK on success @@ -281,16 +291,6 @@ interface PPB_NaCl_Private { void ReportTranslationFinished([in] PP_Instance instance, [in] PP_Bool success); - /* Opens a NaCl executable file in the application's extension directory - * corresponding to the file URL and returns a file descriptor, or an invalid - * handle on failure. |metadata| is left unchanged on failure. - */ - PP_FileHandle OpenNaClExecutable([in] PP_Instance instance, - [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. */ @@ -373,9 +373,6 @@ interface PPB_NaCl_Private { PP_Var GetManifestBaseURL([in] PP_Instance instance); - PP_Bool ResolvesRelativeToPluginBaseUrl([in] PP_Instance instance, - [in] str_t url); - /* Processes the NaCl manifest once it's been retrieved. * TODO(teravest): Move the rest of the supporting logic out of the trusted * plugin. @@ -436,4 +433,11 @@ interface PPB_NaCl_Private { [out] uint64_t file_token_lo, [out] uint64_t file_token_hi, [in] PP_CompletionCallback callback); + + /* Downloads a non-nexe file specified in the manifest, and sets |file_info| + * to corresponding information about the file. */ + void DownloadFile([in] PP_Instance instance, + [in] str_t url, + [out] PP_NaClFileInfo file_info, + [in] PP_CompletionCallback callback); }; |