OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef CONTENT_BROWSER_GPU_SHADER_DISK_CACHE_H_ | 5 #ifndef CONTENT_BROWSER_GPU_SHADER_DISK_CACHE_H_ |
6 #define CONTENT_BROWSER_GPU_SHADER_DISK_CACHE_H_ | 6 #define CONTENT_BROWSER_GPU_SHADER_DISK_CACHE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // Remove the path mapping for |client_id|. | 119 // Remove the path mapping for |client_id|. |
120 void RemoveCacheInfo(int32 client_id); | 120 void RemoveCacheInfo(int32 client_id); |
121 | 121 |
122 // Set the provided |cache| into the cache map for the given |path|. | 122 // Set the provided |cache| into the cache map for the given |path|. |
123 void AddToCache(const base::FilePath& path, ShaderDiskCache* cache); | 123 void AddToCache(const base::FilePath& path, ShaderDiskCache* cache); |
124 | 124 |
125 // Remove the provided |path| from our cache map. | 125 // Remove the provided |path| from our cache map. |
126 void RemoveFromCache(const base::FilePath& path); | 126 void RemoveFromCache(const base::FilePath& path); |
127 | 127 |
128 private: | 128 private: |
129 friend struct DefaultSingletonTraits<ShaderCacheFactory>; | 129 friend struct base::DefaultSingletonTraits<ShaderCacheFactory>; |
130 friend class ShaderClearHelper; | 130 friend class ShaderClearHelper; |
131 | 131 |
132 ShaderCacheFactory(); | 132 ShaderCacheFactory(); |
133 ~ShaderCacheFactory(); | 133 ~ShaderCacheFactory(); |
134 | 134 |
135 scoped_refptr<ShaderDiskCache> GetByPath(const base::FilePath& path); | 135 scoped_refptr<ShaderDiskCache> GetByPath(const base::FilePath& path); |
136 void CacheCleared(const base::FilePath& path); | 136 void CacheCleared(const base::FilePath& path); |
137 | 137 |
138 typedef std::map<base::FilePath, ShaderDiskCache*> ShaderCacheMap; | 138 typedef std::map<base::FilePath, ShaderDiskCache*> ShaderCacheMap; |
139 ShaderCacheMap shader_cache_map_; | 139 ShaderCacheMap shader_cache_map_; |
140 | 140 |
141 typedef std::map<int32, base::FilePath> ClientIdToPathMap; | 141 typedef std::map<int32, base::FilePath> ClientIdToPathMap; |
142 ClientIdToPathMap client_id_to_path_map_; | 142 ClientIdToPathMap client_id_to_path_map_; |
143 | 143 |
144 typedef std::queue<scoped_refptr<ShaderClearHelper> > ShaderClearQueue; | 144 typedef std::queue<scoped_refptr<ShaderClearHelper> > ShaderClearQueue; |
145 typedef std::map<base::FilePath, ShaderClearQueue> ShaderClearMap; | 145 typedef std::map<base::FilePath, ShaderClearQueue> ShaderClearMap; |
146 ShaderClearMap shader_clear_map_; | 146 ShaderClearMap shader_clear_map_; |
147 | 147 |
148 DISALLOW_COPY_AND_ASSIGN(ShaderCacheFactory); | 148 DISALLOW_COPY_AND_ASSIGN(ShaderCacheFactory); |
149 }; | 149 }; |
150 | 150 |
151 } // namespace content | 151 } // namespace content |
152 | 152 |
153 #endif // CONTENT_BROWSER_GPU_SHADER_DISK_CACHE_H_ | 153 #endif // CONTENT_BROWSER_GPU_SHADER_DISK_CACHE_H_ |
154 | 154 |
OLD | NEW |