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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 ConnectionFilterImpl(GpuProcessHost* host) : host_(host) {} | 336 ConnectionFilterImpl(GpuProcessHost* host) : host_(host) {} |
334 | 337 |
335 private: | 338 private: |
336 // ConnectionFilter: | 339 // ConnectionFilter: |
337 bool OnConnect(const service_manager::Identity& remote_identity, | 340 bool OnConnect(const service_manager::Identity& remote_identity, |
338 service_manager::InterfaceRegistry* registry, | 341 service_manager::InterfaceRegistry* registry, |
339 service_manager::Connector* connector) override { | 342 service_manager::Connector* connector) override { |
340 if (remote_identity.name() != mojom::kGpuServiceName) | 343 if (remote_identity.name() != mojom::kGpuServiceName) |
341 return false; | 344 return false; |
342 | 345 |
| 346 registry->AddInterface( |
| 347 base::Bind( |
| 348 &memory_instrumentation::CoordinatorImpl::BindCoordinatorRequest, |
| 349 base::Unretained( |
| 350 BrowserMainLoop::GetMemoryInstrumentationCoordinator())), |
| 351 content::BrowserThread::GetTaskRunnerForThread( |
| 352 content::BrowserThread::UI)); |
| 353 |
343 GetContentClient()->browser()->ExposeInterfacesToGpuProcess(registry, | 354 GetContentClient()->browser()->ExposeInterfacesToGpuProcess(registry, |
344 host_); | 355 host_); |
345 return true; | 356 return true; |
346 } | 357 } |
347 | 358 |
348 GpuProcessHost* host_; | 359 GpuProcessHost* host_; |
349 | 360 |
350 DISALLOW_COPY_AND_ASSIGN(ConnectionFilterImpl); | 361 DISALLOW_COPY_AND_ASSIGN(ConnectionFilterImpl); |
351 }; | 362 }; |
352 | 363 |
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 GetShaderCacheFactorySingleton()->Get(client_id); | 1222 GetShaderCacheFactorySingleton()->Get(client_id); |
1212 if (!cache.get()) | 1223 if (!cache.get()) |
1213 return; | 1224 return; |
1214 | 1225 |
1215 cache->set_shader_loaded_callback(base::Bind(&HostLoadedShader, host_id_)); | 1226 cache->set_shader_loaded_callback(base::Bind(&HostLoadedShader, host_id_)); |
1216 | 1227 |
1217 client_id_to_shader_cache_[client_id] = cache; | 1228 client_id_to_shader_cache_[client_id] = cache; |
1218 } | 1229 } |
1219 | 1230 |
1220 } // namespace content | 1231 } // namespace content |
OLD | NEW |