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

Side by Side Diff: chrome/browser/nacl_host/pnacl_translation_cache.cc

Issue 24208003: Add PNACL_CACHE cache backend type, and allow larger files for this type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/nacl_host/pnacl_translation_cache_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/nacl_host/pnacl_translation_cache.h" 5 #include "chrome/browser/nacl_host/pnacl_translation_cache.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 const GetNexeCallback& callback) { 365 const GetNexeCallback& callback) {
366 PnaclTranslationCacheEntry* entry = 366 PnaclTranslationCacheEntry* entry =
367 PnaclTranslationCacheEntry::GetReadEntry(AsWeakPtr(), key, callback); 367 PnaclTranslationCacheEntry::GetReadEntry(AsWeakPtr(), key, callback);
368 open_entries_[entry] = entry; 368 open_entries_[entry] = entry;
369 entry->Start(); 369 entry->Start();
370 } 370 }
371 371
372 int PnaclTranslationCache::InitOnDisk(const base::FilePath& cache_directory, 372 int PnaclTranslationCache::InitOnDisk(const base::FilePath& cache_directory,
373 const CompletionCallback& callback) { 373 const CompletionCallback& callback) {
374 in_memory_ = false; 374 in_memory_ = false;
375 return Init(net::DISK_CACHE, cache_directory, 0 /* auto size */, callback); 375 return Init(net::PNACL_CACHE, cache_directory, 0 /* auto size */, callback);
376 } 376 }
377 377
378 int PnaclTranslationCache::InitInMemory(const CompletionCallback& callback) { 378 int PnaclTranslationCache::InitInMemory(const CompletionCallback& callback) {
379 in_memory_ = true; 379 in_memory_ = true;
380 return Init(net::MEMORY_CACHE, base::FilePath(), kMaxMemCacheSize, callback); 380 return Init(net::MEMORY_CACHE, base::FilePath(), kMaxMemCacheSize, callback);
381 } 381 }
382 382
383 int PnaclTranslationCache::Size() { 383 int PnaclTranslationCache::Size() {
384 if (!disk_cache_) 384 if (!disk_cache_)
385 return -1; 385 return -1;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 } 419 }
420 420
421 int PnaclTranslationCache::DoomEntriesBetween( 421 int PnaclTranslationCache::DoomEntriesBetween(
422 base::Time initial, 422 base::Time initial,
423 base::Time end, 423 base::Time end,
424 const CompletionCallback& callback) { 424 const CompletionCallback& callback) {
425 return disk_cache_->DoomEntriesBetween(initial, end, callback); 425 return disk_cache_->DoomEntriesBetween(initial, end, callback);
426 } 426 }
427 427
428 } // namespace pnacl 428 } // namespace pnacl
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/nacl_host/pnacl_translation_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698