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

Side by Side Diff: components/nacl/browser/pnacl_translation_cache.cc

Issue 1005173006: Add a switch for using PNaCl Subzero and use it for -O0 translation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix takefileinfo Created 5 years, 8 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
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/browser/pnacl_translation_cache.h" 5 #include "components/nacl/browser/pnacl_translation_cache.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 // Beware that any changes to this function or to PnaclCacheInfo will 407 // Beware that any changes to this function or to PnaclCacheInfo will
408 // effectively invalidate existing translation cache entries. 408 // effectively invalidate existing translation cache entries.
409 409
410 // static 410 // static
411 std::string PnaclTranslationCache::GetKey(const nacl::PnaclCacheInfo& info) { 411 std::string PnaclTranslationCache::GetKey(const nacl::PnaclCacheInfo& info) {
412 if (!info.pexe_url.is_valid() || info.abi_version < 0 || info.opt_level < 0 || 412 if (!info.pexe_url.is_valid() || info.abi_version < 0 || info.opt_level < 0 ||
413 info.extra_flags.size() > 512) 413 info.extra_flags.size() > 512)
414 return std::string(); 414 return std::string();
415 std::string retval("ABI:"); 415 std::string retval("ABI:");
416 retval += IntToString(info.abi_version) + ";" + "opt:" + 416 retval += IntToString(info.abi_version) + ";" + "opt:" +
417 IntToString(info.opt_level) + ";" + "URL:"; 417 IntToString(info.opt_level) +
418 (info.use_subzero ? "subzero;" : ";") + "URL:";
418 // Filter the username, password, and ref components from the URL 419 // Filter the username, password, and ref components from the URL
419 GURL::Replacements replacements; 420 GURL::Replacements replacements;
420 replacements.ClearUsername(); 421 replacements.ClearUsername();
421 replacements.ClearPassword(); 422 replacements.ClearPassword();
422 replacements.ClearRef(); 423 replacements.ClearRef();
423 GURL key_url(info.pexe_url.ReplaceComponents(replacements)); 424 GURL key_url(info.pexe_url.ReplaceComponents(replacements));
424 retval += key_url.spec() + ";"; 425 retval += key_url.spec() + ";";
425 // You would think that there is already code to format base::Time values 426 // You would think that there is already code to format base::Time values
426 // somewhere, but I haven't found it yet. In any case, doing it ourselves 427 // somewhere, but I haven't found it yet. In any case, doing it ourselves
427 // here means we can keep the format stable. 428 // here means we can keep the format stable.
(...skipping 15 matching lines...) Expand all
443 } 444 }
444 445
445 int PnaclTranslationCache::DoomEntriesBetween( 446 int PnaclTranslationCache::DoomEntriesBetween(
446 base::Time initial, 447 base::Time initial,
447 base::Time end, 448 base::Time end,
448 const CompletionCallback& callback) { 449 const CompletionCallback& callback) {
449 return disk_cache_->DoomEntriesBetween(initial, end, callback); 450 return disk_cache_->DoomEntriesBetween(initial, end, callback);
450 } 451 }
451 452
452 } // namespace pnacl 453 } // namespace pnacl
OLDNEW
« no previous file with comments | « components/nacl/browser/pnacl_host_unittest.cc ('k') | components/nacl/browser/pnacl_translation_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698