| 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 "gpu/command_buffer/common/constants.h" | 10 #include "gpu/command_buffer/common/constants.h" |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 } | 538 } |
| 539 | 539 |
| 540 void ShaderDiskCache::Cache(const std::string& key, const std::string& shader) { | 540 void ShaderDiskCache::Cache(const std::string& key, const std::string& shader) { |
| 541 if (!cache_available_) | 541 if (!cache_available_) |
| 542 return; | 542 return; |
| 543 | 543 |
| 544 scoped_refptr<ShaderDiskCacheEntry> shim = | 544 scoped_refptr<ShaderDiskCacheEntry> shim = |
| 545 new ShaderDiskCacheEntry(AsWeakPtr(), key, shader); | 545 new ShaderDiskCacheEntry(AsWeakPtr(), key, shader); |
| 546 shim->Cache(); | 546 shim->Cache(); |
| 547 | 547 |
| 548 entry_map_[shim] = shim; | 548 entry_map_[shim.get()] = shim; |
| 549 } | 549 } |
| 550 | 550 |
| 551 int ShaderDiskCache::Clear( | 551 int ShaderDiskCache::Clear( |
| 552 const base::Time begin_time, const base::Time end_time, | 552 const base::Time begin_time, const base::Time end_time, |
| 553 const net::CompletionCallback& completion_callback) { | 553 const net::CompletionCallback& completion_callback) { |
| 554 int rv; | 554 int rv; |
| 555 if (begin_time.is_null()) { | 555 if (begin_time.is_null()) { |
| 556 rv = backend_->DoomAllEntries(completion_callback); | 556 rv = backend_->DoomAllEntries(completion_callback); |
| 557 } else { | 557 } else { |
| 558 rv = backend_->DoomEntriesBetween(begin_time, end_time, | 558 rv = backend_->DoomEntriesBetween(begin_time, end_time, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 const net::CompletionCallback& callback) { | 608 const net::CompletionCallback& callback) { |
| 609 if (entry_map_.empty()) { | 609 if (entry_map_.empty()) { |
| 610 return net::OK; | 610 return net::OK; |
| 611 } | 611 } |
| 612 cache_complete_callback_ = callback; | 612 cache_complete_callback_ = callback; |
| 613 return net::ERR_IO_PENDING; | 613 return net::ERR_IO_PENDING; |
| 614 } | 614 } |
| 615 | 615 |
| 616 } // namespace content | 616 } // namespace content |
| 617 | 617 |
| OLD | NEW |