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

Unified Diff: chrome/browser/nacl_host/pnacl_translation_cache.h

Issue 15647018: Add read support to PNaClTranslationCache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use smaller 'large' file 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/nacl_host/pnacl_translation_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/nacl_host/pnacl_translation_cache.h
diff --git a/chrome/browser/nacl_host/pnacl_translation_cache.h b/chrome/browser/nacl_host/pnacl_translation_cache.h
index 23a9917a47de45949628252e29ab8df739b4d409..14b18165d803a0cf332bc49bed4a432ea91f1181 100644
--- a/chrome/browser/nacl_host/pnacl_translation_cache.h
+++ b/chrome/browser/nacl_host/pnacl_translation_cache.h
@@ -22,7 +22,7 @@ class Backend;
namespace pnacl_cache {
typedef base::Callback<void(int)> CompletionCallback;
-class PNaClTranslationCacheWriteEntry;
+class PNaClTranslationCacheEntry;
extern const int kMaxMemCacheSize;
class PNaClTranslationCache
@@ -48,19 +48,20 @@ class PNaClTranslationCache
const std::string& nexe,
const CompletionCallback& callback);
- // Retrieve the nexe from the translation cache. (Not implemented yet.)
- int GetNexe(const std::string& key,
- std::string* nexe,
- const CompletionCallback& callback);
+ // Retrieve the nexe from the translation cache. Write the data into |nexe|
+ // and call |callback| with the result (0 on success and <0 otherwise)
+ void GetNexe(const std::string& key,
+ std::string* nexe,
+ const CompletionCallback& callback);
// Return the number of entries in the cache backend.
int Size();
private:
- friend class PNaClTranslationCacheWriteEntry;
- // PNaClTranslationCacheWriteEntry should only use the
- // WriteComplete and backend methods on PNaClTranslationCache.
- void WriteComplete(PNaClTranslationCacheWriteEntry* entry);
+ friend class PNaClTranslationCacheEntry;
+ // PNaClTranslationCacheEntry should only use the
+ // OpComplete and backend methods on PNaClTranslationCache.
+ void OpComplete(PNaClTranslationCacheEntry* entry);
disk_cache::Backend* backend() { return disk_cache_; }
int InitWithDiskBackend(const base::FilePath& disk_cache_dir,
@@ -79,8 +80,7 @@ class PNaClTranslationCache
disk_cache::Backend* disk_cache_;
CompletionCallback init_callback_;
bool in_memory_;
- std::map<void*, scoped_refptr<PNaClTranslationCacheWriteEntry> >
- write_entries_;
+ std::map<void*, scoped_refptr<PNaClTranslationCacheEntry> > open_entries_;
DISALLOW_COPY_AND_ASSIGN(PNaClTranslationCache);
};
« no previous file with comments | « no previous file | chrome/browser/nacl_host/pnacl_translation_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698