| 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/browser_gpu_channel_host_factory.h" | 5 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/browser/gpu/gpu_data_manager_impl.h" | 8 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 9 #include "content/browser/gpu/gpu_process_host.h" | 9 #include "content/browser/gpu/gpu_process_host.h" |
| 10 #include "content/browser/gpu/gpu_surface_tracker.h" | 10 #include "content/browser/gpu/gpu_surface_tracker.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // TODO(piman): Make this asynchronous. | 126 // TODO(piman): Make this asynchronous. |
| 127 request.event.Wait(); | 127 request.event.Wait(); |
| 128 return request.route_id; | 128 return request.route_id; |
| 129 } | 129 } |
| 130 | 130 |
| 131 void BrowserGpuChannelHostFactory::EstablishGpuChannelOnIO( | 131 void BrowserGpuChannelHostFactory::EstablishGpuChannelOnIO( |
| 132 EstablishRequest* request, | 132 EstablishRequest* request, |
| 133 CauseForGpuLaunch cause_for_gpu_launch) { | 133 CauseForGpuLaunch cause_for_gpu_launch) { |
| 134 GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_); | 134 GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_); |
| 135 if (!host) { | 135 if (!host) { |
| 136 host = GpuProcessHost::GetForClient(gpu_client_id_, cause_for_gpu_launch); | 136 host = GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, |
| 137 cause_for_gpu_launch); |
| 137 if (!host) { | 138 if (!host) { |
| 138 request->event.Signal(); | 139 request->event.Signal(); |
| 139 return; | 140 return; |
| 140 } | 141 } |
| 141 gpu_host_id_ = host->host_id(); | 142 gpu_host_id_ = host->host_id(); |
| 142 } | 143 } |
| 143 | 144 |
| 144 host->EstablishGpuChannel( | 145 host->EstablishGpuChannel( |
| 145 gpu_client_id_, | 146 gpu_client_id_, |
| 146 true, | 147 true, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 gpu_channel_->set_gpu_info(request.gpu_info); | 209 gpu_channel_->set_gpu_info(request.gpu_info); |
| 209 content::GetContentClient()->SetGpuInfo(request.gpu_info); | 210 content::GetContentClient()->SetGpuInfo(request.gpu_info); |
| 210 | 211 |
| 211 // Connect to the GPU process if a channel name was received. | 212 // Connect to the GPU process if a channel name was received. |
| 212 gpu_channel_->Connect(request.channel_handle, browser_process_for_gpu); | 213 gpu_channel_->Connect(request.channel_handle, browser_process_for_gpu); |
| 213 | 214 |
| 214 return gpu_channel_.get(); | 215 return gpu_channel_.get(); |
| 215 } | 216 } |
| 216 | 217 |
| 217 } // namespace content | 218 } // namespace content |
| OLD | NEW |