Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: content/browser/gpu/shader_disk_cache.cc

Issue 2133083002: Remove all remaining traces of MessageLoopProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/macros.h" 7 #include "base/macros.h"
8 #include "base/threading/thread_checker.h" 8 #include "base/threading/thread_checker.h"
9 #include "content/browser/gpu/gpu_process_host.h" 9 #include "content/browser/gpu/gpu_process_host.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 } 525 }
526 526
527 void ShaderDiskCache::Init() { 527 void ShaderDiskCache::Init() {
528 if (is_initialized_) { 528 if (is_initialized_) {
529 NOTREACHED(); // can't initialize disk cache twice. 529 NOTREACHED(); // can't initialize disk cache twice.
530 return; 530 return;
531 } 531 }
532 is_initialized_ = true; 532 is_initialized_ = true;
533 533
534 int rv = disk_cache::CreateCacheBackend( 534 int rv = disk_cache::CreateCacheBackend(
535 net::SHADER_CACHE, 535 net::SHADER_CACHE, net::CACHE_BACKEND_DEFAULT,
536 net::CACHE_BACKEND_DEFAULT,
537 cache_path_.Append(kGpuCachePath), 536 cache_path_.Append(kGpuCachePath),
538 gpu::kDefaultMaxProgramCacheMemoryBytes, 537 gpu::kDefaultMaxProgramCacheMemoryBytes, true,
539 true, 538 BrowserThread::GetTaskRunnerForThread(BrowserThread::CACHE).get(), NULL,
540 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE).get(), 539 &backend_, base::Bind(&ShaderDiskCache::CacheCreatedCallback, this));
541 NULL,
542 &backend_,
543 base::Bind(&ShaderDiskCache::CacheCreatedCallback, this));
544 540
545 if (rv == net::OK) 541 if (rv == net::OK)
546 cache_available_ = true; 542 cache_available_ = true;
547 } 543 }
548 544
549 void ShaderDiskCache::Cache(const std::string& key, const std::string& shader) { 545 void ShaderDiskCache::Cache(const std::string& key, const std::string& shader) {
550 if (!cache_available_) 546 if (!cache_available_)
551 return; 547 return;
552 548
553 scoped_refptr<ShaderDiskCacheEntry> shim = 549 scoped_refptr<ShaderDiskCacheEntry> shim =
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 const net::CompletionCallback& callback) { 613 const net::CompletionCallback& callback) {
618 if (entry_map_.empty()) { 614 if (entry_map_.empty()) {
619 return net::OK; 615 return net::OK;
620 } 616 }
621 cache_complete_callback_ = callback; 617 cache_complete_callback_ = callback;
622 return net::ERR_IO_PENDING; 618 return net::ERR_IO_PENDING;
623 } 619 }
624 620
625 } // namespace content 621 } // namespace content
626 622
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_process_host_ui_shim.cc ('k') | content/browser/indexed_db/indexed_db_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698