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

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

Issue 20737002: Change the API of disk_cache::CreateCacheBackend to use scoped_ptr (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows specific file. Created 7 years, 5 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 "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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 } 276 }
277 } 277 }
278 278
279 ////////////////////////////////////////////////////////////////////// 279 //////////////////////////////////////////////////////////////////////
280 void PnaclTranslationCache::OpComplete(PnaclTranslationCacheEntry* entry) { 280 void PnaclTranslationCache::OpComplete(PnaclTranslationCacheEntry* entry) {
281 open_entries_.erase(entry); 281 open_entries_.erase(entry);
282 } 282 }
283 283
284 ////////////////////////////////////////////////////////////////////// 284 //////////////////////////////////////////////////////////////////////
285 // Construction and cache backend initialization 285 // Construction and cache backend initialization
286 PnaclTranslationCache::PnaclTranslationCache() 286 PnaclTranslationCache::PnaclTranslationCache() : in_memory_(false) {}
287 : disk_cache_(NULL), in_memory_(false) {}
288 287
289 PnaclTranslationCache::~PnaclTranslationCache() { delete disk_cache_; } 288 PnaclTranslationCache::~PnaclTranslationCache() {}
290 289
291 int PnaclTranslationCache::InitWithDiskBackend( 290 int PnaclTranslationCache::InitWithDiskBackend(
292 const base::FilePath& cache_dir, 291 const base::FilePath& cache_dir,
293 int cache_size, 292 int cache_size,
294 const CompletionCallback& callback) { 293 const CompletionCallback& callback) {
295 return Init(net::DISK_CACHE, cache_dir, cache_size, callback); 294 return Init(net::DISK_CACHE, cache_dir, cache_size, callback);
296 } 295 }
297 296
298 int PnaclTranslationCache::InitWithMemBackend( 297 int PnaclTranslationCache::InitWithMemBackend(
299 int cache_size, 298 int cache_size,
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 return rv; 371 return rv;
373 } 372 }
374 373
375 int PnaclTranslationCache::Size() { 374 int PnaclTranslationCache::Size() {
376 if (!disk_cache_) 375 if (!disk_cache_)
377 return -1; 376 return -1;
378 return disk_cache_->GetEntryCount(); 377 return disk_cache_->GetEntryCount();
379 } 378 }
380 379
381 } // namespace pnacl 380 } // namespace pnacl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698