diff options
author | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-22 15:54:45 +0000 |
---|---|---|
committer | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-22 15:54:45 +0000 |
commit | 262509a82256d68cf728cbd6f0a9f4c80888250f (patch) | |
tree | 49d32e27a1c0c72689b376aee73687a08c1cc7c1 /ppapi/api | |
parent | e13c91421aac9bfc656106ccc284f7c940284fac (diff) | |
download | chromium_src-262509a82256d68cf728cbd6f0a9f4c80888250f.zip chromium_src-262509a82256d68cf728cbd6f0a9f4c80888250f.tar.gz chromium_src-262509a82256d68cf728cbd6f0a9f4c80888250f.tar.bz2 |
Pepper: Delete FileDownloader in trusted plugin.
This simplifies PnaclCoordinator considerably and reduces the total
amount of code in the trusted plugin.
BUG=239656
Review URL: https://codereview.chromium.org/393693004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284684 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/api')
-rw-r--r-- | ppapi/api/private/ppb_nacl_private.idl | 36 | ||||
-rw-r--r-- | ppapi/api/private/ppp_pexe_stream_handler.idl | 45 |
2 files changed, 59 insertions, 22 deletions
diff --git a/ppapi/api/private/ppb_nacl_private.idl b/ppapi/api/private/ppb_nacl_private.idl index 1992aed..d847cc7 100644 --- a/ppapi/api/private/ppb_nacl_private.idl +++ b/ppapi/api/private/ppb_nacl_private.idl @@ -237,28 +237,6 @@ interface PPB_NaCl_Private { /* Return whether the non-SFI mode is enabled. */ PP_Bool IsNonSFIModeEnabled(); - /* Create a temporary file, which will be deleted by the time the - * last handle is closed (or earlier on POSIX systems), to use for - * the nexe with the cache information given by |pexe_url|, - * |abi_version|, |opt_level|, and |headers|. If the nexe is already present - * in the cache, |is_hit| is set to PP_TRUE and the contents of the nexe will - * be copied into the temporary file. Otherwise |is_hit| is set to PP_FALSE - * and the temporary file will be writeable. Currently the implementation is - * a stub, which always sets is_hit to false and calls the implementation of - * CreateTemporaryFile. In a subsequent CL it will call into the browser - * which will remember the association between the cache key and the fd, and - * copy the nexe into the cache after the translation finishes. - */ - int32_t GetNexeFd([in] PP_Instance instance, - [in] str_t pexe_url, - [in] uint32_t abi_version, - [in] uint32_t opt_level, - [in] str_t headers, - [in] str_t extra_flags, - [out] PP_Bool is_hit, - [out] PP_FileHandle nexe_handle, - [in] PP_CompletionCallback callback); - /* Report to the browser that translation of the pexe for |instance| * has finished, or aborted with an error. If |success| is true, the * browser may then store the translation in the cache. The renderer @@ -419,4 +397,18 @@ interface PPB_NaCl_Private { * time. */ void SetPNaClStartTime([in] PP_Instance instance); + + /* Downloads and streams a pexe file for PNaCl translation. + * Fetches the content at |pexe_url| for the given instance and opt_level. + * If a translated cached nexe is already available, |cache_hit_handle| + * is set and |cache_hit_callback| is called. + * Otherwise, |stream_callback| is called repeatedly with blocks of data + * as they are received. |stream_finished_callback| is called after all + * data has been received and dispatched to |stream_callback|. + */ + void StreamPexe([in] PP_Instance instance, + [in] str_t pexe_url, + [in] int32_t opt_level, + [in] PPP_PexeStreamHandler stream_handler, + [inout] mem_t stream_handler_user_data); }; diff --git a/ppapi/api/private/ppp_pexe_stream_handler.idl b/ppapi/api/private/ppp_pexe_stream_handler.idl new file mode 100644 index 0000000..c2c8bf1 --- /dev/null +++ b/ppapi/api/private/ppp_pexe_stream_handler.idl @@ -0,0 +1,45 @@ +/* Copyright 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* This file contains NaCl private interfaces. This interface is not versioned + * and is for internal Chrome use. It may change without notice. */ + +#inline c +#include "ppapi/c/private/pp_file_handle.h" +#endinl + +label Chrome { + M25 = 1.0 +}; + +interface PPP_PexeStreamHandler { + /** + * Invoked as a result of a cache hit for a translated pexe. + */ + void DidCacheHit([inout] mem_t user_data, + [in] PP_FileHandle nexe_file_handle); + + /** + * Invoked as a result of a cache miss for a translated pexe. + * Provides the expected length of the pexe, as read from HTTP headers. + */ + void DidCacheMiss([inout] mem_t user_data, + [in] int64_t expected_total_length); + + /** + * Invoked when a block of data has been downloaded. + * Only invoked after DidCacheMiss(). + */ + void DidStreamData([inout] mem_t user_data, + [in] mem_t data, + [in] int32_t length); + + /** + * Invoked when the stream has finished downloading, regardless of whether it + * succeeded. Not invoked if DidCacheHit() was called. + */ + void DidFinishStream([inout] mem_t user_data, + [in] int32_t pp_error); +}; |