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 #include "content/browser/gpu/shader_disk_cache.h" | 5 #include "content/browser/gpu/shader_disk_cache.h" |
6 | 6 |
7 #include "base/threading/thread_checker.h" | 7 #include "base/threading/thread_checker.h" |
8 #include "content/browser/gpu/gpu_process_host.h" | 8 #include "content/browser/gpu/gpu_process_host.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "net/base/cache_type.h" | 10 #include "net/base/cache_type.h" |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 return; | 522 return; |
523 } | 523 } |
524 is_initialized_ = true; | 524 is_initialized_ = true; |
525 | 525 |
526 int rv = disk_cache::CreateCacheBackend( | 526 int rv = disk_cache::CreateCacheBackend( |
527 net::SHADER_CACHE, | 527 net::SHADER_CACHE, |
528 net::CACHE_BACKEND_BLOCKFILE, | 528 net::CACHE_BACKEND_BLOCKFILE, |
529 cache_path_.Append(kGpuCachePath), | 529 cache_path_.Append(kGpuCachePath), |
530 max_cache_size_, | 530 max_cache_size_, |
531 true, | 531 true, |
532 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE), | 532 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE).get(), |
533 NULL, | 533 NULL, |
534 &backend_, | 534 &backend_, |
535 base::Bind(&ShaderDiskCache::CacheCreatedCallback, this)); | 535 base::Bind(&ShaderDiskCache::CacheCreatedCallback, this)); |
536 | 536 |
537 if (rv == net::OK) | 537 if (rv == net::OK) |
538 cache_available_ = true; | 538 cache_available_ = true; |
539 } | 539 } |
540 | 540 |
541 void ShaderDiskCache::Cache(const std::string& key, const std::string& shader) { | 541 void ShaderDiskCache::Cache(const std::string& key, const std::string& shader) { |
542 if (!cache_available_) | 542 if (!cache_available_) |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 const net::CompletionCallback& callback) { | 609 const net::CompletionCallback& callback) { |
610 if (entry_map_.empty()) { | 610 if (entry_map_.empty()) { |
611 return net::OK; | 611 return net::OK; |
612 } | 612 } |
613 cache_complete_callback_ = callback; | 613 cache_complete_callback_ = callback; |
614 return net::ERR_IO_PENDING; | 614 return net::ERR_IO_PENDING; |
615 } | 615 } |
616 | 616 |
617 } // namespace content | 617 } // namespace content |
618 | 618 |
OLD | NEW |