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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 void PNaClTranslationCache::WriteComplete( | 217 void PNaClTranslationCache::WriteComplete( |
218 PNaClTranslationCacheWriteEntry* entry) { | 218 PNaClTranslationCacheWriteEntry* entry) { |
219 write_entries_.erase(entry); | 219 write_entries_.erase(entry); |
220 } | 220 } |
221 | 221 |
222 ////////////////////////////////////////////////////////////////////// | 222 ////////////////////////////////////////////////////////////////////// |
223 // Construction and cache backend initialization | 223 // Construction and cache backend initialization |
224 PNaClTranslationCache::PNaClTranslationCache() | 224 PNaClTranslationCache::PNaClTranslationCache() |
225 : disk_cache_(NULL), in_memory_(false) {} | 225 : disk_cache_(NULL), in_memory_(false) {} |
226 | 226 |
227 PNaClTranslationCache::~PNaClTranslationCache() {} | 227 PNaClTranslationCache::~PNaClTranslationCache() { |
| 228 delete disk_cache_; |
| 229 } |
228 | 230 |
229 int PNaClTranslationCache::InitWithDiskBackend( | 231 int PNaClTranslationCache::InitWithDiskBackend( |
230 const base::FilePath& cache_dir, | 232 const base::FilePath& cache_dir, |
231 int cache_size, | 233 int cache_size, |
232 const net::CompletionCallback& callback) { | 234 const net::CompletionCallback& callback) { |
233 return Init(net::DISK_CACHE, cache_dir, cache_size, callback); | 235 return Init(net::DISK_CACHE, cache_dir, cache_size, callback); |
234 } | 236 } |
235 | 237 |
236 int PNaClTranslationCache::InitWithMemBackend( | 238 int PNaClTranslationCache::InitWithMemBackend( |
237 int cache_size, | 239 int cache_size, |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 return rv; | 315 return rv; |
314 } | 316 } |
315 | 317 |
316 int PNaClTranslationCache::Size() { | 318 int PNaClTranslationCache::Size() { |
317 if (!disk_cache_) | 319 if (!disk_cache_) |
318 return -1; | 320 return -1; |
319 return disk_cache_->GetEntryCount(); | 321 return disk_cache_->GetEntryCount(); |
320 } | 322 } |
321 | 323 |
322 } // namespace nacl_cache | 324 } // namespace nacl_cache |
OLD | NEW |