OLD | NEW |
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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 // Post a task to create the corresponding GpuProcessHostUIShim. The | 431 // Post a task to create the corresponding GpuProcessHostUIShim. The |
432 // GpuProcessHostUIShim will be destroyed if either the browser exits, | 432 // GpuProcessHostUIShim will be destroyed if either the browser exits, |
433 // in which case it calls GpuProcessHostUIShim::DestroyAll, or the | 433 // in which case it calls GpuProcessHostUIShim::DestroyAll, or the |
434 // GpuProcessHost is destroyed, which happens when the corresponding GPU | 434 // GpuProcessHost is destroyed, which happens when the corresponding GPU |
435 // process terminates or fails to launch. | 435 // process terminates or fails to launch. |
436 BrowserThread::PostTask( | 436 BrowserThread::PostTask( |
437 BrowserThread::UI, | 437 BrowserThread::UI, |
438 FROM_HERE, | 438 FROM_HERE, |
439 base::Bind(base::IgnoreResult(&GpuProcessHostUIShim::Create), host_id)); | 439 base::Bind(base::IgnoreResult(&GpuProcessHostUIShim::Create), host_id)); |
440 | 440 |
| 441 // TODO(bcwhite): Update this with the correct memory size. |
441 process_.reset(new BrowserChildProcessHostImpl(PROCESS_TYPE_GPU, this, | 442 process_.reset(new BrowserChildProcessHostImpl(PROCESS_TYPE_GPU, this, |
442 child_token_)); | 443 child_token_, |
| 444 100 << 10 /* 100 KiB */, |
| 445 "GpuMetrics")); |
443 } | 446 } |
444 | 447 |
445 GpuProcessHost::~GpuProcessHost() { | 448 GpuProcessHost::~GpuProcessHost() { |
446 DCHECK(CalledOnValidThread()); | 449 DCHECK(CalledOnValidThread()); |
447 | 450 |
448 SendOutstandingReplies(); | 451 SendOutstandingReplies(); |
449 | 452 |
450 // In case we never started, clean up. | 453 // In case we never started, clean up. |
451 while (!queued_messages_.empty()) { | 454 while (!queued_messages_.empty()) { |
452 delete queued_messages_.front(); | 455 delete queued_messages_.front(); |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1175 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1173 ClientIdToShaderCacheMap::iterator iter = | 1176 ClientIdToShaderCacheMap::iterator iter = |
1174 client_id_to_shader_cache_.find(client_id); | 1177 client_id_to_shader_cache_.find(client_id); |
1175 // If the cache doesn't exist then this is an off the record profile. | 1178 // If the cache doesn't exist then this is an off the record profile. |
1176 if (iter == client_id_to_shader_cache_.end()) | 1179 if (iter == client_id_to_shader_cache_.end()) |
1177 return; | 1180 return; |
1178 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1181 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1179 } | 1182 } |
1180 | 1183 |
1181 } // namespace content | 1184 } // namespace content |
OLD | NEW |