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 10 matching lines...) Expand all Loading... |
21 #include "base/memory/ref_counted.h" | 21 #include "base/memory/ref_counted.h" |
22 #include "base/metrics/field_trial.h" | 22 #include "base/metrics/field_trial.h" |
23 #include "base/metrics/histogram_macros.h" | 23 #include "base/metrics/histogram_macros.h" |
24 #include "base/sha1.h" | 24 #include "base/sha1.h" |
25 #include "base/threading/thread.h" | 25 #include "base/threading/thread.h" |
26 #include "base/threading/thread_task_runner_handle.h" | 26 #include "base/threading/thread_task_runner_handle.h" |
27 #include "base/trace_event/trace_event.h" | 27 #include "base/trace_event/trace_event.h" |
28 #include "build/build_config.h" | 28 #include "build/build_config.h" |
29 #include "components/tracing/common/tracing_switches.h" | 29 #include "components/tracing/common/tracing_switches.h" |
30 #include "content/browser/browser_child_process_host_impl.h" | 30 #include "content/browser/browser_child_process_host_impl.h" |
| 31 #include "content/browser/browser_main_loop.h" |
31 #include "content/browser/gpu/compositor_util.h" | 32 #include "content/browser/gpu/compositor_util.h" |
32 #include "content/browser/gpu/gpu_data_manager_impl.h" | 33 #include "content/browser/gpu/gpu_data_manager_impl.h" |
33 #include "content/browser/gpu/gpu_main_thread_factory.h" | 34 #include "content/browser/gpu/gpu_main_thread_factory.h" |
34 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 35 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
35 #include "content/browser/gpu/shader_cache_factory.h" | 36 #include "content/browser/gpu/shader_cache_factory.h" |
36 #include "content/browser/renderer_host/render_widget_host_impl.h" | 37 #include "content/browser/renderer_host/render_widget_host_impl.h" |
37 #include "content/browser/renderer_host/render_widget_host_view_frame_subscriber
.h" | 38 #include "content/browser/renderer_host/render_widget_host_view_frame_subscriber
.h" |
38 #include "content/browser/service_manager/service_manager_context.h" | 39 #include "content/browser/service_manager/service_manager_context.h" |
39 #include "content/common/child_process_host_impl.h" | 40 #include "content/common/child_process_host_impl.h" |
40 #include "content/common/establish_channel_params.h" | 41 #include "content/common/establish_channel_params.h" |
(...skipping 18 matching lines...) Expand all Loading... |
59 #include "gpu/command_buffer/service/gpu_preferences.h" | 60 #include "gpu/command_buffer/service/gpu_preferences.h" |
60 #include "gpu/command_buffer/service/gpu_switches.h" | 61 #include "gpu/command_buffer/service/gpu_switches.h" |
61 #include "gpu/config/gpu_driver_bug_list.h" | 62 #include "gpu/config/gpu_driver_bug_list.h" |
62 #include "gpu/ipc/host/shader_disk_cache.h" | 63 #include "gpu/ipc/host/shader_disk_cache.h" |
63 #include "gpu/ipc/service/switches.h" | 64 #include "gpu/ipc/service/switches.h" |
64 #include "ipc/ipc_channel_handle.h" | 65 #include "ipc/ipc_channel_handle.h" |
65 #include "ipc/message_filter.h" | 66 #include "ipc/message_filter.h" |
66 #include "media/base/media_switches.h" | 67 #include "media/base/media_switches.h" |
67 #include "media/media_features.h" | 68 #include "media/media_features.h" |
68 #include "mojo/edk/embedder/embedder.h" | 69 #include "mojo/edk/embedder/embedder.h" |
| 70 #include "services/resource_coordinator/memory/coordinator/coordinator_impl.h" |
69 #include "services/service_manager/public/cpp/connection.h" | 71 #include "services/service_manager/public/cpp/connection.h" |
70 #include "services/service_manager/public/cpp/interface_provider.h" | 72 #include "services/service_manager/public/cpp/interface_provider.h" |
| 73 #include "services/service_manager/public/cpp/interface_registry.h" |
71 #include "services/service_manager/runner/common/client_util.h" | 74 #include "services/service_manager/runner/common/client_util.h" |
72 #include "ui/base/ui_base_switches.h" | 75 #include "ui/base/ui_base_switches.h" |
73 #include "ui/events/latency_info.h" | 76 #include "ui/events/latency_info.h" |
74 #include "ui/gfx/switches.h" | 77 #include "ui/gfx/switches.h" |
75 #include "ui/gl/gl_switches.h" | 78 #include "ui/gl/gl_switches.h" |
76 | 79 |
77 #if defined(OS_ANDROID) | 80 #if defined(OS_ANDROID) |
78 #include "base/android/build_info.h" | 81 #include "base/android/build_info.h" |
79 #endif | 82 #endif |
80 | 83 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 ConnectionFilterImpl(GpuProcessHost* host) : host_(host) {} | 335 ConnectionFilterImpl(GpuProcessHost* host) : host_(host) {} |
333 | 336 |
334 private: | 337 private: |
335 // ConnectionFilter: | 338 // ConnectionFilter: |
336 bool OnConnect(const service_manager::Identity& remote_identity, | 339 bool OnConnect(const service_manager::Identity& remote_identity, |
337 service_manager::InterfaceRegistry* registry, | 340 service_manager::InterfaceRegistry* registry, |
338 service_manager::Connector* connector) override { | 341 service_manager::Connector* connector) override { |
339 if (remote_identity.name() != mojom::kGpuServiceName) | 342 if (remote_identity.name() != mojom::kGpuServiceName) |
340 return false; | 343 return false; |
341 | 344 |
| 345 registry->AddInterface( |
| 346 base::Bind( |
| 347 &memory_instrumentation::CoordinatorImpl::BindCoordinatorRequest, |
| 348 base::Unretained( |
| 349 memory_instrumentation::CoordinatorImpl::GetInstance())), |
| 350 content::BrowserThread::GetTaskRunnerForThread( |
| 351 content::BrowserThread::UI)); |
| 352 |
342 GetContentClient()->browser()->ExposeInterfacesToGpuProcess(registry, | 353 GetContentClient()->browser()->ExposeInterfacesToGpuProcess(registry, |
343 host_); | 354 host_); |
344 return true; | 355 return true; |
345 } | 356 } |
346 | 357 |
347 GpuProcessHost* host_; | 358 GpuProcessHost* host_; |
348 | 359 |
349 DISALLOW_COPY_AND_ASSIGN(ConnectionFilterImpl); | 360 DISALLOW_COPY_AND_ASSIGN(ConnectionFilterImpl); |
350 }; | 361 }; |
351 | 362 |
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 GetShaderCacheFactorySingleton()->Get(client_id); | 1221 GetShaderCacheFactorySingleton()->Get(client_id); |
1211 if (!cache.get()) | 1222 if (!cache.get()) |
1212 return; | 1223 return; |
1213 | 1224 |
1214 cache->set_shader_loaded_callback(base::Bind(&HostLoadedShader, host_id_)); | 1225 cache->set_shader_loaded_callback(base::Bind(&HostLoadedShader, host_id_)); |
1215 | 1226 |
1216 client_id_to_shader_cache_[client_id] = cache; | 1227 client_id_to_shader_cache_[client_id] = cache; |
1217 } | 1228 } |
1218 | 1229 |
1219 } // namespace content | 1230 } // namespace content |
OLD | NEW |