use typedef to name our ID type in SkImageCache

BUG=
R=scroggo@google.com

Review URL: https://codereview.chromium.org/18612003

git-svn-id: http://skia.googlecode.com/svn/trunk/include@9943 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/lazy/SkImageCache.h b/lazy/SkImageCache.h
index bfd5269..7c49261 100644
--- a/lazy/SkImageCache.h
+++ b/lazy/SkImageCache.h
@@ -17,6 +17,8 @@
 class SkImageCache : public SkRefCnt {
 
 public:
+    typedef intptr_t ID;
+
     /**
      *  Allocate memory whose lifetime is managed by the cache. On success, MUST be balanced with a
      *  call to releaseCache and a call to throwAwayCache.
@@ -27,7 +29,7 @@
      *  @return Pointer to the newly allocated memory, or NULL. This memory is safe to use until
      *      releaseCache is called with ID.
      */
-    virtual void* allocAndPinCache(size_t bytes, intptr_t* ID) = 0;
+    virtual void* allocAndPinCache(size_t bytes, ID*) = 0;
 
     /**
      *  Output parameter for pinCache, stating whether the memory still contains the data it held
@@ -60,7 +62,7 @@
      *      this call must be balanced with a call to releaseCache. If NULL, the memory
      *      has been reclaimed, and throwAwayCache MUST NOT be called.
      */
-    virtual void* pinCache(intptr_t ID, DataStatus* status) = 0;
+    virtual void* pinCache(ID, DataStatus* status) = 0;
 
     /**
      *  Inform the cache that it is safe to free the block of memory corresponding to ID. After
@@ -69,19 +71,19 @@
      *  the same ID.
      *  @param ID Unique ID for the memory block which is now safe to age out of the cache.
      */
-    virtual void releaseCache(intptr_t ID) = 0;
+    virtual void releaseCache(ID) = 0;
 
     /**
      *  Inform the cache that the block of memory associated with ID will not be asked for again.
      *  After this call, ID is no longer valid. Must not be called while the associated memory is
      *  pinned. Must be called to balance a successful allocAndPinCache.
      */
-    virtual void throwAwayCache(intptr_t ID) = 0;
+    virtual void throwAwayCache(ID) = 0;
 
     /**
      *  ID which does not correspond to any valid cache.
      */
-    static const intptr_t UNINITIALIZED_ID = 0;
+    static const ID UNINITIALIZED_ID = 0;
 
 #ifdef SK_DEBUG
     /**
diff --git a/lazy/SkLruImageCache.h b/lazy/SkLruImageCache.h
index f655230..3e9d315 100644
--- a/lazy/SkLruImageCache.h
+++ b/lazy/SkLruImageCache.h
@@ -25,7 +25,7 @@
     virtual ~SkLruImageCache();
 
 #ifdef SK_DEBUG
-    virtual MemoryStatus getMemoryStatus(intptr_t ID) const SK_OVERRIDE;
+    virtual MemoryStatus getMemoryStatus(ID) const SK_OVERRIDE;
     virtual void purgeAllUnpinnedCaches() SK_OVERRIDE;
 #endif
 
@@ -45,10 +45,10 @@
      */
     size_t getImageCacheUsed() const { return fRamUsed; }
 
-    virtual void* allocAndPinCache(size_t bytes, intptr_t* ID) SK_OVERRIDE;
-    virtual void* pinCache(intptr_t ID, SkImageCache::DataStatus*) SK_OVERRIDE;
-    virtual void releaseCache(intptr_t ID) SK_OVERRIDE;
-    virtual void throwAwayCache(intptr_t ID) SK_OVERRIDE;
+    virtual void* allocAndPinCache(size_t bytes, ID*) SK_OVERRIDE;
+    virtual void* pinCache(ID, SkImageCache::DataStatus*) SK_OVERRIDE;
+    virtual void releaseCache(ID) SK_OVERRIDE;
+    virtual void throwAwayCache(ID) SK_OVERRIDE;
 
 private:
     // Linked list of recently used. Head is the most recently used, and tail is the least.
@@ -67,7 +67,7 @@
      *  Find the CachedPixels represented by ID, or NULL if not in the cache. Mutex must be locked
      *  before calling.
      */
-    CachedPixels* findByID(intptr_t ID) const;
+    CachedPixels* findByID(ID) const;
 
     /**
      *  If over budget, throw away pixels which are not currently in use until below budget or there
diff --git a/lazy/SkPurgeableImageCache.h b/lazy/SkPurgeableImageCache.h
index 0516ff1..cc2db81 100644
--- a/lazy/SkPurgeableImageCache.h
+++ b/lazy/SkPurgeableImageCache.h
@@ -22,13 +22,13 @@
 public:
     static SkImageCache* Create();
 
-    virtual void* allocAndPinCache(size_t bytes, intptr_t* ID) SK_OVERRIDE;
-    virtual void* pinCache(intptr_t ID, SkImageCache::DataStatus*) SK_OVERRIDE;
-    virtual void releaseCache(intptr_t ID) SK_OVERRIDE;
-    virtual void throwAwayCache(intptr_t ID) SK_OVERRIDE;
+    virtual void* allocAndPinCache(size_t bytes, ID*) SK_OVERRIDE;
+    virtual void* pinCache(ID, SkImageCache::DataStatus*) SK_OVERRIDE;
+    virtual void releaseCache(ID) SK_OVERRIDE;
+    virtual void throwAwayCache(ID) SK_OVERRIDE;
 
 #ifdef SK_DEBUG
-    virtual MemoryStatus getMemoryStatus(intptr_t ID) const SK_OVERRIDE;
+    virtual MemoryStatus getMemoryStatus(ID) const SK_OVERRIDE;
     virtual void purgeAllUnpinnedCaches() SK_OVERRIDE;
     virtual ~SkPurgeableImageCache();
 #endif
@@ -37,9 +37,9 @@
     SkPurgeableImageCache();
 
 #ifdef SK_DEBUG
-    SkTDArray<intptr_t> fRecs;
-    int findRec(intptr_t) const;
+    SkTDArray<ID> fRecs;
+    int findRec(ID) const;
 #endif
-    void removeRec(intptr_t);
+    void removeRec(ID);
 };
 #endif // SkPurgeableImageCache_DEFINED