| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 friend class base::RefCounted<ShaderDiskCache>; | 68 friend class base::RefCounted<ShaderDiskCache>; |
| 69 friend class ShaderDiskCacheEntry; | 69 friend class ShaderDiskCacheEntry; |
| 70 friend class ShaderDiskReadHelper; | 70 friend class ShaderDiskReadHelper; |
| 71 friend class ShaderCacheFactory; | 71 friend class ShaderCacheFactory; |
| 72 | 72 |
| 73 explicit ShaderDiskCache(const base::FilePath& cache_path); | 73 explicit ShaderDiskCache(const base::FilePath& cache_path); |
| 74 ~ShaderDiskCache(); | 74 ~ShaderDiskCache(); |
| 75 | 75 |
| 76 void CacheCreatedCallback(int rv); | 76 void CacheCreatedCallback(int rv); |
| 77 | 77 |
| 78 disk_cache::Backend* backend() { return backend_; } | 78 disk_cache::Backend* backend() { return backend_.get(); } |
| 79 | 79 |
| 80 void EntryComplete(void* entry); | 80 void EntryComplete(void* entry); |
| 81 void ReadComplete(); | 81 void ReadComplete(); |
| 82 | 82 |
| 83 bool cache_available_; | 83 bool cache_available_; |
| 84 int host_id_; | 84 int host_id_; |
| 85 base::FilePath cache_path_; | 85 base::FilePath cache_path_; |
| 86 bool is_initialized_; | 86 bool is_initialized_; |
| 87 net::CompletionCallback available_callback_; | 87 net::CompletionCallback available_callback_; |
| 88 net::CompletionCallback cache_complete_callback_; | 88 net::CompletionCallback cache_complete_callback_; |
| 89 | 89 |
| 90 disk_cache::Backend* backend_; | 90 scoped_ptr<disk_cache::Backend> backend_; |
| 91 | 91 |
| 92 scoped_refptr<ShaderDiskReadHelper> helper_; | 92 scoped_refptr<ShaderDiskReadHelper> helper_; |
| 93 std::map<void*, scoped_refptr<ShaderDiskCacheEntry> > entry_map_; | 93 std::map<void*, scoped_refptr<ShaderDiskCacheEntry> > entry_map_; |
| 94 | 94 |
| 95 DISALLOW_COPY_AND_ASSIGN(ShaderDiskCache); | 95 DISALLOW_COPY_AND_ASSIGN(ShaderDiskCache); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 // ShaderCacheFactory maintains a cache of ShaderDiskCache objects | 98 // ShaderCacheFactory maintains a cache of ShaderDiskCache objects |
| 99 // so we only create one per profile directory. | 99 // so we only create one per profile directory. |
| 100 class CONTENT_EXPORT ShaderCacheFactory { | 100 class CONTENT_EXPORT ShaderCacheFactory { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |