OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |