summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authordschuff@chromium.org <dschuff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-04 21:34:25 +0000
committerdschuff@chromium.org <dschuff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-04 21:34:25 +0000
commita675c011e16db84fc2022a34d25a8c03bf76cdcd (patch)
tree1ad1e0006ad26f651a85961570ccc8f13ab7746b /ppapi
parent50c79657b611ac92cbe54dc94ecb2f60d802688b (diff)
downloadchromium_src-a675c011e16db84fc2022a34d25a8c03bf76cdcd.zip
chromium_src-a675c011e16db84fc2022a34d25a8c03bf76cdcd.tar.gz
chromium_src-a675c011e16db84fc2022a34d25a8c03bf76cdcd.tar.bz2
Handle cache-control:no-store header in PNaCl translation cache
Pexe files with the cache-control:no-store header should not be cached. Add a field to the PnaclCacheInfo struct, plumb the value all the way from the plugin to the browser, and treat it basically the same way we currently treat incognito translations (since we currently don't have an off-the-record cache for those). R=jvoung@chromium.org BUG=none, noticed this was missing when doing cleanup Review URL: https://chromiumcodereview.appspot.com/23458015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221275 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/api/private/ppb_nacl_private.idl26
-rw-r--r--ppapi/c/private/ppb_nacl_private.h28
-rw-r--r--ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc1
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c6
4 files changed, 33 insertions, 28 deletions
diff --git a/ppapi/api/private/ppb_nacl_private.idl b/ppapi/api/private/ppb_nacl_private.idl
index 755b8d7..4bb602f 100644
--- a/ppapi/api/private/ppb_nacl_private.idl
+++ b/ppapi/api/private/ppb_nacl_private.idl
@@ -106,18 +106,19 @@ interface PPB_NaCl_Private {
*/
PP_FileHandle CreateTemporaryFile([in] PP_Instance instance);
- /* 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|,
- * |last_modified|, and |etag|. 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.
+ /* 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|, |last_modified|, |etag|, and
+ * |has_no_store_header|. 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,
@@ -125,6 +126,7 @@ interface PPB_NaCl_Private {
[in] uint32_t opt_level,
[in] str_t last_modified,
[in] str_t etag,
+ [in] PP_Bool has_no_store_header,
[out] PP_Bool is_hit,
[out] PP_FileHandle nexe_handle,
[in] PP_CompletionCallback callback);
diff --git a/ppapi/c/private/ppb_nacl_private.h b/ppapi/c/private/ppb_nacl_private.h
index 772998b..6441efd 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 Mon Aug 19 14:06:38 2013. */
+/* From private/ppb_nacl_private.idl modified Thu Aug 29 17:42:12 2013. */
#ifndef PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_
#define PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_
@@ -122,18 +122,19 @@ struct PPB_NaCl_Private_1_0 {
* returns a posix handle to that temporary file.
*/
PP_FileHandle (*CreateTemporaryFile)(PP_Instance instance);
- /* 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|,
- * |last_modified|, and |etag|. 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.
+ /* 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|, |last_modified|, |etag|, and
+ * |has_no_store_header|. 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)(PP_Instance instance,
const char* pexe_url,
@@ -141,6 +142,7 @@ struct PPB_NaCl_Private_1_0 {
uint32_t opt_level,
const char* last_modified,
const char* etag,
+ PP_Bool has_no_store_header,
PP_Bool* is_hit,
PP_FileHandle* nexe_handle,
struct PP_CompletionCallback callback);
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc
index 1a29c70..f4d30bf 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc
@@ -521,6 +521,7 @@ void PnaclCoordinator::BitcodeStreamDidOpen(int32_t pp_error) {
pnacl_options_.opt_level(),
parser.GetHeader("last-modified").c_str(),
parser.GetHeader("etag").c_str(),
+ PP_FromBool(parser.CacheControlNoStore()),
&is_cache_hit_,
temp_nexe_file_->existing_handle(),
cb.pp_completion_callback());
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 50268de..ab650c9 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
@@ -2848,9 +2848,9 @@ static PP_FileHandle Pnacl_M25_PPB_NaCl_Private_CreateTemporaryFile(PP_Instance
return iface->CreateTemporaryFile(instance);
}
-static int32_t Pnacl_M25_PPB_NaCl_Private_GetNexeFd(PP_Instance instance, const char* pexe_url, uint32_t abi_version, uint32_t opt_level, const char* last_modified, const char* etag, PP_Bool* is_hit, PP_FileHandle* nexe_handle, struct PP_CompletionCallback* callback) {
+static int32_t Pnacl_M25_PPB_NaCl_Private_GetNexeFd(PP_Instance instance, const char* pexe_url, uint32_t abi_version, uint32_t opt_level, const char* last_modified, const char* etag, PP_Bool has_no_store_header, PP_Bool* is_hit, PP_FileHandle* nexe_handle, struct PP_CompletionCallback* callback) {
const struct PPB_NaCl_Private_1_0 *iface = Pnacl_WrapperInfo_PPB_NaCl_Private_1_0.real_iface;
- return iface->GetNexeFd(instance, pexe_url, abi_version, opt_level, last_modified, etag, is_hit, nexe_handle, *callback);
+ return iface->GetNexeFd(instance, pexe_url, abi_version, opt_level, last_modified, etag, has_no_store_header, is_hit, nexe_handle, *callback);
}
static void Pnacl_M25_PPB_NaCl_Private_ReportTranslationFinished(PP_Instance instance, PP_Bool success) {
@@ -4684,7 +4684,7 @@ struct PPB_NaCl_Private_1_0 Pnacl_Wrappers_PPB_NaCl_Private_1_0 = {
.EnsurePnaclInstalled = (int32_t (*)(PP_Instance instance, struct PP_CompletionCallback callback))&Pnacl_M25_PPB_NaCl_Private_EnsurePnaclInstalled,
.GetReadonlyPnaclFd = (PP_FileHandle (*)(const char* filename))&Pnacl_M25_PPB_NaCl_Private_GetReadonlyPnaclFd,
.CreateTemporaryFile = (PP_FileHandle (*)(PP_Instance instance))&Pnacl_M25_PPB_NaCl_Private_CreateTemporaryFile,
- .GetNexeFd = (int32_t (*)(PP_Instance instance, const char* pexe_url, uint32_t abi_version, uint32_t opt_level, const char* last_modified, const char* etag, PP_Bool* is_hit, PP_FileHandle* nexe_handle, struct PP_CompletionCallback callback))&Pnacl_M25_PPB_NaCl_Private_GetNexeFd,
+ .GetNexeFd = (int32_t (*)(PP_Instance instance, const char* pexe_url, uint32_t abi_version, uint32_t opt_level, const char* last_modified, const char* etag, PP_Bool has_no_store_header, PP_Bool* is_hit, PP_FileHandle* nexe_handle, struct PP_CompletionCallback callback))&Pnacl_M25_PPB_NaCl_Private_GetNexeFd,
.ReportTranslationFinished = (void (*)(PP_Instance instance, PP_Bool success))&Pnacl_M25_PPB_NaCl_Private_ReportTranslationFinished,
.IsOffTheRecord = (PP_Bool (*)(void))&Pnacl_M25_PPB_NaCl_Private_IsOffTheRecord,
.IsPnaclEnabled = (PP_Bool (*)(void))&Pnacl_M25_PPB_NaCl_Private_IsPnaclEnabled,