| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "content/public/common/result_codes.h" | 50 #include "content/public/common/result_codes.h" |
| 51 #include "content/public/common/sandbox_type.h" | 51 #include "content/public/common/sandbox_type.h" |
| 52 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 52 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
| 53 #include "gpu/command_buffer/service/gpu_preferences.h" | 53 #include "gpu/command_buffer/service/gpu_preferences.h" |
| 54 #include "gpu/command_buffer/service/gpu_switches.h" | 54 #include "gpu/command_buffer/service/gpu_switches.h" |
| 55 #include "ipc/ipc_channel_handle.h" | 55 #include "ipc/ipc_channel_handle.h" |
| 56 #include "ipc/ipc_switches.h" | 56 #include "ipc/ipc_switches.h" |
| 57 #include "ipc/message_filter.h" | 57 #include "ipc/message_filter.h" |
| 58 #include "media/base/media_switches.h" | 58 #include "media/base/media_switches.h" |
| 59 #include "mojo/edk/embedder/embedder.h" | 59 #include "mojo/edk/embedder/embedder.h" |
| 60 #include "services/shell/public/cpp/interface_provider.h" |
| 61 #include "services/shell/public/cpp/interface_registry.h" |
| 60 #include "ui/base/ui_base_switches.h" | 62 #include "ui/base/ui_base_switches.h" |
| 61 #include "ui/events/latency_info.h" | 63 #include "ui/events/latency_info.h" |
| 62 #include "ui/gl/gl_switches.h" | 64 #include "ui/gl/gl_switches.h" |
| 63 | 65 |
| 64 #if defined(OS_ANDROID) | 66 #if defined(OS_ANDROID) |
| 65 #include "base/android/build_info.h" | 67 #include "base/android/build_info.h" |
| 66 #endif | 68 #endif |
| 67 | 69 |
| 68 #if defined(OS_WIN) | 70 #if defined(OS_WIN) |
| 69 #include "base/win/windows_version.h" | 71 #include "base/win/windows_version.h" |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 RecordProcessCrash(); | 916 RecordProcessCrash(); |
| 915 } | 917 } |
| 916 | 918 |
| 917 void GpuProcessHost::OnProcessCrashed(int exit_code) { | 919 void GpuProcessHost::OnProcessCrashed(int exit_code) { |
| 918 SendOutstandingReplies(); | 920 SendOutstandingReplies(); |
| 919 RecordProcessCrash(); | 921 RecordProcessCrash(); |
| 920 GpuDataManagerImpl::GetInstance()->ProcessCrashed( | 922 GpuDataManagerImpl::GetInstance()->ProcessCrashed( |
| 921 process_->GetTerminationStatus(true /* known_dead */, NULL)); | 923 process_->GetTerminationStatus(true /* known_dead */, NULL)); |
| 922 } | 924 } |
| 923 | 925 |
| 924 ServiceRegistry* GpuProcessHost::GetServiceRegistry() { | 926 shell::InterfaceRegistry* GpuProcessHost::GetInterfaceRegistry() { |
| 925 return mojo_application_host_->service_registry(); | 927 return mojo_application_host_->interface_registry(); |
| 928 } |
| 929 |
| 930 shell::InterfaceProvider* GpuProcessHost::GetRemoteInterfaces() { |
| 931 return mojo_application_host_->remote_interfaces(); |
| 926 } | 932 } |
| 927 | 933 |
| 928 GpuProcessHost::GpuProcessKind GpuProcessHost::kind() { | 934 GpuProcessHost::GpuProcessKind GpuProcessHost::kind() { |
| 929 return kind_; | 935 return kind_; |
| 930 } | 936 } |
| 931 | 937 |
| 932 void GpuProcessHost::ForceShutdown() { | 938 void GpuProcessHost::ForceShutdown() { |
| 933 // This is only called on the IO thread so no race against the constructor | 939 // This is only called on the IO thread so no race against the constructor |
| 934 // for another GpuProcessHost. | 940 // for another GpuProcessHost. |
| 935 if (g_gpu_process_hosts[kind_] == this) | 941 if (g_gpu_process_hosts[kind_] == this) |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1173 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
| 1168 ClientIdToShaderCacheMap::iterator iter = | 1174 ClientIdToShaderCacheMap::iterator iter = |
| 1169 client_id_to_shader_cache_.find(client_id); | 1175 client_id_to_shader_cache_.find(client_id); |
| 1170 // If the cache doesn't exist then this is an off the record profile. | 1176 // If the cache doesn't exist then this is an off the record profile. |
| 1171 if (iter == client_id_to_shader_cache_.end()) | 1177 if (iter == client_id_to_shader_cache_.end()) |
| 1172 return; | 1178 return; |
| 1173 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1179 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
| 1174 } | 1180 } |
| 1175 | 1181 |
| 1176 } // namespace content | 1182 } // namespace content |
| OLD | NEW |