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

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

Issue 16295020: Fix leak in pnacl translation cache and remove check suppressions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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