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

Side by Side Diff: components/nacl/renderer/ppb_nacl_private_impl.cc

Issue 163433015: Add sandbox ISA and extra compile flag fields to PNaCl translation cache key (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/nacl/renderer/ppb_nacl_private_impl.h" 5 #include "components/nacl/renderer/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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 return handle; 256 return handle;
257 } 257 }
258 258
259 int32_t GetNexeFd(PP_Instance instance, 259 int32_t GetNexeFd(PP_Instance instance,
260 const char* pexe_url, 260 const char* pexe_url,
261 uint32_t abi_version, 261 uint32_t abi_version,
262 uint32_t opt_level, 262 uint32_t opt_level,
263 const char* last_modified, 263 const char* last_modified,
264 const char* etag, 264 const char* etag,
265 PP_Bool has_no_store_header, 265 PP_Bool has_no_store_header,
266 const char* sandbox_isa,
267 const char* extra_flags,
266 PP_Bool* is_hit, 268 PP_Bool* is_hit,
267 PP_FileHandle* handle, 269 PP_FileHandle* handle,
268 struct PP_CompletionCallback callback) { 270 struct PP_CompletionCallback callback) {
269 ppapi::thunk::EnterInstance enter(instance, callback); 271 ppapi::thunk::EnterInstance enter(instance, callback);
270 if (enter.failed()) 272 if (enter.failed())
271 return enter.retval(); 273 return enter.retval();
272 if (!pexe_url || !last_modified || !etag || !is_hit || !handle) 274 if (!pexe_url || !last_modified || !etag || !is_hit || !handle)
273 return enter.SetResult(PP_ERROR_BADARGUMENT); 275 return enter.SetResult(PP_ERROR_BADARGUMENT);
274 if (!InitializePnaclResourceHost()) 276 if (!InitializePnaclResourceHost())
275 return enter.SetResult(PP_ERROR_FAILED); 277 return enter.SetResult(PP_ERROR_FAILED);
276 278
277 base::Time last_modified_time; 279 base::Time last_modified_time;
278 // If FromString fails, it doesn't touch last_modified_time and we just send 280 // If FromString fails, it doesn't touch last_modified_time and we just send
279 // the default-constructed null value. 281 // the default-constructed null value.
280 base::Time::FromString(last_modified, &last_modified_time); 282 base::Time::FromString(last_modified, &last_modified_time);
281 283
282 nacl::PnaclCacheInfo cache_info; 284 nacl::PnaclCacheInfo cache_info;
283 cache_info.pexe_url = GURL(pexe_url); 285 cache_info.pexe_url = GURL(pexe_url);
284 cache_info.abi_version = abi_version; 286 cache_info.abi_version = abi_version;
285 cache_info.opt_level = opt_level; 287 cache_info.opt_level = opt_level;
286 cache_info.last_modified = last_modified_time; 288 cache_info.last_modified = last_modified_time;
287 cache_info.etag = std::string(etag); 289 cache_info.etag = std::string(etag);
288 cache_info.has_no_store_header = PP_ToBool(has_no_store_header); 290 cache_info.has_no_store_header = PP_ToBool(has_no_store_header);
291 cache_info.sandbox_isa = std::string(sandbox_isa);
292 cache_info.extra_flags = std::string(extra_flags);
289 293
290 g_pnacl_resource_host.Get()->RequestNexeFd( 294 g_pnacl_resource_host.Get()->RequestNexeFd(
291 GetRoutingID(instance), 295 GetRoutingID(instance),
292 instance, 296 instance,
293 cache_info, 297 cache_info,
294 is_hit, 298 is_hit,
295 handle, 299 handle,
296 enter.callback()); 300 enter.callback());
297 301
298 return enter.SetResult(PP_OK_COMPLETIONPENDING); 302 return enter.SetResult(PP_OK_COMPLETIONPENDING);
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 481
478 namespace nacl { 482 namespace nacl {
479 483
480 const PPB_NaCl_Private* GetNaClPrivateInterface() { 484 const PPB_NaCl_Private* GetNaClPrivateInterface() {
481 return &nacl_interface; 485 return &nacl_interface;
482 } 486 }
483 487
484 } // namespace nacl 488 } // namespace nacl
485 489
486 #endif // DISABLE_NACL 490 #endif // DISABLE_NACL
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698