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

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

Issue 16294003: Update content/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/gpu_process_host.h" 5 #include "content/browser/gpu/gpu_process_host.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/base_switches.h" 8 #include "base/base_switches.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 std::string prefix = GetShaderPrefixKey(); 1247 std::string prefix = GetShaderPrefixKey();
1248 if (!key.compare(0, prefix.length(), prefix)) 1248 if (!key.compare(0, prefix.length(), prefix))
1249 Send(new GpuMsg_LoadedShader(data)); 1249 Send(new GpuMsg_LoadedShader(data));
1250 } 1250 }
1251 1251
1252 void GpuProcessHost::CreateChannelCache(int32 client_id, size_t cache_size) { 1252 void GpuProcessHost::CreateChannelCache(int32 client_id, size_t cache_size) {
1253 TRACE_EVENT0("gpu", "GpuProcessHost::CreateChannelCache"); 1253 TRACE_EVENT0("gpu", "GpuProcessHost::CreateChannelCache");
1254 1254
1255 scoped_refptr<ShaderDiskCache> cache = 1255 scoped_refptr<ShaderDiskCache> cache =
1256 ShaderCacheFactory::GetInstance()->Get(client_id); 1256 ShaderCacheFactory::GetInstance()->Get(client_id);
1257 if (!cache) 1257 if (!cache.get())
1258 return; 1258 return;
1259 1259
1260 cache->set_max_cache_size(cache_size); 1260 cache->set_max_cache_size(cache_size);
1261 cache->set_host_id(host_id_); 1261 cache->set_host_id(host_id_);
1262 1262
1263 client_id_to_shader_cache_[client_id] = cache; 1263 client_id_to_shader_cache_[client_id] = cache;
1264 } 1264 }
1265 1265
1266 void GpuProcessHost::OnDestroyChannel(int32 client_id) { 1266 void GpuProcessHost::OnDestroyChannel(int32 client_id) {
1267 TRACE_EVENT0("gpu", "GpuProcessHost::OnDestroyChannel"); 1267 TRACE_EVENT0("gpu", "GpuProcessHost::OnDestroyChannel");
1268 client_id_to_shader_cache_.erase(client_id); 1268 client_id_to_shader_cache_.erase(client_id);
1269 } 1269 }
1270 1270
1271 void GpuProcessHost::OnCacheShader(int32 client_id, 1271 void GpuProcessHost::OnCacheShader(int32 client_id,
1272 const std::string& key, 1272 const std::string& key,
1273 const std::string& shader) { 1273 const std::string& shader) {
1274 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); 1274 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader");
1275 ClientIdToShaderCacheMap::iterator iter = 1275 ClientIdToShaderCacheMap::iterator iter =
1276 client_id_to_shader_cache_.find(client_id); 1276 client_id_to_shader_cache_.find(client_id);
1277 // If the cache doesn't exist then this is an off the record profile. 1277 // If the cache doesn't exist then this is an off the record profile.
1278 if (iter == client_id_to_shader_cache_.end()) 1278 if (iter == client_id_to_shader_cache_.end())
1279 return; 1279 return;
1280 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); 1280 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader);
1281 } 1281 }
1282 1282
1283 } // namespace content 1283 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.cc ('k') | content/browser/gpu/shader_disk_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698