Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: chrome/renderer/pepper/ppb_nacl_private_impl.cc

Issue 23458015: Handle cache-control:no-store header in PNaCl translation cache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix iterator use Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/pepper/ppb_nacl_private_impl.h" 5 #include "chrome/renderer/pepper/ppb_nacl_private_impl.h"
6 6
7 #ifndef DISABLE_NACL 7 #ifndef DISABLE_NACL
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 transit_fd); 251 transit_fd);
252 return handle; 252 return handle;
253 } 253 }
254 254
255 int32_t GetNexeFd(PP_Instance instance, 255 int32_t GetNexeFd(PP_Instance instance,
256 const char* pexe_url, 256 const char* pexe_url,
257 uint32_t abi_version, 257 uint32_t abi_version,
258 uint32_t opt_level, 258 uint32_t opt_level,
259 const char* last_modified, 259 const char* last_modified,
260 const char* etag, 260 const char* etag,
261 PP_Bool has_no_store_header,
261 PP_Bool* is_hit, 262 PP_Bool* is_hit,
262 PP_FileHandle* handle, 263 PP_FileHandle* handle,
263 struct PP_CompletionCallback callback) { 264 struct PP_CompletionCallback callback) {
264 ppapi::thunk::EnterInstance enter(instance, callback); 265 ppapi::thunk::EnterInstance enter(instance, callback);
265 if (enter.failed()) 266 if (enter.failed())
266 return enter.retval(); 267 return enter.retval();
267 if (!pexe_url || !last_modified || !etag || !is_hit || !handle) 268 if (!pexe_url || !last_modified || !etag || !is_hit || !handle)
268 return enter.SetResult(PP_ERROR_BADARGUMENT); 269 return enter.SetResult(PP_ERROR_BADARGUMENT);
269 if (!InitializePnaclResourceHost()) 270 if (!InitializePnaclResourceHost())
270 return enter.SetResult(PP_ERROR_FAILED); 271 return enter.SetResult(PP_ERROR_FAILED);
271 272
272 base::Time last_modified_time; 273 base::Time last_modified_time;
273 // If FromString fails, it doesn't touch last_modified_time and we just send 274 // If FromString fails, it doesn't touch last_modified_time and we just send
274 // the default-constructed null value. 275 // the default-constructed null value.
275 base::Time::FromString(last_modified, &last_modified_time); 276 base::Time::FromString(last_modified, &last_modified_time);
276 277
277 nacl::PnaclCacheInfo cache_info; 278 nacl::PnaclCacheInfo cache_info;
278 cache_info.pexe_url = GURL(pexe_url); 279 cache_info.pexe_url = GURL(pexe_url);
279 cache_info.abi_version = abi_version; 280 cache_info.abi_version = abi_version;
280 cache_info.opt_level = opt_level; 281 cache_info.opt_level = opt_level;
281 cache_info.last_modified = last_modified_time; 282 cache_info.last_modified = last_modified_time;
282 cache_info.etag = std::string(etag); 283 cache_info.etag = std::string(etag);
284 cache_info.has_no_store_header = PP_ToBool(has_no_store_header);
283 285
284 g_pnacl_resource_host.Get()->RequestNexeFd( 286 g_pnacl_resource_host.Get()->RequestNexeFd(
285 GetRoutingID(instance), 287 GetRoutingID(instance),
286 instance, 288 instance,
287 cache_info, 289 cache_info,
288 is_hit, 290 is_hit,
289 handle, 291 handle,
290 enter.callback()); 292 enter.callback());
291 293
292 return enter.SetResult(PP_OK_COMPLETIONPENDING); 294 return enter.SetResult(PP_OK_COMPLETIONPENDING);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 &OpenNaClExecutable 371 &OpenNaClExecutable
370 }; 372 };
371 373
372 } // namespace 374 } // namespace
373 375
374 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { 376 const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() {
375 return &nacl_interface; 377 return &nacl_interface;
376 } 378 }
377 379
378 #endif // DISABLE_NACL 380 #endif // DISABLE_NACL
OLDNEW
« no previous file with comments | « chrome/browser/nacl_host/pnacl_host_unittest.cc ('k') | components/nacl/common/nacl_host_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698