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 "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "content/public/browser/content_browser_client.h" | 30 #include "content/public/browser/content_browser_client.h" |
31 #include "content/public/browser/render_process_host.h" | 31 #include "content/public/browser/render_process_host.h" |
32 #include "content/public/browser/render_widget_host_view.h" | 32 #include "content/public/browser/render_widget_host_view.h" |
33 #include "content/public/common/content_client.h" | 33 #include "content/public/common/content_client.h" |
34 #include "content/public/common/content_switches.h" | 34 #include "content/public/common/content_switches.h" |
35 #include "content/public/common/result_codes.h" | 35 #include "content/public/common/result_codes.h" |
36 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 36 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
37 #include "gpu/command_buffer/service/gpu_switches.h" | 37 #include "gpu/command_buffer/service/gpu_switches.h" |
38 #include "ipc/ipc_channel_handle.h" | 38 #include "ipc/ipc_channel_handle.h" |
39 #include "ipc/ipc_switches.h" | 39 #include "ipc/ipc_switches.h" |
| 40 #include "ipc/message_filter.h" |
40 #include "ui/events/latency_info.h" | 41 #include "ui/events/latency_info.h" |
41 #include "ui/gl/gl_switches.h" | 42 #include "ui/gl/gl_switches.h" |
42 | 43 |
43 | 44 |
44 #if defined(OS_WIN) | 45 #if defined(OS_WIN) |
45 #include "base/win/windows_version.h" | 46 #include "base/win/windows_version.h" |
46 #include "content/common/sandbox_win.h" | 47 #include "content/common/sandbox_win.h" |
47 #include "sandbox/win/src/sandbox_policy.h" | 48 #include "sandbox/win/src/sandbox_policy.h" |
48 #include "ui/gfx/switches.h" | 49 #include "ui/gfx/switches.h" |
49 #endif | 50 #endif |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 bool result = process_->Send(msg); | 541 bool result = process_->Send(msg); |
541 if (!result) { | 542 if (!result) { |
542 // Channel is hosed, but we may not get destroyed for a while. Send | 543 // Channel is hosed, but we may not get destroyed for a while. Send |
543 // outstanding channel creation failures now so that the caller can restart | 544 // outstanding channel creation failures now so that the caller can restart |
544 // with a new process/channel without waiting. | 545 // with a new process/channel without waiting. |
545 SendOutstandingReplies(); | 546 SendOutstandingReplies(); |
546 } | 547 } |
547 return result; | 548 return result; |
548 } | 549 } |
549 | 550 |
550 void GpuProcessHost::AddFilter(IPC::ChannelProxy::MessageFilter* filter) { | 551 void GpuProcessHost::AddFilter(IPC::MessageFilter* filter) { |
551 DCHECK(CalledOnValidThread()); | 552 DCHECK(CalledOnValidThread()); |
552 process_->GetHost()->AddFilter(filter); | 553 process_->GetHost()->AddFilter(filter); |
553 } | 554 } |
554 | 555 |
555 bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) { | 556 bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) { |
556 DCHECK(CalledOnValidThread()); | 557 DCHECK(CalledOnValidThread()); |
557 IPC_BEGIN_MESSAGE_MAP(GpuProcessHost, message) | 558 IPC_BEGIN_MESSAGE_MAP(GpuProcessHost, message) |
558 IPC_MESSAGE_HANDLER(GpuHostMsg_Initialized, OnInitialized) | 559 IPC_MESSAGE_HANDLER(GpuHostMsg_Initialized, OnInitialized) |
559 IPC_MESSAGE_HANDLER(GpuHostMsg_ChannelEstablished, OnChannelEstablished) | 560 IPC_MESSAGE_HANDLER(GpuHostMsg_ChannelEstablished, OnChannelEstablished) |
560 IPC_MESSAGE_HANDLER(GpuHostMsg_CommandBufferCreated, OnCommandBufferCreated) | 561 IPC_MESSAGE_HANDLER(GpuHostMsg_CommandBufferCreated, OnCommandBufferCreated) |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1057 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1057 ClientIdToShaderCacheMap::iterator iter = | 1058 ClientIdToShaderCacheMap::iterator iter = |
1058 client_id_to_shader_cache_.find(client_id); | 1059 client_id_to_shader_cache_.find(client_id); |
1059 // If the cache doesn't exist then this is an off the record profile. | 1060 // If the cache doesn't exist then this is an off the record profile. |
1060 if (iter == client_id_to_shader_cache_.end()) | 1061 if (iter == client_id_to_shader_cache_.end()) |
1061 return; | 1062 return; |
1062 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1063 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1063 } | 1064 } |
1064 | 1065 |
1065 } // namespace content | 1066 } // namespace content |
OLD | NEW |