| 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 GPU_IPC_HOST_SHADER_DISK_CACHE_H_ | 5 #ifndef GPU_IPC_HOST_SHADER_DISK_CACHE_H_ |
| 6 #define GPU_IPC_HOST_SHADER_DISK_CACHE_H_ | 6 #define GPU_IPC_HOST_SHADER_DISK_CACHE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 // Clear the shader disk cache for the given |path|. This supports unbounded | 110 // Clear the shader disk cache for the given |path|. This supports unbounded |
| 111 // deletes in either direction by using null Time values for either | 111 // deletes in either direction by using null Time values for either |
| 112 // |begin_time| or |end_time|. The |callback| will be executed when the | 112 // |begin_time| or |end_time|. The |callback| will be executed when the |
| 113 // clear is complete. | 113 // clear is complete. |
| 114 void ClearByPath(const base::FilePath& path, | 114 void ClearByPath(const base::FilePath& path, |
| 115 const base::Time& begin_time, | 115 const base::Time& begin_time, |
| 116 const base::Time& end_time, | 116 const base::Time& end_time, |
| 117 const base::Closure& callback); | 117 const base::Closure& callback); |
| 118 | 118 |
| 119 // Same as ClearByPath, but looks up the cache by |client_id|. The |callback| |
| 120 // will be executed when the clear is complete. |
| 121 void ClearByClientId(int32_t client_id, |
| 122 const base::Time& begin_time, |
| 123 const base::Time& end_time, |
| 124 const base::Closure& callback); |
| 125 |
| 119 // Retrieve the shader disk cache for the provided |client_id|. | 126 // Retrieve the shader disk cache for the provided |client_id|. |
| 120 scoped_refptr<ShaderDiskCache> Get(int32_t client_id); | 127 scoped_refptr<ShaderDiskCache> Get(int32_t client_id); |
| 121 | 128 |
| 122 // Set the |path| to be used for the disk cache for |client_id|. | 129 // Set the |path| to be used for the disk cache for |client_id|. |
| 123 void SetCacheInfo(int32_t client_id, const base::FilePath& path); | 130 void SetCacheInfo(int32_t client_id, const base::FilePath& path); |
| 124 | 131 |
| 125 // Remove the path mapping for |client_id|. | 132 // Remove the path mapping for |client_id|. |
| 126 void RemoveCacheInfo(int32_t client_id); | 133 void RemoveCacheInfo(int32_t client_id); |
| 127 | 134 |
| 128 // Set the provided |cache| into the cache map for the given |path|. | 135 // Set the provided |cache| into the cache map for the given |path|. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 148 using ShaderClearQueue = std::queue<std::unique_ptr<ShaderClearHelper>>; | 155 using ShaderClearQueue = std::queue<std::unique_ptr<ShaderClearHelper>>; |
| 149 using ShaderClearMap = std::map<base::FilePath, ShaderClearQueue>; | 156 using ShaderClearMap = std::map<base::FilePath, ShaderClearQueue>; |
| 150 ShaderClearMap shader_clear_map_; | 157 ShaderClearMap shader_clear_map_; |
| 151 | 158 |
| 152 DISALLOW_COPY_AND_ASSIGN(ShaderCacheFactory); | 159 DISALLOW_COPY_AND_ASSIGN(ShaderCacheFactory); |
| 153 }; | 160 }; |
| 154 | 161 |
| 155 } // namespace gpu | 162 } // namespace gpu |
| 156 | 163 |
| 157 #endif // GPU_IPC_HOST_SHADER_DISK_CACHE_H_ | 164 #endif // GPU_IPC_HOST_SHADER_DISK_CACHE_H_ |
| OLD | NEW |